fix: serve spec-compliant .html.md versions of rendered pages#134
Open
keplervital wants to merge 1 commit into
Open
fix: serve spec-compliant .html.md versions of rendered pages#134keplervital wants to merge 1 commit into
keplervital wants to merge 1 commit into
Conversation
The proposal says markdown versions of pages live at the page URL with
.md appended, and that URLs without a file name should use index.html.md.
The notebook-built pages (intro, core) already comply via keep-md, but
index, nbdev, domains and ed only get a commonmark render named {stem}.md
(or {stem}-commonmark.md when the source itself is a .md file), so
index.html.md, nbdev.html.md, domains.html.md and ed.html.md were 404.
Add a Quarto post-render script that copies each generated markdown
output to its .html.md name. Existing URLs such as index.md and
ed-commonmark.md are kept as is.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #135.
The proposal on the homepage says:
llmstxt.org itself only follows this for the notebook-built pages. The others 404:
//index.html.md/index.mdexists)/nbdev.html/nbdev.html.md/nbdev.mdexists)/domains.html/domains.html.md/domains-commonmark.mdexists)/ed.html/ed.html.md/ed-commonmark.mdexists)/intro.html/intro.html.md/core.html/core.html.mdThe
.html.mdfiles only appear for executed notebooks (viakeep-md). The qmd and md pages just get the commonmark render, named{stem}.md, or{stem}-commonmark.mdwhen the source itself is a.mdfile.This PR adds a small Quarto post-render script that copies each generated markdown output to its
.html.mdname, plus the one line in_quarto.ymlto enable it.A few deliberate choices:
llms.txtwas pointed at/index.mdon purpose back in 0536f0c, so/index.mdand/ed-commonmark.mdkeep working exactly as before. The script only adds the.html.mdcounterparts next to them.keep-mdversions ofintro.html.mdandcore.html.mdare never overwritten..tsfile rather than Python becausenbdev_docscopies sources through_procbefore rendering, and that copy drops_-prefixed files and strips the.pyextension from Python files. Quarto runs.tspost-render scripts with its bundled Deno, so there are no new dependencies.Verified locally with
nbdev-docs(same as the deploy workflow):_docsnow containsindex.html.md,nbdev.html.md,domains.html.mdanded.html.md, each byte-identical to its.mdsource, and all previously working URLs still return 200 when serving_docs.Known limitation:
llmstxt-js.htmlis a raw HTML resource that never goes through the renderer, so it still has no markdown version.