Skip to content

Commit 18972bc

Browse files
committed
Partial implementation
1 parent f7dcb7b commit 18972bc

File tree

9 files changed

+91
-21
lines changed

9 files changed

+91
-21
lines changed

src/pulp_docs/mkdocs_macros.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,21 @@ def define_env(env):
253253
@env.macro
254254
def get_repos(repo_type="content"):
255255
"Return repo names by type"
256-
return sorted(repos.get_repos(repo_types=[repo_type]), key=lambda x: x.title)
256+
_repo_type = [repo_type] if repo_type else None
257+
repos_list = sorted(
258+
repos.get_repos(repo_types=_repo_type), key=lambda x: x.title
259+
)
260+
repos_data = [
261+
{
262+
"title": repo.title,
263+
"version": "3.12.1",
264+
"rest_api": f"https://docs.pulpproject.org/{repo.name}/restapi.html",
265+
"codebase_url": f"https://github.com/{repo.owner}/{repo.name}",
266+
"changelog_url": f"site:pulp-docs/docs/sections/help/changelogs/{repo.name}.md",
267+
}
268+
for repo in repos_list
269+
]
270+
return repos_data
257271

258272

259273
def on_pre_page_macros(env):

src/pulp_docs/navigation.py

+7-19
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,8 @@ def grouped_by_persona(tmpdir: Path, repos: Repos):
5656
{content-type}
5757
"""
5858
f = AgregationUtils(tmpdir, repos)
59-
help_section = [
60-
{"Overview": f.section_file("help/index.md")},
61-
{
62-
"Bugs, Feature and Backport Requests": f.section_file(
63-
"help/bugs-features.md"
64-
)
65-
},
66-
]
6759
usage_section = [
68-
{"Overview": f.section_file("usage/index.md")},
60+
{"Overview": f.section_file("user/index.md")},
6961
{
7062
"Pulpcore": [
7163
f.section(
@@ -113,7 +105,7 @@ def grouped_by_persona(tmpdir: Path, repos: Repos):
113105
),
114106
]
115107
development_section = [
116-
{"Overview": f.section_file("development/index.md")},
108+
{"Overview": f.section_file("dev/index.md")},
117109
{
118110
"Pulpcore": [
119111
f.section(
@@ -132,22 +124,18 @@ def grouped_by_persona(tmpdir: Path, repos: Repos):
132124
},
133125
{"Extras": f.repo_grouping("{repo}/docs/dev/{content}", repo_types=["other"])},
134126
]
135-
reference_section = [
136-
{"Overview": f.section_file("reference/index.md")},
137-
{"Rest API": "pulp-docs/docs/rest_api.md"},
138-
{"Glossary": f.section_file("reference/02-glossary.md")},
139-
{"Pulpcore": f.section(Names.CORE, f.get_children, "pulpcore/docs/reference")},
140-
{"Plugins": f.repo_grouping("{repo}/docs/reference", repo_types=["content"])},
141-
{"Extra": f.repo_grouping("{repo}/docs/reference", repo_types=["other"])},
127+
help_section = [
128+
{"Overview": f.section_file("help/index.md")},
129+
{"How to use this documentation": f.section_file("help/bugs-features.md")},
130+
{"Changelog": f.repo_grouping("{repo}/CHANGES.md")},
142131
]
143132

144133
# Main Section
145134
navigation = [
146135
{"Home": "index.md"},
147136
{"User Manual": usage_section},
148137
{"Admin Manual": admin_section},
149-
{"Development": development_section},
150-
{"Reference": reference_section},
138+
{"Developer Manual": development_section},
151139
{"Help": help_section},
152140
]
153141
return navigation

src/pulp_docs/repository.py

+4
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ class SubPackage:
203203
local_basepath = None
204204
branch_in_use = ""
205205
branch = ""
206+
owner = ""
207+
208+
def __post_init__(self):
209+
self.owner = self.subpackage_of
206210

207211

208212
@dataclass

src/pulp_docs/utils/aggregation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def repo_reference_grouping(self):
178178

179179
def section_file(self, section_and_filename: str):
180180
"""Get a markdown file from the website section folder."""
181-
basepath = "pulpcore/docs/sections"
181+
basepath = "pulp-docs/docs/sections"
182182
return f"{basepath}/{section_and_filename}"
183183

184184
def section_children(self, section_name: str):

staging_docs/sections/admin/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Overview

staging_docs/sections/dev/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Overview

staging_docs/sections/help/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Overview
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Overview

staging_docs/sections/user/index.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
hide:
3+
- toc
4+
---
5+
<div class="hero-header" markdown>
6+
# Overview
7+
8+
## This section is for users who need to need create sync, publish and interact with repositories.
9+
10+
11+
12+
<div class="grid cards" markdown>
13+
14+
- **Get Started**
15+
16+
---
17+
18+
Complete the started tutorial [here](#).
19+
20+
21+
- **Understand the docs**
22+
23+
---
24+
25+
Get familiar withhow to use this documentation works. [here](#)
26+
27+
- **Explore**
28+
29+
---
30+
31+
Some content
32+
33+
- **Engage**
34+
35+
---
36+
37+
Some content
38+
39+
</div>
40+
</div>
41+
42+
---
43+
44+
## Quick Links
45+
46+
47+
{% for repo_type in ("core", "content") %}
48+
Repo | Version | Rest API | Github Page | Changelog
49+
--- | --- | --- | --- | ---
50+
{% for repo in get_repos(repo_type) -%}
51+
{{ repo.title }} | `{{ repo.version }}` | <a href="{{ repo.rest_api_url}}" target="_blank">:link:</a> | [:link:]({{ repo.codebase_url }}) | [:link:]({{ repo.changelog_url }})
52+
{% endfor %}
53+
{% endfor %}
54+
55+
Repo | Version | Code (Github) | Changelog
56+
--- | --- | --- | ---
57+
{% for repo in get_repos("other") -%}
58+
{{ repo.title }} | `{{ repo.version }}` | [:link:]({{ repo.codebase_url }}) | [:link:]({{ repo.changelog_url }})
59+
{% endfor %}
60+

0 commit comments

Comments
 (0)