Skip to content

Commit 8d62393

Browse files
authored
Add the ability to export norg files to HTML (#1688)
* Initialzie an HTML parser Inital commit included begining support for: - headings - lists - TODOs - paragraphs - links - italics - bold - subscript - superscript - comments - verbatim - blockquotes * Introduce macro handler concept Then uses macro handler to support: - code - comment * Render escaped characters * Parse single line and multi line footnote * Parse inline math * Parse links TODO: Implement support for cross-norg-file linking, right now the workspace path has a temprorary placeholder * Parse anchor tags * Fix cross file linking Cross file linking assumes that the path is `/:workspace/path/to/file` * Add code comments * Refactor code for improved readability * Remove unnecessary param comments * Fix bug to prevent overusage of paragraph tags * Implement new method for adding paragraph tags The tricky part is that paragraph nodes are also used for link content and list content. This can lead to over usage of paragraph tags for HTML. * Fix issue with link description persisting across nodes * Run stylua formatting * Revert unitended file changes * Update core.export.html doc comments * Escape HTML * Update logic for adding li tags This is done so that it can correctly render mulit-line list items. The only real change to logic is that nested lists will be inlcuded inside of a given list item (this may or may not be the correct way to handle nested lists). My limited testing has resulted in HTML that rendered correctly. * Ran stylua * Add support to link to heading with both generic links and heading links * Add spoiler class for spoilers * Impelemnt consitent indenting in code blocks * Add support for link targets * Modify inline math class * Fix stateful bug with code blocks Adds an option to pass in a function into keep_descending. The function makes it easy to rebuild object so that it doesn't unintentionally persist. * Fix escaping bugs and convert inline math to a code tag Code tag allows it to be rendered in a paragraph. * Use code tag for verbatim * Render footnotes at the bottom of the page * Use hop to generate links * Use hop except for cross-buffer links * Clean up hop commit now that issue #1717 should be resolved * Removing unintentional change due to a bad merge * Merge private and public link builder tables * Ran formatter * Add line that I accidentally deleted
1 parent 91db472 commit 8d62393

File tree

2 files changed

+710
-1
lines changed

2 files changed

+710
-1
lines changed

0 commit comments

Comments
 (0)