Skip to content

Conversation

clavin
Copy link
Member

@clavin clavin commented Oct 7, 2025

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 a index.md file alongside it.

Example

Source tree
─ docs/
  ├─ flowers.md
  └─  ...
Output tree
─ docs/
  ├─ flowers/
  │  ├─ index.html
  │  └─ index.md     # New!
  └─ ...

Checklist

  • This PR was not created with AI. (PRs created mainly with AI will be closed. They waste our team's time. We ban repeat offenders.)

@clavin clavin requested a review from a team as a code owner October 7, 2025 06:28
@clavin
Copy link
Member Author

clavin commented Oct 8, 2025

I plan to pair this with a change to send some clients these markdown files: https://github.com/electron/infra/pull/161

@clavin
Copy link
Member Author

clavin commented Oct 9, 2025

@erickzhao could you also merge this for me? 🙏

Copy link
Member

@dsanders11 dsanders11 left a 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.

@dsanders11 dsanders11 merged commit 2e8b482 into electron:main Oct 9, 2025
4 checks passed
Copy link
Member

@dsanders11 dsanders11 left a 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.

Comment on lines +22 to +24
const routePrefix = `/${prefix}`;

if (!routePath.startsWith(routePrefix)) continue;
Copy link
Member

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.

@clavin
Copy link
Member Author

clavin commented Oct 9, 2025

🤔 Weird, but makes sense that there's encoding issues, browsers be like that. In the infra PR I've specified the encoding in the Content-Type header--will try it out locally to make sure that fixes it. (Though direct links like yours will still have that issue.) Hopefully, non-browser clients to be more likely to default to UTF-8 or detect it.

@clavin
Copy link
Member Author

clavin commented Oct 10, 2025

Maybe there's a way to set the content encoding when we sync with azcopy 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants