Skip to content

feat: add get-doc tool#10

Merged
LeoMcA merged 26 commits intomainfrom
get-doc-tool
Nov 12, 2025
Merged

feat: add get-doc tool#10
LeoMcA merged 26 commits intomainfrom
get-doc-tool

Conversation

@LeoMcA
Copy link
Member

@LeoMcA LeoMcA commented Nov 11, 2025

Quite a lot here, but as before: commits are atomic, so should be easiest to review by stepping through the commits. Generally I'll have added a test in one commit and made it pass in the commit after.

Adds a tool to fetch documentation from MDN and render it to markdown. It uses Fred to first render the context to HTML, which requires a little bit of strange patching of things Fred expects, and then converts that to markdown. The advantage of this is it means we don't have to re-implement the render logic for some sections (like Specifications) now or in the future. I'm going to look at exposing a nicer interface for markdown rendering from Fred.

@LeoMcA LeoMcA requested a review from a team as a code owner November 11, 2025 09:38
@LeoMcA LeoMcA requested a review from caugner November 11, 2025 09:38
Comment on lines +16 to +17
"turndown": "^7.2.2",
"turndown-plugin-gfm": "^1.0.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What made you choose turndown?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly didn't put enormous thought into it: picked it when writing my prototype code, and didn't re-evaluate it when writing the proper code here as it worked fine. It's a mature lib, used widely, and has first party support for GFM.

Happy to consider alternatives though: but I'll merge for now because it'll be easy to swap out for a different library later.

@LeoMcA LeoMcA enabled auto-merge (squash) November 12, 2025 19:22
@LeoMcA LeoMcA merged commit 2e8fd92 into main Nov 12, 2025
3 checks passed
@LeoMcA LeoMcA deleted the get-doc-tool branch November 12, 2025 19:23
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.

2 participants