Skip to content

Add ability to publish our docs in markdown format#3097

Open
yasmewad wants to merge 2 commits into
smithy-lang:mainfrom
yasmewad:dev/yasmewad/markdown-docs-publishing
Open

Add ability to publish our docs in markdown format#3097
yasmewad wants to merge 2 commits into
smithy-lang:mainfrom
yasmewad:dev/yasmewad/markdown-docs-publishing

Conversation

@yasmewad
Copy link
Copy Markdown
Contributor

@yasmewad yasmewad commented May 6, 2026

Background

This adds markdown versions of all documentation pages alongside the existing HTML output. AI agents and LLMs can now consume Smithy docs directly at /2.0/markdown/<path>.md without parsing HTML, which is more token-efficient and eliminates the need to navigate through <div> tags and CSS classes to find actual content.

The llms.txt index is updated to point to markdown URLs so agents can programmatically discover all available content. A <link rel="alternate"> tag is added to the landing page so agents parsing smithy.io can find llms.txt without guessing paths.

This also fixes a pre-existing crash in redirects.py where app.warn (deprecated in 1.6, removed in 2.0) caused the build to fail when using any non-HTML builder. Custom node handlers are added for tip, danger, caution, and admonition directives so their content is preserved in the markdown output rather than silently dropped.

Testing

Built locally with Python 3.12. The markdown builder produces 123 files for Smithy 2.0 and 56 for 1.0. Code blocks, tables, cross-references, and links all render correctly. The HTML build continues to work unchanged.

Links

Add sphinx-markdown-builder to produce .md files alongside HTML output.
Agents and LLMs can consume docs at /2.0/markdown/<path>.md without
HTML parsing overhead.

- Add sphinx-markdown-builder dependency to pyproject.toml
- Register sphinx_markdown_builder extension in conf.py
- Add md1/md2/markdown/merge-markdown Makefile targets
- Update llms.txt generator to point to markdown URLs
- Add link tag to landing page for llms.txt discovery
- Fix deprecated app.warn in redirects extension for non-HTML builders
- Add custom node handlers for tip/danger/caution/admonition directives
@yasmewad yasmewad requested a review from a team as a code owner May 6, 2026 02:31
@yasmewad yasmewad requested a review from sugmanue May 6, 2026 02:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

This pull request does not contain a staged changelog entry. To create one, use the ./.changes/new-change command. For example:

./.changes/new-change --pull-requests "#3097" --type feature --description "Dev/yasmewad/markdown docs publishing"

Make sure that the description is appropriate for a changelog entry and that the proper feature type is used. See ./.changes/README or run ./.changes/new-change -h for more information.

@yasmewad yasmewad changed the title Dev/yasmewad/markdown docs publishing Add ability to publish our docs in markdown format May 6, 2026
Add handlers for productionlist (rendered as code blocks), caption
(rendered as bold text), hlist/hlistcol (pass-through to children),
and label (properly differentiate footnote labels from tab labels).
Also fix admonition depart handlers to properly pop context.
@yasmewad yasmewad force-pushed the dev/yasmewad/markdown-docs-publishing branch from bd09b69 to bea3596 Compare May 6, 2026 03:05
/>

<title>Smithy</title>
<link
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This allows implicit discovery if an LLM or agent comes across the documentation through our HTML pages

@yasmewad yasmewad requested a review from kstich May 6, 2026 03:18
@JordonPhillips
Copy link
Copy Markdown
Contributor

Why not just convert all the source to markdown? Some of our pages already use it. That would make offboarding to some other thing easier

@yasmewad
Copy link
Copy Markdown
Contributor Author

yasmewad commented May 6, 2026

Why not just convert all the source to markdown? Some of our pages already use it. That would make offboarding to some other thing easier

Hmm, my intention was to make it additive as a change. Would we lose those !TIP and !IMPORTANT sections if we move away from .rst?

What about we ship this so we get benefit right away for the intention of providing value right now with current conversion and then convert in batches to .md?

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