markdown

Formatted text written in Markdown, which can be shown as a web page or exported as a PDF.

At a glance

Writing

Write the Markdown source; it is kept exactly as written. It is rendered as GitHub-flavoured Markdown: tables, strikethrough, footnotes and links to headings. Raw HTML in the source is cleaned when it is rendered: only what Markdown itself produces survives, with a few harmless inline tags.

Markdown can also be made from a document by reading its text. create it with dtype markdown and:

A URL given as source is kept as text, not fetched. To convert the document a URL points at, pass it as file.

Written as

A JSON string whose schema format is markdown.

Reading

Read it as you read a string: get_content with a line range, or a query in any search mode. A long Markdown document shown by its handle starts with its outline, each heading with the line range that reads its section, so you can ask for the section you need.

To get it as a PDF, render it: create a pdf with opts {"kind": "render"} and the Markdown text as source.

Querying

As for a string: a field of this type has a full-text index and is split into passages for search by meaning, so every search operator works on it. A scheduled job keeps what it hands its next run as Markdown:

ScheduledJob | state ~~ "invoices already sent" | select id, description, match.text

Every operator is in the HQL reference.

Editing

edit replaces text with old and new, as for a string: old must occur exactly once unless you set replace_all. The result is a new Markdown value under a new handle.

Operations

Through the dtypes resource: