Skip to content

update to support descriptions with file links #8

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

logan-markewich
Copy link

This PR adds new config options to provide a description with each page link

sections:
  Usage documentation:
    file1.md: Description of file1
    file2.md: Description of file2

Which would generate something like

- [Page Title](page_url): Description of the page

Added some unit tests, so I think this will work nicely? Open to changes!


```yaml title="mkdocs.yml"
plugins:
- llmstxt:
sections:
Usage documentation:
- index.md
- usage/*.md
index.md: Main documentation page

Choose a reason for hiding this comment

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

you'd need the dashes here still, no? this doesn't look legal on the next line

Copy link
Author

@logan-markewich logan-markewich May 10, 2025

Choose a reason for hiding this comment

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

So from what I understand:

  • if you are using descriptions, this format is correct
  • the old format (just a list using dashes) also still works

Copy link
Owner

Choose a reason for hiding this comment

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

But here you're using both formats at once, which is invalid: you'd at least need a trailing colon on the next line.

@logan-markewich
Copy link
Author

@pawamoy would be great if we can get this merged. Happy to make any additional changes

Copy link
Owner

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

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

Thanks a lot @logan-markewich!

What I'd prefer is that we keep using a list, and support items being either a string or a dict (with a single key/value pair):

    sections:
      Usage documentation:
      - file1.md
      - file2.md: Description of file2

This has a few benefits:

  • it lets users add descriptions incrementally
  • it makes the ordering explicit (in our case dicts would be loaded ordered from Python YAML, but that's not always the case for other languages in which the YAML data could be loaded)

WDYT?


```yaml title="mkdocs.yml"
plugins:
- llmstxt:
sections:
Usage documentation:
- index.md
- usage/*.md
index.md: Main documentation page
Copy link
Owner

Choose a reason for hiding this comment

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

But here you're using both formats at once, which is invalid: you'd at least need a trailing colon on the next line.

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.

3 participants