Conversation
Add {% include-code %} to embed files from git hosting, HTTP storage or
local directories at build time.
vgvoleg
requested review from
martyanovandrey and
separatrixxx
and removed request for
a team
August 19, 2026 12:32
Contributor
|
Thanks! We're discussing the approach internally with the author, will follow up here |
martyanovandrey
removed their request for review
September 1, 2026 14:03
This was referenced Sep 14, 2026
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.
Closes #2207
Adds
{% include-code %}: a document references a file in an external source, and the build embedsits content instead of a hand-written copy.
Three source types:
git(a repository on a hosting service),http(plain files),local(adirectory on disk). Fragments are addressed by named regions (
#region nameor[START name]),line ranges are supported but warned about.
Notes:
gitbinary is used: the ref is resolved over git smart HTTP, then onlythe referenced files are downloaded. One file out of a large monorepo costs kilobytes.
HTML, PDF, single-page, md2md, search and llms.txt need no changes.
Two additions outside the feature directory:
Run.addScope, so downloaded files are read through theexisting path sandbox rather than around it, and an export of
findFencedCodeBlockRanges, so adirective shown as a code example is left alone by the same rule
{% include %}uses.Not covered: private repositories, a lock file, incremental/watch tracking of external files.
User documentation will follow as a separate PR to
diplodoc-platform/docs.