Skip to content

Conversation

@emma-squared
Copy link
Contributor

Summary

This PR introduces a new feature that allows AI agents and CLI tools to access goose documentation pages as markdown by appending .md to the URL of any documentation page.

Key Features

Markdown Export Functionality

  1. Markdown Export Plugin:

    • Created a custom Docusaurus plugin (markdown-export.cjs) to process source documentation files.
    • Strips YAML frontmatter, removes import statements, and cleans .mdx content to generate .md files.
    • Outputs clean .md files alongside HTML during build.
  2. File URL Structure:

    • Standard documentation URLs (HTML): https://block.github.io/goose/docs/quickstart
    • Corresponding markdown export: https://block.github.io/goose/docs/quickstart.md
  3. Example Usage:

    • curl https://block.github.io/goose/docs/quickstart.md
    • curl -s https://block.github.io/goose/docs/quickstart.md | glow -p

Local Development & Testing Enhancements

  1. Static File Server:

    • Added serve-static.js, a simple HTTP server to test local builds.
    • Properly handles the /goose/ base URL to align with production deployment.
    • Redirects the root path / to /goose/ to avoid confusion.
  2. New npm Script for Testing:

    • Added "serve-static": "node scripts/serve-static.js" to package.json for a smoother developer experience.
    • Test markdown routes locally:
      • http://localhost:3001/goose/docs/quickstart.md
  3. Config Updates:

    • Registered the markdown export plugin in docusaurus.config.ts.
    • Updated the deprecated onBrokenMarkdownLinks to the proper markdown.hooks namespace.

Changes Made

New Files

  • plugins/markdown-export.cjs:
    • Custom plugin to cleanly export .md files during the Docusaurus build process.
  • scripts/serve-static.js:
    • Local testing server for static file serving with proper /goose/ path handling.

Modified Files

  • docusaurus.config.ts:
    • Added the markdown export plugin configuration.
    • Fixed the onBrokenMarkdownLinks configuration.
  • package.json:
    • Added serve-static npm script.

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Testing Locally with the Static File Server:

npm run serve-static

Access URLs:
Homepage: http://localhost:3001/goose/
Regular page: http://localhost:3001/goose/docs/getting-started/installation/
Markdown page: http://localhost:3001/goose/docs/guides/recipes/recipe-reference.md

@emma-squared emma-squared requested a review from a team as a code owner November 20, 2025 21:31
@github-actions
Copy link
Contributor

github-actions bot commented Nov 20, 2025

PR Preview Action v1.6.0
Preview removed because the pull request was closed.
2025-11-21 21:40 UTC

@blackgirlbytes
Copy link
Contributor

Stellar job! As discussed, Emma will add a dropdown button that says view as markdown or something so that users will know this feature exists.

@emma-squared emma-squared merged commit 043e4a7 into main Nov 21, 2025
18 checks passed
@emma-squared emma-squared deleted the docs/md-for-agents branch November 21, 2025 21:37
michaelneale added a commit that referenced this pull request Nov 24, 2025
* main: (48 commits)
  [fix] generic check for gemini compat (#5842)
  Add scheduler to diagnostics (#5849)
  Cors and token (#5850)
  fix sessions coming back with empty messages (#5841)
  markdown export from URL (#5830)
  Next camp refactor live (#5706)
  Add out of context compaction test via error proxy (#5805)
  fix: Add backward compatibility for conversationCompacted message type (#5819)
  Add /agent/stop endpoint, make max active agents configurable (#5826)
  Handle 404s (#5791)
  Persist provider name and model config in the session (#5419)
  Comment out the flaky mcp callers (#5827)
  Slash commands (#5718)
  fix: remove setx calls to not permanently edit the windows shell PATH (#5821)
  fix: Parse maas models for gcp vertex provider (#5816)
  fix: support Gemini 3's thought signatures (#5806)
  chore: Add Adrian Cole to Maintainers (#5815)
  [MCP-UI] Proxy and Better Message Handling (#5487)
  Release 1.15.0
  Document New Window menu in macOS dock (#5811)
  ...
kskarthik pushed a commit to kskarthik/goose that referenced this pull request Nov 25, 2025
* Add Markdown export of any doc page by appending `.md` to the URL
* New "View as Markdown" dropdown menu from the "copy page" button
kskarthik pushed a commit to kskarthik/goose that referenced this pull request Nov 26, 2025
* Add Markdown export of any doc page by appending `.md` to the URL
* New "View as Markdown" dropdown menu from the "copy page" button

Signed-off-by: Sai Karthik <[email protected]>
BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
* Add Markdown export of any doc page by appending `.md` to the URL
* New "View as Markdown" dropdown menu from the "copy page" button

Signed-off-by: Blair Allan <[email protected]>
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.

4 participants