How to parse additional markdown files?
See original GitHub issueSearch terms
- additional markdown
- parsing
- lexing
- tokenization
- reflection
- plugin
Question
I have written a plugin that reads all the non-root/non-readme markdown files and creates HTML files out of those. Additionally it also supports some custom inline-tags. This process looks roughly as follows:
// The plugin code is abbreviated for the purpose of discussing the root issue.
function load(app) {
app.renderer.on({
[Renderer.EVENT_END_PAGE]: renderMarkdownPage.bind(app),
});
}
function renderMarkdownPage(pageEvent) {
if (!(model instanceof MarkdownReflection)) return; // <- MarkdownReflection: my custom reflection class
pageEvent.contents = /** @type {DefaultTheme} */ (this.renderer.theme)
.getRenderContext(pageEvent)
.markdown(model.content) // <-- Markdown content
}
This works as expected except one problem. If the additional markdown files contain inline tags like {@link}
those remain untouched and are not converted. So I thought to perform the same stuffs that is done for the project readme. However, I see that the relevant components are not exported from the package and additional exports are blocked via the exports
in the package.json.
Is there any work around for this? Or am I looking at the wrong places, and there is a easier way to achieve this?
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top Results From Across the Web
Markdown and including multiple files - Stack Overflow
Specifically, I want to create a separate markdown file with links that I call often but not always (call this B.md), then when...
Read more >Parsing Markdown into an Automated Table of Contents
This tutorial will show you how to parse long Markdown text to HTML and then generate a list of links from the headings....
Read more >rpearce/parse-md: Parse Markdown file's metadata ... - GitHub
This library exists as a way to pass a markdown file's content and have its metadata and markdown returned as an object containing...
Read more >How-To Guides - MyST Markdown
This page describes several common uses of MyST parser and how to accomplish them. Include rST files into a Markdown file¶. As explained...
Read more >Writing a Simple Markdown Parser Using JavaScript
Many developers opt to use Markdown, a markup language which is popular for writing blogs, readme files, and many other forms of ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Gerrit0 Thanks for the changes. It seems to work pretty well.
That sounds good as well.