Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
epythet
epythet
  • API reference
    • epythet
      • epythet.agent_outputs
      • epythet.agentic_readme
      • epythet.ai_artifacts
      • epythet.build
      • epythet.call_make
      • epythet.cli
      • epythet.confgen
      • epythet.config
      • epythet.config_parser
      • epythet.docs_gen
      • epythet.migrate
      • epythet.normalizer
      • epythet.provenance
      • epythet.repair
      • epythet.repo_links
      • epythet.scaffold
      • epythet.setup_docsrc
      • epythet.sphinx_conf
      • epythet.sphinx_ext
      • epythet.sweep
      • epythet.templates
      • epythet.themes
      • epythet.tools
        • epythet.tools.docstring_diagnosis
        • epythet.tools.published_docs
      • epythet.userconfig
      • epythet.validation
        • epythet.validation.build
        • epythet.validation.cli
        • epythet.validation.core
        • epythet.validation.coverage
        • epythet.validation.detectors
        • epythet.validation.docstrings
        • epythet.validation.lint
        • epythet.validation.model
        • epythet.validation.parse
        • epythet.validation.propose
        • epythet.validation.render
        • epythet.validation.rendered
        • epythet.validation.review
  • For AI agents
Back to top
View this page

epythet.repo_links¶

Point repo-relative README links at the repository, so they work on the site.

The landing page is the project README included verbatim. A README written for GitHub links to repo files that are not site pages (misc/docs/design.md, LICENSE, examples/); on the built site such a link is a dead relative URL. resolve_repo_link() turns one into a blob/tree URL on the project’s repository, and the doctree-resolved hook in epythet.sphinx_ext applies it to the landing page.

>>> resolve_repo_link("misc/docs/a.md", ["misc/docs/a.md"], "https://github.com/o/r")
'https://github.com/o/r/blob/HEAD/misc/docs/a.md'
>>> resolve_repo_link("https://x.org/a", [], "https://github.com/o/r") is None
True

Module Attributes

DEFAULT_REF

GitHub resolves HEAD to the default branch.

Functions

resolve_repo_link(refuri, repo_paths, ...[, ref])

The repository URL for a repo-relative refuri, or None to leave it alone.

epythet.repo_links.DEFAULT_REF = 'HEAD'¶

GitHub resolves HEAD to the default branch.

Type:

The ref used in generated URLs

epythet.repo_links.resolve_repo_link(refuri, repo_paths, repo_url, *, ref='HEAD')[source]¶

The repository URL for a repo-relative refuri, or None to leave it alone.

Parameters:
  • refuri (str) – the link target as written in the README

  • repo_paths (Container[str]) – the posix paths (files and directories, relative to the project root) that exist; a link is rewritten only when it names one

  • repo_url (str) – the repository’s web URL (https://github.com/owner/repo)

  • ref (str) – the git ref the URL points at

Return type:

str | None

Next
epythet.scaffold
Previous
epythet.repair
Made with Furo
On this page
  • epythet.repo_links
    • DEFAULT_REF
    • resolve_repo_link()