-
Notifications
You must be signed in to change notification settings - Fork 8
AFDocs: Improve docs accessibility for agents #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f0eafa7
AFDocs: LLM and Markdown discoverability
mnocon cf3408c
Updated base_url for llmstxt
mnocon 0734ec0
Fixed baseurl
mnocon e849340
Updated description
mnocon 88750c2
Added blockquote
mnocon 16b30fc
Nav -> div changes
mnocon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| {% extends "base.html" %} | ||
| {% set md_href = page.file.dest_uri | replace('.html', '.md') if page else '' %} | ||
| {% block htmltitle %} | ||
| {%- if page and page.meta and page.meta.title -%} | ||
| <title>{{ page.meta.title }}</title> | ||
|
|
@@ -20,7 +21,6 @@ | |
| <link rel="llms" href="{{ 'llms-full.txt' | url }}" title="LLM-friendly full content"> | ||
|
|
||
| {% if page and not page.meta.exclude_from_llmstxt %} | ||
| {% set md_href = page.file.dest_uri | replace('.html', '.md') %} | ||
| <link rel="alternate" type="text/markdown" href="{{ md_href | url }}" title="Markdown Version"> | ||
| {% endif %} | ||
|
|
||
|
|
@@ -30,7 +30,10 @@ | |
|
|
||
| {% block site_nav %} | ||
| {% if nav %} | ||
| <div class="main_nav"> | ||
| {# The single <nav> landmark wrapping the whole sidebar. Keep it the only <nav> in this | ||
| subtree: nested <nav> tags break the HTML->Markdown converters used by AI agents | ||
| (e.g. behind RTD's "Accept: text/markdown"), leaking nav items into the output. #} | ||
| <nav class="main_nav" aria-label="Site navigation"> | ||
| <div class="main_nav_content"> | ||
| <div class="site-header" id="site-name"> | ||
| <a href="/projects/userguide/">{{ config.site_name }}</a> | ||
|
|
@@ -43,7 +46,7 @@ | |
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </nav> | ||
| {% endif %} | ||
| {% if page.toc %} | ||
| <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> | ||
|
|
@@ -58,6 +61,11 @@ | |
|
|
||
|
|
||
| {% block content %} | ||
| <!-- Discovery directive for AI agents; visually hidden --> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| <div style="position:absolute;width:1px;height:1px;clip:rect(0 0 0 0);overflow:hidden" aria-hidden="true"> | ||
| For AI agents: the complete documentation index is available at <a href="{{ 'llms.txt' | url }}">llms.txt</a> | ||
| {% if page and not page.meta.exclude_from_llmstxt %}This page is also <a href="{{ md_href | url }}">available as Markdown</a>{% endif %}. | ||
| </div> | ||
| {% set ns = namespace(bootstrap_extra_css='') %} | ||
| {% for md_file in config.extra.append_bootstrap if 'docs' + md_file in page.edit_url %} | ||
| {% set ns.bootstrap_extra_css = ' bootstrap-iso' %} | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,12 @@ | ||
| <nav class="md-nav md-nav--primary" data-md-level="0"> | ||
| {# div instead of nav: the whole sidebar is wrapped in a single <nav> in main.html. | ||
| Nested <nav> tags break the HTML->Markdown converters used by AI agents (e.g. the one | ||
| behind RTD's "Accept: text/markdown"), which skip <nav> only until the first closing tag. #} | ||
| <div class="md-nav md-nav--primary" data-md-level="0"> | ||
| <ul class="md-nav__list" data-md-scrollfix> | ||
| {% for nav_item in nav %} | ||
| {% set path = "nav-" + loop.index | string %} | ||
| {% set level = 1 %} | ||
| {% include "partials/nav-item.html" %} | ||
| {% endfor %} | ||
| </ul> | ||
| </nav> | ||
| </div> |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Result: https://ez-systems-developer-documentation--415.com.readthedocs.build/projects/userguide/en/415/llms.txt