A Python plugin for ARO that provides Markdown processing functionality.
aro add git@github.com:arolang/plugin-python-markdown.git- Python 3.9 or later
- No external dependencies (uses only Python standard library)
Converts Markdown text to HTML.
Input:
data(string): Markdown text to convert
Output:
html: The generated HTMLinput_length: Length of input Markdownoutput_length: Length of output HTML
Extracts all links from Markdown text.
Input:
data(string): Markdown text to analyze
Output:
links: Array of objects withtextandurlfieldscount: Number of links found
Extracts all headings from Markdown text.
Input:
data(string): Markdown text to analyze
Output:
headings: Array of objects withlevelandtextfieldscount: Number of headings found
Counts words, characters, and lines in Markdown text.
Input:
data(string): Markdown text to analyze
Output:
words: Word countcharacters: Character count (including spaces)characters_no_spaces: Character count (excluding spaces)lines: Line count
(* Convert Markdown to HTML *)
(Convert Markdown: Document Processing) {
<Extract> the <markdown> from the <request: body>.
<ToHtml> the <html> with <markdown>.
<Return> an <OK: status> with <html>.
}
(* Analyze document structure *)
(Analyze Document: Document Processing) {
<Extract> the <content> from the <document: content>.
<ExtractHeadings> the <headings> with <content>.
<ExtractLinks> the <links> with <content>.
<WordCount> the <stats> with <content>.
<Create> the <analysis> with {
"headings": <headings>,
"links": <links>,
"stats": <stats>
}.
<Return> an <OK: status> with <analysis>.
}
python3 src/plugin.pyMIT