feat: add markdown output plugin to copy markdown files alongside HTML#882
Conversation
|
I plan to pair this with a change to send some clients these markdown files: https://github.com/electron/infra/pull/161 |
|
@erickzhao could you also merge this for me? 🙏 |
dsanders11
left a comment
There was a problem hiding this comment.
Seems reasonable, and when running yarn build I can see the expected output, but I was not able to view the index.md files with the dev server spun up by yarn start. I'm guessing that's just something that's not wired up in their dev server (since it doesn't exist), so happy to merge this and follow up if needed.
dsanders11
left a comment
There was a problem hiding this comment.
Looks like this may not be being served as UTF-8? This page for example (https://www.electronjs.org/docs/latest/why-electron/index.md) is rendering some characters incorrectly.
| const routePrefix = `/${prefix}`; | ||
|
|
||
| if (!routePath.startsWith(routePrefix)) continue; |
There was a problem hiding this comment.
This probably doesn't play nice with i18n as those are prefixed by the language code. I think ideally we'd also serve the translated Markdown, so this should be updated to take that into account.
|
🤔 Weird, but makes sense that there's encoding issues, browsers be like that. In the infra PR I've specified the encoding in the |
|
Maybe there's a way to set the content encoding when we sync with azcopy 🤔 |
Description of Change
Adds a custom Docusaurus plugin to emit Markdown files alongside the generated HTML files.
When Docusaurus compiles a markdown route, it creates an
index.htmlfile within that route. This plugin copies the source file to aindex.mdfile alongside it.Example
Source tree
Output tree
Checklist