Giter VIP home page Giter VIP logo

central-docs-example's Introduction

Central Docs Example

This repository collects the documentation from multiple repositories into one deployment, enabling users of very large codebases to maintain their docs close to the code, but navigate across all of their docs in one deployment.

This is an example of using mkdocs-monorepo-plugin to display the docs of several repositories in one mkdocs deployment.

Quick start

  1. Install requirements with pip install -r requirements.txt
  2. Run just update-docs to install the docs from the repos in repos.yml on your local machine
  3. Run just build to rebuild the docs
  4. Run just docs to serve the docs
  5. View the docs at localhost:8000

Example result: Screenshot 2024-06-24 at 4 28 26 PM Screenshot 2024-06-24 at 4 28 43 PM

Links

Adding a new repo

Preparing the new repo

Requirements:

  1. Add and install the requirements -- mkdocs, mkdocs-material (for the theme) and mkdocs-monorepo-plugin (to support multiple repos)

Example pyproject.toml:

dependencies = ["django>=3.2", "mkdocs", "mkdocs-material", "mkdocs-monorepo-plugin"]

Then run pip install . in your virtual environment to install those packages.

  1. Add a mkdoc.yml file at the root level of the repo.

Example mkdoc.yml in django-email-relay:

site_name: django-email-relay
repo_name: "williln/django-email-relay"
repo_url: "https://github.com/williln/django-email-relay"

nav:
  - Home: "index.md"
  - Configuration: "configuration/index.md"
  - Contributing: "contributing/index.md"
  - Just: "development/just.md"
  - Installation: "installation/index.md"

The important section is the nav element. See Adding Pages in the MkDocs docs.

📌 For each repo you add, you will need to set up the navigation via this mkdocs.yml file.

  1. Commit the result to that repo.

  2. Come back to this repo, central-docs. Add the repo to repos.yml:

repos:
  - name: django-email-relay
    url: https://github.com/williln/django-email-relay.git
    docs_path: docs/
  1. Run locally

Run mkdocs serve in this repo to preview your changes.

Adding a private repo

TBD.

Deployment

TBD. The plan is use GitHub webhooks to trigger a rebuild of these docs whenever any of the docs/ directories in repos.yaml has an update to its main branch. The docs would also rebuild on a push to this main branch (example: when a new repository is added).

central-docs-example's People

Contributors

williln avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.