feat(agents): generate homepage markdown for AI agent consumption - #13
Open
fredericsimard wants to merge 2 commits into
Open
feat(agents): generate homepage markdown for AI agent consumption#13fredericsimard wants to merge 2 commits into
fredericsimard wants to merge 2 commits into
Conversation
The homepage (`overrides/home.html` + `overrides/locales/*.html`) is templated HTML with no hand-authored markdown source, unlike every other page on the site. This adds a workflow that builds the site and converts the rendered homepage HTML to markdown per locale. - add `.github/workflows/generate-homepage-markdown.yml`: runs on PRs touching the homepage template or locale files, builds the site, and commits the generated markdown back to the PR branch - add `scripts/html-to-markdown.js`: converts `site/<locale>/index.html` to `docs/<locale>/index.generated.md` using turndown - add `scripts/package.json`: turndown and `jsdom` dependencies
There was a problem hiding this comment.
Pull request overview
Adds an automated workflow + Node script to render the MkDocs homepage HTML and convert it into per-locale generated markdown files intended for AI agent consumption, bringing the homepage in line with the rest of the docs’ markdown-based content.
Changes:
- Add a GitHub Actions workflow to build the site on relevant PRs and commit generated
docs/<locale>/index.generated.mdback to the PR branch. - Add a Node-based HTML→Markdown converter (Turndown + JSDOM) to extract main content and strip site chrome.
- Add a dedicated
scripts/package.jsonfor the converter’s dependencies.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/generate-homepage-markdown.yml |
Builds MkDocs on PRs that touch homepage templates and commits generated markdown back to the PR branch. |
scripts/html-to-markdown.js |
Converts built homepage HTML into docs/<locale>/index.generated.md, removing navigation/footer chrome. |
scripts/package.json |
Defines the Node dependencies (jsdom, turndown) for the conversion script. |
Comments suppressed due to low confidence (2)
.github/workflows/generate-homepage-markdown.yml:55
- This workflow attempts to push commits back to the PR branch, which will fail for PRs from forks because
GITHUB_TOKENwon’t havecontents: write. Guard the commit step so the workflow doesn’t fail on forked PRs.
- name: Commit generated markdown
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: regenerate homepage markdown for agents"
file_pattern: "docs/*/index.generated.md"
scripts/html-to-markdown.js:18
- The script currently looks for build output under
site/, but MkDocs is configured to emit HTML togenerated/(seeconfig/en/mkdocs.yml:6). As-is, this will throw before conversion runs.
const SITE_DIR = path.join(process.cwd(), "site");
const DOCS_DIR = path.join(process.cwd(), "docs");
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+6
to
+7
| // Reads: site/index.html, site/<locale>/index.html (mkdocs build output) | ||
| // Writes: docs/<locale>/index.generated.md |
| const frontmatter = [ | ||
| "---", | ||
| "template: home.html", | ||
| `title: ${title}`, |
Add llms.txt with a concise overview of GOFS (General On-Demand Feed Specification), links to the spec and homepage, related standards (GTFS, GTFS-Flex, GBFS), guidance on when to use GOFS, and a community Slack channel link.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The homepage (
overrides/home.html+overrides/locales/*.html) is templated HTML with no hand-authored markdown source, unlike every other page on the site. This adds a workflow that builds the site and converts the rendered homepage HTML to markdown per locale..github/workflows/generate-homepage-markdown.yml: runs on PRs touching the homepage template or locale files, builds the site, and commits the generated markdown back to the PR branchscripts/html-to-markdown.js: convertssite/<locale>/index.htmltodocs/<locale>/index.generated.mdusing turndownscripts/package.json: turndown andjsdomdependencies