Skip to content

ENG-9435: add .md files to deal with AI blindly adding .md#6460

Open
adhami3310 wants to merge 2 commits intomainfrom
khaleel/eng-9435-docs-make-pagemd-resolve-the-same-as-pagemd
Open

ENG-9435: add .md files to deal with AI blindly adding .md#6460
adhami3310 wants to merge 2 commits intomainfrom
khaleel/eng-9435-docs-make-pagemd-resolve-the-same-as-pagemd

Conversation

@adhami3310
Copy link
Copy Markdown
Member

ais just do that somestimes

@adhami3310 adhami3310 requested review from a team and Alek99 as code owners May 5, 2026 18:19
@linear
Copy link
Copy Markdown

linear Bot commented May 5, 2026

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 5, 2026

Greptile Summary

This PR adds trailing-slash URL variants for all markdown static assets so that AI agents requesting <page>/.md (a common pattern) are served the same content as <page>.md. A new helper markdown_path_for_trailing_slash_url maps path/to/file.mdpath/to/file/.md, and generate_agent_files now emits both the canonical and trailing-slash paths with identical content.

  • New helper: markdown_path_for_trailing_slash_url uses path.with_suffix(\"\") / \".md\" to produce the secondary path, and is covered by a focused unit test.
  • generate_agent_files change: Collects all markdown files into all_markdown_files first, then appends trailing-slash twins before the llms.txt/llms-full.txt entries.
  • Integration test: test_generate_agent_files_emits_trailing_slash_variants exercises the full pipeline against real docs files to assert presence and content-equality of every twin.

Confidence Score: 5/5

Safe to merge — the change is additive, only appending extra static asset paths to the returned tuple without modifying any existing paths or content.

Both changed files are in the docs app layer with no impact on the core Reflex library. The path-conversion logic is simple and correct, the llms.txt/llms-full.txt entries are untouched, and the integration test directly validates content equality for every twin.

No files require special attention.

Important Files Changed

Filename Overview
docs/app/agent_files/_plugin.py Adds markdown_path_for_trailing_slash_url helper and emits duplicate trailing-slash variants for every markdown asset in generate_agent_files; logic is correct and llms.txt/llms-full.txt entries are unaffected.
docs/app/tests/test_agent_files.py Adds a pure unit test for path conversion and an integration test for twin emission; integration test calls generate_agent_files() against real docs, consistent with the project's test style.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[generate_agent_files] --> B[generate_markdown_file_entries]
    A --> C[generate_dynamic_api_reference_files]
    B --> D[markdown_files\ntuple of url_path, content]
    C --> E[dynamic_api_reference_files\ntuple of path, content]
    D --> F[all_markdown_files list]
    E --> F
    F --> G[Canonical paths\npath/to/file.md]
    F --> H[markdown_path_for_trailing_slash_url\npath/to/file.md → path/to/file/.md]
    H --> I[Trailing-slash twins\npath/to/file/.md]
    G --> J[Return tuple]
    I --> J
    A --> K[generate_llms_txt]
    A --> L[generate_llms_full_txt]
    K --> J
    L --> J
Loading

Reviews (2): Last reviewed commit: "respond to greptile" | Re-trigger Greptile

Comment thread docs/app/tests/test_agent_files.py
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 5, 2026

Merging this PR will not alter performance

✅ 24 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing khaleel/eng-9435-docs-make-pagemd-resolve-the-same-as-pagemd (8b01f43) with main (0487d9b)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@adhami3310 adhami3310 added the documentation Improvements or additions to documentation label May 5, 2026
@adhami3310
Copy link
Copy Markdown
Member Author

@greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant