Skip to content

Build documentation for LLMs - #2917

Merged
hadley merged 48 commits into
mainfrom
llms
Oct 20, 2025
Merged

Build documentation for LLMs#2917
hadley merged 48 commits into
mainfrom
llms

Conversation

@maelle

@maelle maelle commented Sep 26, 2025

Copy link
Copy Markdown
Collaborator

Fix #2914

MWE

@maelle

This comment was marked as outdated.

@github-actions

github-actions Bot commented Sep 26, 2025

Copy link
Copy Markdown

@maelle

maelle commented Sep 26, 2025

Copy link
Copy Markdown
Collaborator Author

https://68d644ca6f509ad95baa41de--pkgdown-dev.netlify.app/dev/llms.txt -- I wonder whether the preview workflow should gain the ability to set "" as an URL so that links in the preview would be to the preview.

@maelle maelle changed the title feat: build Markdown oages for all pages feat: build Markdown pages for all pages Sep 26, 2025

@hadley hadley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! Thanks for working on this!

About how long does this extra step take for pkgdown itself? (i.e. how much overhead does this add?)

Comment thread R/build-llm.R Outdated
Comment thread R/build-mds.R Outdated
Comment thread R/build-mds.R Outdated
@maelle

maelle commented Oct 7, 2025

Copy link
Copy Markdown
Collaborator Author

Something is wrong with my benchmark:

benchmark <- bench::mark(
    {fs::dir_delete("docs");pkgdown::build_site(".", lazy = FALSE, preview = FALSE)},
    {fs::dir_delete("docs");pkgdown::build_site(".", lazy = FALSE, preview = FALSE, override = list(template = list("build-md" = FALSE)))}
)

then the median time is 1.3m for the former one, 1.18m for the latter one?!

@hadley

hadley commented Oct 7, 2025

Copy link
Copy Markdown
Member

@maelle given the long duration, I'd just use system.time().

Comment thread tests/testthat/_snaps/build-llm/llm.md Outdated

**deprecated**

`intro`: “Get Started�, which links to a vignette or article with

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not me getting encoding wrong 🫠

@maelle
maelle requested a review from hadley October 16, 2025 11:33
@hadley

hadley commented Oct 16, 2025

Copy link
Copy Markdown
Member

Do you want to add some tests for the individual convert functions, or should I? I think it'd be nice to get this into a release in the near future (e.g. early November?)

@maelle

maelle commented Oct 17, 2025

Copy link
Copy Markdown
Collaborator Author

@hadley

  • The snapshot test covered all things except one... that of course didn't work. Fixed now.
  • Happy for you to add more tests.

@hadley

hadley commented Oct 17, 2025

Copy link
Copy Markdown
Member

Oh we should also decide on some top-level parameter to turn this off for folks who don't want it. How about this?

llm-docs: false

And then in the future if we figure out other needed params we can put them under there:

llm-docs:
  some-new-option: 1
  some-other-option: foo

@maelle

maelle commented Oct 17, 2025

Copy link
Copy Markdown
Collaborator Author

Ah yes definitely important!! I like your suggestion.

@hadley hadley changed the title feat: build Markdown pages for all pages Build documentation for LLMs Oct 17, 2025
{{#subtitle}}<h3>{{{.}}}</h3>{{/subtitle}}
{{#desc}}<div class="section-desc">{{{desc}}}</div>{{/desc}}

{{#topics}}<dl>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@maelle we were accidentally generating a definition list for every definition 😬

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ouch!! 🙈

@hadley
hadley merged commit d63674a into main Oct 20, 2025
17 checks passed
@hadley
hadley deleted the llms branch October 20, 2025 19:33
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.

Feature Request: Add support for generating llms.txt files

3 participants