Skip to content

Omit files in 'code-examples' directory from orphan diagnostic check#667

Closed
dacharyc wants to merge 1 commit into
mongodb:mainfrom
dacharyc:omit-code-examples-from-orphan-check
Closed

Omit files in 'code-examples' directory from orphan diagnostic check#667
dacharyc wants to merge 1 commit into
mongodb:mainfrom
dacharyc:omit-code-examples-from-orphan-check

Conversation

@dacharyc

Copy link
Copy Markdown
Contributor

Ticket

N/A

Notes

As part of a code example testing initiative, I am programmatically removing all hard-coded code-block directives in monorepo content. I've written tooling that moves code examples out into files with extensions that vary based on the programming language. Where the programming language is omitted, or the language is text, the content of the code-block is written to a .txt file. See an example in my test repo here (the dir name has changed from untested-examples to code-examples since creating this test PR): dacharyc/workflow-testing#3

I'm starting to migrate docs in the monorepo using my tooling, and it's triggering a bunch of build warnings related to orphaned pages - i.e.:

WARNING(code-examples/includes/fact-connection-strings/1.txt:0ish): Page not included in any toctree and not marked :orphan:

As it is valid to have .txt files that are code examples used in literalincludes, I'd like to omit the orphan diagnostic when the filepath includes the code-examples directory. This should ensure we're only applying the orphan diagnostic to docs pages.

If there's another way you'd prefer to handle this, I'm happy to do something different - just wanted to make it easy with a quickie PR!

README updates

    • This PR introduces changes that should be reflected in the README.md and/or HACKING.md, and I have made those updates.
    • This PR does not introduce changes that should be reflected in the README.md and/or HACKING.md

@dacharyc

Copy link
Copy Markdown
Contributor Author

After discussion with DOP, additional work is needed to avoid processing .txt files in this dir as pages, so closing this PR in favor of the upcoming DOP implementation.

@dacharyc dacharyc closed this Jun 17, 2025
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.

1 participant