Commit graph

43 commits

Author SHA1 Message Date
Niklas Fasching
c82b26b540 cli: Support reading input from stdin 2021-12-26 23:17:19 +01:00
Niklas Fasching
1b68e209ac Migrate from travisci to github actions
because all my other repos use it and hackernews told me travisci free tier is
dead.
2021-01-02 20:42:59 +01:00
Niklas Fasching
d2bbcc8881 Update blorg and add it to gh-pages. Update README 2020-06-26 21:00:25 +02:00
Niklas Fasching
30dd2794cf Introduce blorg: MVP static site generator
hugo is nice - but it's huge. I've never built a static site generator before
and thought the world could use one more - it's not like there's already enough
choice out there!

No, but seriously. I love hugo and it has all the bells and whistles and you
should definitely use that and not this. I just like reinventing the wheel to
learn about stuff - and I like the 80/20 rule. This gives like 60% of what I
want already and is tiny fraction of hugo in terms of LOC (hugo without it's
bazillion dependencies is like 80k+ - this is like 500 and very likely won't
ever grow above let's say 5k).

Also org mode is awesome and why not use it as a configuration format as
well. Let's see where this goes. YOLO.
2020-06-26 18:52:43 +02:00
Niklas Fasching
76b157b8ce Add support for latex fragments 2019-09-28 15:04:04 +02:00
Niklas Fasching
de302bbc0a Add make preview & update README with basic development instructions
not sure how helpful this really this but something is better than nothing i
guess
2019-09-22 02:02:32 +02:00
Niklas Fasching
09c85c3e66 Update README
I never wanted to reproduce the emacs org-export-as-html output exactly but
rather just provide a sensible exporter - the README should tell users what to
expect here.
2019-07-07 17:38:47 +02:00
Niklas Fasching
6dd8e90bb8 Cleanup: UPDATE README & Makefile
render hasn't been used for a long time now - time to get rid of it.
2019-01-07 20:31:12 +01:00
Niklas Fasching
148eef5aeb Refactor: Move some code
Example nodes are a kind of block and it's not much code so we can just put it
next to the Block code. Feels cleaner but doesn't change much.
2019-01-06 20:49:49 +01:00
Niklas Fasching
edd22b5014 Update README 2019-01-05 13:05:27 +01:00
Niklas Fasching
141d6a27a9 Update README 2018-12-26 17:31:59 +01:00
Niklas Fasching
d921a68a55 Add support for Table of Contents 2018-12-26 16:10:23 +01:00
Niklas Fasching
c3d635eacb Add more test cases 2018-12-21 16:05:38 +01:00
Niklas Fasching
e8b90ab9d4 Update README 2018-12-20 16:49:26 +01:00
Niklas Fasching
724cf6c23e Support list items with empty first line
also dismiss implementing ordered list bullet overrides for now, e.g.
1. [@10] foo

add it once someone needs it - for now it seems like needless complexity
2018-12-19 17:40:47 +01:00
Niklas Fasching
ff9c077f65 Update README 2018-12-19 14:35:55 +01:00
Niklas Fasching
42dc70e7ad Support blocks with unindented content
list items only contain content that is indented to their respective
level. Except when that content is inside a block. To allow for this we have to
ignore the parentStop when parsing a block and just include everything until
the end of that block.
Can't think of any problems with this right now. Let's see if this comes
back to bite me.
2018-12-19 00:28:53 +01:00
Niklas Fasching
56d47aeb8f Update README 2018-12-18 15:04:54 +01:00
Niklas Fasching
7331d24452 Add support for list item checkboxes (e.g. [X])
see https://orgmode.org/manual/Checkboxes.html
We're deviating from Org mode regarding the assigned css classes but the chosen
classes feel better than (on, off, trans) and it's not like the export matches
1:1 otherwise.
2018-12-18 14:15:35 +01:00
Niklas Fasching
dce67eaddf Improve ATTR_HTML keyword parsing
Org mode separates kvs not as initially assumed by whitespace (~ csv) but
rather at keywords (~ :\w+).

This is still not replicating Org mode behaviour though as I decided against
attributes ignoring multi-definitions. Instead we stack their
values (and those existing on the element) for certain attributes (class, style
for now).

e.g.
[[foo]]

would become <foo class="a"> in Org mode but becomes <foo class="a b"> with
go-org.
2018-12-18 00:16:41 +01:00
Niklas Fasching
0e64f9df7f html: Render headline priority 2018-12-17 22:39:29 +01:00
Niklas Fasching
a861437185 Fix naming: org-mode -> Org mode
https://scripter.co/how-do-i-write-org-mode/

Prefer “Org mode” to “Org-mode” or “org-mode”. This is simply because it reflects an existing convention in The Emacs Manual which consistently documents mode names in this form - “Text mode”, “Outline mode”, “Mail mode”, etc.
2018-12-17 22:34:15 +01:00
Niklas Fasching
31a98da991 Update README with suggestions from @kaushalmodi
also see #1 - link official Org mode mirror
2018-12-17 22:33:33 +01:00
Niklas Fasching
c6854a40e1 Improve descriptive list org rendering
- indent to correct lvl
  - term ::
            |<- indent up to here
    |<- not here
2018-12-17 16:02:56 +01:00
Niklas Fasching
652290b857 Update README 2018-12-17 15:06:26 +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
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
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
cb81eb94de Update README 2018-12-13 17:47:25 +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
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
07d90c960c Add travis-ci badge to README 2018-12-11 18:03:19 +01:00
Niklas Fasching
043095e672 Add minimal affiliated keyword support. Just captions for now 2018-12-03 19:18:25 +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
4e2fb02b57 html: Improve block rendering 2018-12-02 18:54:53 +01:00
Niklas Fasching
6c683dfbdb Add basic html rendering 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