Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for section_path in nav_repos #169

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.8.4

### Prs in Release

- [Support for `section_path` in `nav_repos`](https://github.com/jdoiro3/mkdocs-multirepo-plugin/pull/169)

## 0.8.3

### Prs in Release
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ plugins:
- name: fast-api
import_url: https://github.com/tiangolo/fastapi
imports: [docs/en/docs/index.md]
# Puts the repo in the modules/fast-api directory
section_path: modules

nav:
- Backstage:
Expand Down
7 changes: 5 additions & 2 deletions mkdocs_multirepo_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class NavRepoConfig:
name: str
import_url: str
imports: List[str] = field(default_factory=list)

section_path: Optional[str] = None

@dataclass
class MultirepoConfig:
Expand Down Expand Up @@ -247,7 +247,10 @@ def handle_nav_repos_import(
docs_repo_objs: List[DocsRepo] = []
for nr in nav_repos:
import_stmt = parse_repo_url(nr.import_url)
name: str = slugify(nr.name)
section_slug: str = slugify(nr.name)
path = nr.section_path
name = f"{path}/{section_slug}" if path is not None else section_slug

# mkdocs config values edit_uri and repo_url aren't set
if need_to_derive_edit_uris:
derived_edit_uri = self.derive_config_edit_uri(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mkdocs-multirepo-plugin"
version = "0.8.3"
version = "0.8.4"
description = "Build documentation in multiple repos into one site."
authors = [
{ name="Joseph Doiron", email="josephdoiron1234@yahoo.com" }
Expand Down
Loading