Skip to content

docs: README.MD and docs/index.md are identical — eliminate redundancy #161

@korbonits

Description

@korbonits

Problem

README.MD and docs/index.md are currently identical files maintained in parallel. Any documentation change must be applied twice or the files drift. This is already happening in practice — the files have to be manually kept in sync on every PR.

Recommended fix

Configure MkDocs to read README.MD directly as the home page, eliminating docs/index.md entirely.

Option A — docs_dir: . (minimal change)

Change mkdocs.yml:

docs_dir: .
nav:
  - Home: README.MD
  - Math Rendering Test File: docs/MathRenderingTestFile.md
  - Prepare For Mac User: docs/PrepareForMacUser.md
  - Prepare For Windows User: docs/PrepareForWindowsUser.md

Then delete docs/index.md. README.MD becomes the single source of truth for both the GitHub repo homepage and the MkDocs site.

Trade-off: MkDocs will scan the entire repo root for .md files, which may produce warnings for files like CONTRIBUTING.md, LICENSE.md, etc. that aren't in the nav. These can be suppressed with exclude_docs: in mkdocs.yml.

Option B — pymdownx.snippets include (no restructure needed)

Keep docs_dir: docs and replace docs/index.md with a one-liner that includes the README:

--8<-- "../README.MD"

Add the extension to mkdocs.yml:

markdown_extensions:
  - pymdownx.snippets

And add pymdownx-extensions to the docs optional dependency group in pyproject.toml.

Trade-off: Adds a new dependency; slightly more indirection.

Recommendation

Option A is simpler and has no new dependencies. Option B avoids restructuring the docs/ directory if that's preferred.

Either way, the fix eliminates a whole class of "forgot to update both files" bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions