๐Ÿ“ฆ amake / org_parser

An Org Mode parser for Dart

โ˜… 50 stars โ‘‚ 7 forks ๐Ÿ‘ 50 watching โš–๏ธ MIT License
dartorg-modeparser
๐Ÿ“ฅ Clone https://github.com/amake/org_parser.git
HTTPS git clone https://github.com/amake/org_parser.git
SSH git clone git@github.com:amake/org_parser.git
CLI gh repo clone amake/org_parser
Aaron Madlon-Kay Aaron Madlon-Kay Update readme c4bfe09 1 months ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ example
๐Ÿ“ lib
๐Ÿ“ test
๐Ÿ“„ .gitignore
๐Ÿ“„ .metadata
๐Ÿ“„ CHANGELOG.md
๐Ÿ“„ LICENSE
๐Ÿ“„ Makefile
๐Ÿ“„ pubspec.lock
๐Ÿ“„ pubspec.yaml
๐Ÿ“„ README.md
๐Ÿ“„ README.md

org_parser

An Org Mode parser for Dart.

Usage

For displaying Org Mode documents in Flutter applications, see orgflutter. For an example application that displays Org Mode documents with orgparser and orgflutter, 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.

Features

  • Parser and rich, immutable AST for Org markup
  • Zipper)-based editing
facilities for Org AST
  • Extensive test suite, including checks for lossless round-tripping from markup
to AST and back DSL links workflow DSL

Supported syntax

  • Sections/headlines
* TODO [#A] foo bar
  • Blocks
#+BEGIN_SRC
    foo bar
    #+END_SRC
  • Inline src
foo src_sh{echo "bar"} baz
  • Affiliated keywords
#+name: foo
  • Fixed-width areas
: foo bar
    : baz buzz
  • Tables
| foo | bar |
    |-----+-----|
    | biz | baz |
  • Lists
- foo
      - [X] bar
        1. baz
        2. buzz
    - bazinga :: bazonga
  • Drawers
:PROPERTIES:
    foo bar
    :END:
  • Footnotes
Foo bar[fn:1] biz buzz

    [fn:1] Bazinga
  • Links, including with emphasis in description
[[http://example.com][example]]

    [[http://example.com][example *with* emphasis]]

    http://example.com
  • Emphasis markup, including nested emphasis
*bold* /italic/ _underline_ +strikethrough+ ~code~ =verbatim=
  • Timestamps
[2020-05-05 Tue]

    <2020-05-05 Tue 10:00>

    [2020-05-05 Tue]--[2020-05-05 Tue]
  • Macro references
{{{kbd(C-c C-c)}}}

  • LaTeX fragments
Then we add $a^2$ to \(b^2\)

\begin{equation}
    \nabla \times \mathbf{B} = \frac{1}{c}\left( 4\pi\mathbf{J} + \frac{\partial \mathbf{E}}{\partial t}\right)
    \end{equation}

  • Entities
a\leftrightarrow{}b conversion

  • Citations
[cite:@key]

  • Horizontal rules
-----
  • Radio targets
<<<foo>>>

  • Link targets
<<bar>>