Skip to content

feat(agents): generate homepage markdown for AI agent consumption - #13

Open
fredericsimard wants to merge 2 commits into
mainfrom
chore/md-generator-for-landing-page/2026-07-24
Open

feat(agents): generate homepage markdown for AI agent consumption#13
fredericsimard wants to merge 2 commits into
mainfrom
chore/md-generator-for-landing-page/2026-07-24

Conversation

@fredericsimard

Copy link
Copy Markdown
Contributor

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

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.md back 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.json for 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_TOKEN won’t have contents: 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 to generated/ (see config/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 thread .github/workflows/generate-homepage-markdown.yml
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants