Deals with transforming a collection of markdown-it tokens obtained from parsing markdown text into an AST composed of nested clojure structures.
See parse function.
A "Node" has the following keys:
Deals with transforming a collection of markdown-it tokens obtained from parsing markdown text into an AST composed
of nested clojure structures.
See `parse` function.
A "Node" has the following keys:
- type: a Node's type as keyword (:heading, :paragraph, :text, :code etc.)
- info: (optional) fenced code info
- content: (optional) a collection of Nodes representing nested content
- text: (optional) content of text nodes, a collection of Nodes
- level: (optional) heading level
- attrs: attributes as passed by markdownit tokens (e.g {:attrs {:style "some style info"}})
(add-to-toc {:as doc :keys [toc] path :nextjournal.markdown.parser/path})(apply-tokens doc tokens)(block-formula text)(close-node doc)(empty-text-node? {text :text t :type})(formula text)(hlevel {:as _token hn :tag})(inc-last path)(into-toc toc {:as toc-item :keys [level]})(node type content attrs top-level)(open-node doc type)(open-node doc type attrs)(open-node doc type attrs top-level)(pairs->kmap pairs)(parse tokens)(parse doc tokens)Takes a doc and a collection of markdown-it tokens, applies tokens to doc. Uses an emtpy doc in arity 1.
Takes a doc and a collection of markdown-it tokens, applies tokens to doc. Uses an emtpy doc in arity 1.
(parse-fence-info info-str)Ingests nextjournal, GFM, Pandoc and RMarkdown fenced code block info, returns a map
Nextjournal
...
Pandoc
...
Rmd
...
See also:
Ingests nextjournal, GFM, Pandoc and RMarkdown fenced code block info, returns a map
Nextjournal
```python id=2e3541da-0735-4b7f-a12f-4fb1bfcb6138
...
```
Pandoc
```{#pandoc-id .languge .extra-class key=Val}
...
```
Rmd
```{r cars, echo=FALSE}
...
```
See also:
- https://github.github.com/gfm/#info-string
- https://pandoc.org/MANUAL.html#fenced-code-blocks
- https://rstudio.com/wp-content/uploads/2016/03/rmarkdown-cheatsheet-2.0.pdf(push-node {:as doc :nextjournal.markdown.parser/keys [path]} node)(re-idx-seq re text)Takes a regex and a string, returns a seq of pairs of indices delimiting each match.
Takes a regex and a string, returns a seq of pairs of indices delimiting each match.
(section-at {:as doc :keys [content]} [_ pos :as path])(sidenote-ref ref)(split-by-tags text)(tag-node text)(text-node text)(update-current {:as doc path :nextjournal.markdown.parser/path} fn & args)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |