Commit graph

262 commits

Author SHA1 Message Date
Niklas Fasching
652290b857 Update README 2018-12-17 15:06:26 +01:00
Niklas Fasching
5afba92f5f Add (a bad) comparison to goorgeous to github pages
The stylesheet would have to be adapted to get a fair visual comparison - but
this should be enough for comparing behavior
2018-12-17 15:06:26 +01:00
Niklas Fasching
0eb3baf1bb Improve handling of elements containing raw text
While adding another test case from the goorgeous issues it became clear that
inline markup and html entity replacement were erronously applied to raw text
elements like inline code =foo=, src/example/export blocks, example lines,
etc.

To correctly handle those cases in both org and html exports a new
parseRawInline method had to be added.

Also some misc html export whitespace fixes and stuff
2018-12-17 13:40:15 +01:00
Niklas Fasching
ac2597af4c Refactor Footnotes: Exclude footnotes heading during export, not parsing
Until now the footnotes section was parsed but not included in the resulting
AST - his required rebuilding it in the OrgWriter. It feels cleaner to include
it in the AST and only exclude it in the export
2018-12-17 13:40:15 +01:00
Niklas Fasching
ced166dc18 Fix inline parseLineBreak: Handle end of input 2018-12-17 01:38:46 +01:00
Niklas Fasching
ba3cf9f948 Add support for descriptive lists 2018-12-17 01:38:46 +01:00
Niklas Fasching
376bb3652a Update README 2018-12-17 00:02:27 +01:00
Niklas Fasching
0186545123 Add basic support for drawers 2018-12-17 00:01:03 +01:00
Niklas Fasching
c012b0a533 Add support for ": example" elements 2018-12-16 23:23:47 +01:00
Niklas Fasching
24ace5aa0e html: Export headline todo status & tags 2018-12-16 22:45:18 +01:00
Niklas Fasching
6887fb2e02 Add wasm demo to github pages 2018-12-16 19:54:17 +01:00
Niklas Fasching
8a9bc2bead Update README: more todos 2018-12-15 14:50:16 +01:00
Niklas Fasching
ca5dbb0e48 Update README 2018-12-14 17:09:00 +01:00
Niklas Fasching
2947d7632d Support basic #+INCLUDE (src/example/export block only)
including org files is more complex - e.g. footnotes need to be namespaced to
their source file. org does this by prefixing each included files footnotes
with a number - but even that is not enough as it doesn't guarantee
uniqueness.

As I don't have a usecase for it, I'll avoid the additional complexity for
now.
2018-12-14 17:09:00 +01:00
Niklas Fasching
04df30a7b5 Convert panics to errors for public interface 2018-12-14 16:37:32 +01:00
Niklas Fasching
f28f400d7e Add table pretty printing & alignment
Also dismissed implementing colgroups for now - had it but didn't like the
added complexity for a very questionable benefit - i've actually never used
that feature of org tables...
2018-12-14 15:49:40 +01:00
Niklas Fasching
c08119bbc8 Improve table parsing: support separator before header 2018-12-13 17:48:38 +01:00
Niklas Fasching
cb81eb94de Update README 2018-12-13 17:47:25 +01:00
Niklas Fasching
a0e87057d6 Fix BufferSettings append & add ParseFrontMatter
until now buffersettings were always appended using \n which means the first
value would already be written as "\nVALUE". Not anymore.

Also we finally add an option to parse just the front matter. Still not
efficient as we tokenize the whole org file but i don't think saving a few
milliseconds would be worth making the code uglier.
2018-12-13 17:44:26 +01:00
Niklas Fasching
0255a129e2 Improve html entities replacement
No need to replace html entities in the result - we can just do it when we
write a text node - the only thing that actually contains text and thus
entities!
2018-12-13 17:43:31 +01:00
Niklas Fasching
a55ed30e3d Add support for org-entities (e.g. ndash, mdash, \Aacute) 2018-12-11 22:12:51 +01:00
Niklas Fasching
7c082fc627 Change img url http -> https where possible for cleaner gh-pages console 2018-12-11 22:12:51 +01:00
Niklas Fasching
8a30adf1f2 Add naive html escaping to generate-gh-pages
without this the raw html from the org source (e.g. from a #+HTML: ... keyword)
is not visible as text but rendered as html
2018-12-11 22:12:51 +01:00
Niklas Fasching
ffe06b50f2 Add support for #+HTML 2018-12-11 22:12:51 +01:00
Niklas Fasching
0a905ca172 Fix HTML_ATTR rendering (naive)
- was missing spaces between attributes when rendering to org
- was duplicating attributes when rendering to html - now we join / replace
  attributes depending on the name - for now only class & style are appended
2018-12-11 20:38:24 +01:00
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