md.q
Read Markdown as q data: .md.parse answers one row per block, .md.html renders XHTML. The dialect is CommonMark with tables, strikethrough and task lists.
Examples
t:.md.parse hsym `$"user-docs/c-extensions.md"
first exec val from t where kind=`table
.md.html "Hello *world*"Entity Summary
| Entities | Short Description |
|---|---|
| .md.html[source] | Markdown as XHTML |
| .md.parse[source] | Markdown as a block table |
Entity Details
.md.html[source]
The document rendered as XHTML: the contents of
, following the CommonMark reference rendering.| Return: | (string) the XHTML |
|---|---|
| Parameters: |
|
| throws: | type a source that is none of those |
Examples
.md.html "# Title\n\nSome *text*.\n\n---\n".md.parse[source]
The document's blocks as a flat table, one row per block in document order, so a document filters, splits by section and yields its code blocks and tables with ordinary q-sql. Inline markup is dropped from text: emphasis, links and code spans keep their text, a soft line break is a space and a hard one "\n".
| Columns: |
|
|---|---|
| Return: | (table) one row per block in document order |
| Parameters: |
|
| throws: | type a source that is none of those |
Examples
.md.parse "# Title\n\nSome *text*.\n\n- one\n- two\n"t:.md.parse "# A\n\nx\n\n# B\n\ny\n"; select kind, val from t where head=3exec val from .md.parse "```q\n1+1\n```\n\n```sh\nls\n```\n" where kind=`code, info like "q*"first exec val from .md.parse["|a|b|\n|-|-|\n|1|x|"] where kind=`table