Commit graph

270 commits

Author SHA1 Message Date
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