Create an org heading builder
This commit is contained in:
39
src/org/org_document.nim
Normal file
39
src/org/org_document.nim
Normal file
@@ -0,0 +1,39 @@
|
||||
import std/sugar
|
||||
import std/collections/sequtils
|
||||
import std/strformat
|
||||
import std/strutils
|
||||
import results
|
||||
import fusion/matching
|
||||
import ./org_types
|
||||
import ./org_builder
|
||||
import ./org_text_link
|
||||
import ../utils/fp
|
||||
import ../parser/parser_internals
|
||||
import ../parser/parser_types
|
||||
import ../parser/builder_api
|
||||
|
||||
when isMainModule:
|
||||
let test = initOrgBuilder("""
|
||||
Some text to be ignored for now
|
||||
|
||||
* Stars 1
|
||||
|
||||
Ignore me
|
||||
|
||||
** Stars 1-1
|
||||
|
||||
*** Stars 1-1-1
|
||||
|
||||
** Stars 1-2
|
||||
|
||||
* Stars 2
|
||||
|
||||
""")
|
||||
.flatMap((builder: OrgBuilder) => tryParseBuild(
|
||||
builder = builder,
|
||||
builderFns = orgStyledTextBuilders,
|
||||
defaultBuilderFn = makeRawTokenOrEmpty,
|
||||
)
|
||||
|
||||
|
||||
echo test
|
||||
Reference in New Issue
Block a user