org_parser 9.6.0
org_parser: ^9.6.0 copied to clipboard
A pure-Dart parser for Emacs Org Mode (https://orgmode.org) markup
org_parser #
An Org Mode parser for Dart.
Usage #
For displaying Org Mode documents in Flutter applications, see org_flutter. For an example application that displays Org Mode documents with org_parser and org_flutter, see Orgro.
This package allows you to parse raw Org Mode documents into a structured in-memory representation.
import 'package:org_parser/org_parser.dart';
final doc = OrgDocument.parse('''* TODO [#A] foo bar
baz buzz''');
print(doc.children[0].headline.keyword); // TODO
See the example for more.
Caveats #
This parser was developed for an application that is halfway between pretty-printing and evaluating/interpreting, so in many cases the parsed structure does not split out constituent parts as thoroughly as needed for some applications.
Supported syntax #
-
Sections/headlines
* TODO [#A] foo bar
copied to clipboard -
Blocks
#+BEGIN_SRC foo bar #+END_SRC
copied to clipboard -
Inline src
foo src_sh{echo "bar"} baz
copied to clipboard -
Affiliated keywords
#+name: foo
copied to clipboard -
Fixed-width areas
: foo bar : baz buzz
copied to clipboard -
Tables
| foo | bar | |-----+-----| | biz | baz |
copied to clipboard -
Lists
- foo - [X] bar 1. baz 2. buzz
copied to clipboard -
Drawers
:PROPERTIES: foo bar :END:
copied to clipboard -
Footnotes
Foo bar[fn:1] biz buzz [fn:1] Bazinga
copied to clipboard -
Links
[[http://example.com][example]] http://example.com
copied to clipboard -
Emphasis markup
*bold* /italic/ _underline_ +strikethrough+ ~code~ =verbatim=
copied to clipboard -
Timestamps
[2020-05-05 Tue] <2020-05-05 Tue 10:00>
copied to clipboard -
Macro references
{{{kbd(C-c C-c)}}}
copied to clipboard -
LaTeX fragments
Then we add $a^2$ to \(b^2\)
copied to clipboard\begin{equation} \nabla \times \mathbf{B} = \frac{1}{c}\left( 4\pi\mathbf{J} + \frac{\partial \mathbf{E}}{\partial t}\right) \end{equation}
copied to clipboard -
Entities
a\leftrightarrow{}b conversion
copied to clipboard -
Citations
[cite:@key]
copied to clipboard -
Horizontal rules
-----
copied to clipboard -
Radio targets
<<<foo>>>
copied to clipboard -
Link targets
<<bar>>
copied to clipboard