cleanup, docs
This commit is contained in:
@@ -8,6 +8,7 @@ options : optional markdown options tree
|
||||
return value : a `DValue` document AST
|
||||
|
||||
:see
|
||||
>markup
|
||||
markdown_to_html
|
||||
component
|
||||
component_render
|
||||
@@ -36,10 +37,6 @@ The returned AST uses `type` plus node-specific fields such as `level`, `text`,
|
||||
|
||||
Top-level documents use:
|
||||
|
||||
```text
|
||||
type = "document"
|
||||
children = [...]
|
||||
```
|
||||
|
||||
Common block nodes:
|
||||
|
||||
@@ -66,11 +63,6 @@ Common inline nodes:
|
||||
|
||||
Example:
|
||||
|
||||
```uce
|
||||
DValue options = json_decode("{\"components\":{\":::warning\":\"components/markdown/warning\"}}");
|
||||
DValue ast = markdown_to_ast(file_get_contents("README.md"), options);
|
||||
print(json_encode(ast));
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
@@ -78,7 +70,7 @@ Options:
|
||||
- `options["allow_html"]` allows raw HTML passthrough nodes to be captured and rendered. Defaults to `false`.
|
||||
- `options["components"]` provides the component hook map later used by `markdown_to_html()`. The parser preserves directive data needed by those hooks.
|
||||
|
||||
Related:
|
||||
|
||||
- PHP: CommonMark or Parsedown parsing pipelines that expose a syntax tree or token stream
|
||||
- JavaScript / Node.js: `remark`, `micromark`, or `markdown-it` token streams and AST-like structures
|
||||
:example
|
||||
DValue ast = markdown_to_ast("# Title");
|
||||
print(ast.is_array() ? "ast\n" : "empty\n");
|
||||
|
||||
Reference in New Issue
Block a user