Commit graph

287 commits

Author SHA1 Message Date
Niklas Fasching
08ff3ac22e Add monospace hack to example css
relative font sizes inside pre tags are not honored by default. this is the
industry standard way of fixing that. go figure...

https://github.com/necolas/normalize.css#extended-details-and-known-issues
2018-12-11 20:38:07 +01:00
Niklas Fasching
07d90c960c Add travis-ci badge to README 2018-12-11 18:03:19 +01:00
Niklas Fasching
81f74f4ad9 Refactor keyword parsing/rendering & add support for ATTR_HTML 2018-12-11 18:03:19 +01:00
Niklas Fasching
a859264420 Fix default HighlightCodeBlock fn: Write tags on separate lines 2018-12-11 17:30:20 +01:00
Niklas Fasching
486720c1b1 Update blocks.org fixture 2018-12-11 16:11:07 +01:00
Niklas Fasching
b1a03e2d27 Make highlightCodeBlock render enclosing div tags on separate lines 2018-12-11 16:09:39 +01:00
Niklas Fasching
53b61abfd0 Support html export blocks 2018-12-11 16:05:36 +01:00
Niklas Fasching
04db858934 Support keywords without a value like "#+RESULTS:" 2018-12-11 16:05:36 +01:00
Niklas Fasching
9826aa2143 Add make target to automatically regenerate html fixtures
After changing something the fixtures need to be updated to reflect the new
output. This just moves those steps from my bash history to make.
2018-12-11 15:42:41 +01:00
Niklas Fasching
8cefd9fabc Set up github pages 2018-12-11 15:42:41 +01:00
Niklas Fasching
fb6bc2d7de Split example.org into separate files
... hopefully correctly

This will hopefully improve ease of developing (more granular test results) and
prepares us for adding example org->html renders for gh-pages
2018-12-11 14:43:44 +01:00
Niklas Fasching
6adad92e8b Update main.go: Log to stdout & support both html and html-chroma
Could be moved into a flag but I'll significantly refactor the main.go later on
anyways - for now this works TM
2018-12-11 14:42:05 +01:00
Niklas Fasching
6637e63892 Fix multiline emphasis
I didn't have a test case for this and broke it when i introduced Line nodes to
support printing back to org mode. Oops
2018-12-10 17:53:12 +01:00
Niklas Fasching
6de03e0d13 Fix superscript 2018-12-03 19:54:40 +01:00
Niklas Fasching
213da0beff Fix list parsing & ensure line breaks inside lists are handled correctly
- Break list when kind of bullet changes
- Ensure we render multiline list items correctly
2018-12-03 19:30:21 +01:00
Niklas Fasching
043095e672 Add minimal affiliated keyword support. Just captions for now 2018-12-03 19:18:25 +01:00
Niklas Fasching
2399fec2eb Refactor RegularLink image & video handling 2018-12-03 16:59:39 +01:00
Niklas Fasching
f17923047b Refactor RegularLink: Do not fake description if none is given
To more faithfully handle inline images we need to know whether the original
link included a description - being more explicit about that will make it
easier.

see org.el/org-display-inline-images

> An inline image is a link which follows either of these
> conventions:
>
>   1. Its path is a file with an extension matching return value
>      from `image-file-name-regexp' and it has no contents.
>
>   2. Its description consists in a single link of the previous
>      type.
2018-12-03 16:59:01 +01:00
Niklas Fasching
4348505ada HTMLWriter: Improve footnote rendering
- add return link from footnote definitions -> footnote reference
- wrap footnote definition content in div for easier styling
- class rather than id bc idk consistency
2018-12-03 16:59:01 +01:00
Niklas Fasching
8f06883ec5 Allow blocks to contain paragraphs and other top level elements 2018-12-03 16:59:01 +01:00
Niklas Fasching
ed8764940f Fix paragraphs: Empty lines separate paragraphs
Somehow i thought it was 2 empty lines rather than 1 - makes more sense this
way... :D
2018-12-03 01:44:35 +01:00
Niklas Fasching
c759df1efe HTMLWriter: Fix example block newline 2018-12-03 01:24:17 +01:00
Niklas Fasching
09a8437b59 HTMLWriter: Change code block markup to resemble hugo chroma output
The highlight function from hugo already wraps the highlighted source code in
div > pre > code

e.g.

<div class="highlight">
<pre
style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">
<code class="language-sh" data-lang="sh">echo hello world</code>
</pre>
</div>

So now we always delegate all that to the highlight function
2018-12-03 00:50:44 +01:00
Niklas Fasching
d5665fb21c Fix footnotes starting with empty line 2018-12-03 00:35:12 +01:00
Niklas Fasching
3c2e9ed204 Add option to disable AutoLink parsing 2018-12-02 23:53:31 +01:00
Niklas Fasching
592be07cfd Refactor space handling of writers
I went through the issues of goorgeous and picked a few that seemed easy enough
to add (and added some fore as todos for later). That helped a lot and showed
some bugs / edge cases that required changes.

- the org writer wrote a lot of eol spaces and just removed it whenever
  String() was actually called. That worked until now but did not bode with
  rendering an empty headline - by removing ALL eol space we would render "* "
  back as just "*" -> not a headline anymore.
- the html writer had some special handling for line spacing inside paragraphs
  and list items - with the introduction of more blocks we need that handling
  everywhere.
  As browsers / html renderers are nice enough to collapse whitespace (and
  especially collapse "\s*\n" into " ") we can just write out the newlines and
  let the renderer take care of the rest.
2018-12-02 23:34:21 +01:00
Niklas Fasching
0df8bc541b Fix inline footnote definition parsing
footnote definition descriptions are always elements - not just raw inline
markup. we'll just wrap the description in a paragraph
2018-12-02 23:28:01 +01:00
Niklas Fasching
d5bf4317b2 Fix footnote ordering and some other bugs 2018-12-02 20:09:40 +01:00
Niklas Fasching
b1f9bfc9e9 Fix make test: also get test packages 2018-12-02 18:59:03 +01:00
Niklas Fasching
4e2fb02b57 html: Improve block rendering 2018-12-02 18:54:53 +01:00
Niklas Fasching
d2d9dc0fc8 Add auto links: Try to render unmarked urls as links 2018-12-02 18:37:55 +01:00
Niklas Fasching
a570fc736f Add lossless inline-definition-footnote rendering for the OrgWriter 2018-12-02 18:37:55 +01:00
Niklas Fasching
fc982125c9 Restructure directory layout: org subpackage 2018-12-02 18:37:55 +01:00
Niklas Fasching
6c683dfbdb Add basic html rendering 2018-12-02 16:49:44 +01:00
Niklas Fasching
00aa120bf4 Setup basic development environment: make, git hooks & CI 2018-12-02 16:49:44 +01:00
Niklas Fasching
0b2972e32a Add basic parser and org -> AST -> org rendering 2018-12-02 16:49:44 +01:00
Niklas Fasching
60835c66fc Init 2018-12-02 14:10:00 +01:00