-
Notifications
You must be signed in to change notification settings - Fork 184
feat: add markdown output plugin to copy markdown files alongside HTML #882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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? 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.html
file within that route. This plugin copies the source file to aindex.md
file alongside it.Example
Source tree
Output tree
Checklist