Skip to content

Commit 80f312e

Browse files
committed
Switch to being based on and for ProperDocs
1 parent 50c8b85 commit 80f312e

File tree

7 files changed

+60
-60
lines changed

7 files changed

+60
-60
lines changed

.tools/copier-answers.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ _commit: 1c7686408
22
_src_path: gh:oprypin/py-project-template
33
copyright_date: '2023'
44
mkdocs: false
5-
project_description: Hatch plugin to integrate MkDocs and infer dependencies into an env
6-
project_name: hatch-mkdocs
5+
project_description: Hatch plugin to integrate ProperDocs and infer dependencies into an env
6+
project_name: hatch-properdocs
77
pytest: false
8-
python_distribution_name: hatch-mkdocs
8+
python_distribution_name: hatch-properdocs
99
python_source_path: hatch_mkdocs
10-
repository_name: mkdocs/hatch-mkdocs
10+
repository_name: properdocs/hatch-properdocs
1111
script_test: false
1212

README.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
# hatch-mkdocs
1+
# hatch-properdocs
22

3-
**[Hatch] plugin to integrate [MkDocs] and infer dependencies into an env**
3+
**[Hatch] plugin to integrate [ProperDocs] and infer dependencies into an env**
44

5-
[![PyPI](https://img.shields.io/pypi/v/hatch-mkdocs)](https://pypi.org/project/hatch-mkdocs/)
6-
[![License](https://img.shields.io/github/license/mkdocs/hatch-mkdocs)](https://github.com/ProperDocs/hatch-properdocs/blob/master/LICENSE.md)
5+
[![PyPI](https://img.shields.io/pypi/v/hatch-properdocs)](https://pypi.org/project/hatch-properdocs/)
6+
[![License](https://img.shields.io/github/license/properdocs/hatch-properdocs)](https://github.com/ProperDocs/hatch-properdocs/blob/master/LICENSE.md)
77
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ProperDocs/hatch-properdocs/ci.yml.svg)](https://github.com/ProperDocs/hatch-properdocs/actions?query=event%3Apush+branch%3Amaster)
88

9-
This plugin populates [Hatch] environments with `dependencies` on the fly based on a [`mkdocs.yml`] file.
9+
This plugin populates [Hatch] environments with `dependencies` on the fly based on a [`properdocs.yml`] file.
1010

11-
This is intended to effortlessly manage dependencies for a MkDocs site.
11+
This is intended to effortlessly manage dependencies for a ProperDocs site.
1212

13-
You just need to add this minimal config to Hatch, along with any existing MkDocs config:
13+
You just need to add this minimal config to Hatch, along with any existing ProperDocs config:
1414

15-
<table><tr><th><code>hatch.toml</code></th><th><code>mkdocs.yml</code></th></tr>
15+
<table><tr><th><code>hatch.toml</code></th><th><code>properdocs.yml</code></th></tr>
1616
<tr><td>
1717

1818
```toml
1919
[env]
2020
requires = [
21-
"hatch-mkdocs",
21+
"hatch-properdocs",
2222
]
2323

24-
[env.collectors.mkdocs.docs]
25-
path = "mkdocs.yml"
24+
[env.collectors.properdocs.docs]
25+
path = "properdocs.yml"
2626
```
2727

2828
</td><td>
2929

3030
```yaml
31-
site_name: MkDocs example
31+
site_name: ProperDocs example
3232

3333
plugins:
3434
- autorefs
@@ -50,15 +50,15 @@ markdown_extensions:
5050
detached = true
5151
dependencies = [
5252
"markdown-callouts",
53-
"mkdocs",
5453
"mkdocs-autorefs",
54+
"properdocs",
5555
"pymdown-extensions",
5656
]
5757

5858
[envs.docs.scripts]
59-
build = "mkdocs build -f mkdocs.yml {args}"
60-
serve = "mkdocs serve -f mkdocs.yml {args}"
61-
gh-deploy = "mkdocs gh-deploy -f mkdocs.yml {args}"
59+
build = "properdocs build -f properdocs.yml {args}"
60+
serve = "properdocs serve -f properdocs.yml {args}"
61+
gh-deploy = "properdocs gh-deploy -f properdocs.yml {args}"
6262
```
6363

6464
</td></tr></table>
@@ -69,9 +69,9 @@ gh-deploy = "mkdocs gh-deploy -f mkdocs.yml {args}"
6969

7070
With this:
7171

72-
* You don't need to specify the PyPI dependencies, they get inferred on the fly just from [`mkdocs.yml`] by doing a reverse lookup of MkDocs plugins in the [catalog], using [`properdocs get-deps`]. (See more details there)
72+
* You don't need to specify the PyPI dependencies, they get inferred on the fly just from [`properdocs.yml`] by doing a reverse lookup of ProperDocs plugins in the [catalog], using [`properdocs get-deps`]. (See more details there)
7373

74-
* An automatically managed virtual environment with pre-defined MkDocs commands is at your fingertips.
74+
* An automatically managed virtual environment with pre-defined ProperDocs commands is at your fingertips.
7575

7676
You can check this yourself:
7777

@@ -83,8 +83,8 @@ You can check this yourself:
8383
│ Name │ Type │ Dependencies │ Scripts │
8484
├──────┼─────────┼────────────────────┼───────────┤
8585
│ docs │ virtual │ markdown-callouts │ build │
86-
│ │ │ mkdocs │ gh-deploy │
87-
│ │ │ mkdocs-autorefs │ serve │
86+
│ │ │ mkdocs-autorefs │ gh-deploy │
87+
│ │ │ properdocs │ serve │
8888
│ │ │ pymdown-extensions │ │
8989
└──────┴─────────┴────────────────────┴───────────┘
9090
```
@@ -106,9 +106,9 @@ INFO - Documentation built in 0.03 seconds
106106

107107
</details>
108108

109-
(If you've been using virtualenvs directly, this single command replaces creating an environment, installing dependencies into it, as well as running `mkdocs` in it, optionally with arguments)
109+
(If you've been using virtualenvs directly, this single command replaces creating an environment, installing dependencies into it, as well as running `properdocs` in it, optionally with arguments)
110110

111-
Furthermore, whenever the set of dependencies changes (i.e. you select new MkDocs plugins), these Hatch commands will re-install dependencies as necessary.
111+
Furthermore, whenever the set of dependencies changes (i.e. you select new ProperDocs plugins), these Hatch commands will re-install dependencies as necessary.
112112
Otherwise, the environment is just reused; the installation happens only on the first invocation.
113113

114114
If at any point you want to make sure the dependencies are re-installed anew, you can just remove the environment:
@@ -128,15 +128,15 @@ Just [install Hatch]. Ideally in an isolated way with **`pipx install hatch`** (
128128

129129
</details>
130130

131-
If you declare `hatch-mkdocs` as a dependency in your Hatch config (`pyproject.toml` or `hatch.toml`) as shown above, Hatch will automatically install it on first use.
131+
If you declare `hatch-properdocs` as a dependency in your Hatch config (`pyproject.toml` or `hatch.toml`) as shown above, Hatch will automatically install it on first use.
132132

133-
Alternatively you can install it manually: `pipx inject hatch hatch-mkdocs` or just `pip install hatch-mkdocs`.
133+
Alternatively you can install it manually: `pipx inject hatch hatch-properdocs` or just `pip install hatch-properdocs`.
134134

135-
And do *not* install MkDocs - it's unnecessary, only the sub-environments will have it.
135+
And do *not* install ProperDocs - it's unnecessary, only the sub-environments will have it.
136136

137137
## Configuration
138138

139-
Note that although Hatch is typically associated with managing entire Python projects and applications, you *can* use it purely for environment management for a MkDocs site - through this plugin, or even without it.
139+
Note that although Hatch is typically associated with managing entire Python projects and applications, you *can* use it purely for environment management for a ProperDocs site - through this plugin, or even without it.
140140

141141
Hatch can be configured through one of two files - `hatch.toml` or `pyproject.toml`. Configs in the latter are equivalent but will always need a `[tool.hatch...]` prefix; it can be used if you have an existing Python project and you don't want to add another config file.
142142

@@ -148,11 +148,11 @@ So, add the following into one of the files:
148148
```toml
149149
[env]
150150
requires = [
151-
"hatch-mkdocs",
151+
"hatch-properdocs",
152152
]
153153

154-
[env.collectors.mkdocs.ENV_NAME]
155-
path = "path/to/mkdocs.yml"
154+
[env.collectors.properdocs.ENV_NAME]
155+
path = "path/to/properdocs.yml"
156156

157157
[envs.ENV_NAME]
158158
...
@@ -163,31 +163,31 @@ path = "path/to/mkdocs.yml"
163163
```toml
164164
[tool.hatch.env]
165165
requires = [
166-
"hatch-mkdocs"
166+
"hatch-properdocs"
167167
]
168168

169-
[tool.hatch.env.collectors.mkdocs.ENV_NAME]
170-
path = "path/to/mkdocs.yml"
169+
[tool.hatch.env.collectors.properdocs.ENV_NAME]
170+
path = "path/to/properdocs.yml"
171171

172172
[tool.hatch.envs.ENV_NAME]
173173
...
174174
```
175175

176176
</td></tr></table>
177177

178-
Here, `[env.collectors.mkdocs.ENV_NAME]` means: please populate an environment named "ENV_NAME" based on an MkDocs config. In that section, `path` is the path to `mkdocs.yml`.
178+
Here, `[env.collectors.properdocs.ENV_NAME]` means: please populate an environment named "ENV_NAME" based on an ProperDocs config. In that section, `path` is the path to `properdocs.yml`.
179179

180180
At the moment that is the entire configurability of this plugin.
181181

182-
In the first example we used "docs" as the environment name, you can use "mkdocs" as well if you like, or anything else. Further, if you use "default" as the name (which you might do if documentation building is all that you'll ever use Hatch for) then you can skip the environment prefix (`docs:` in the above example).
182+
In the first example we used "docs" as the environment name, you can use "properdocs" as well if you like, or anything else. Further, if you use "default" as the name (which you might do if documentation building is all that you'll ever use Hatch for) then you can skip the environment prefix (`docs:` in the above example).
183183

184184
Multiple separate environments with their own configs and dependencies can be populated as well.
185185

186186
Inside `[envs.ENV_NAME]` (which is an ordinary construct in Hatch) you can proceed to further customize the environment (though normally it shouldn't be necessary, and the section can be omitted from the text config): you can add extra [`dependencies`] or [`scripts`], or any other environment config. You could also set [`detached`] back to `false` if the documentation actually relies on the project itself being installed, such as in the case of [mkdocstrings].
187187

188188

189-
[MkDocs]: https://github.com/mkdocs/mkdocs
190-
[`mkdocs.yml`]: https://www.mkdocs.org/user-guide/configuration/
189+
[ProperDocs]: https://github.com/ProperDocs/properdocs
190+
[`properdocs.yml`]: https://properdocs.org/user-guide/configuration/
191191
[`properdocs get-deps`]: https://github.com/ProperDocs/get-deps
192192
[catalog]: https://github.com/ProperDocs/catalog
193193
[Hatch]: https://hatch.pypa.io/
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from hatch.env.collectors.plugin.interface import EnvironmentCollectorInterface
2-
from mkdocs_get_deps import get_deps
2+
from properdocs.commands.get_deps import get_deps
33

44

55
class MkDocsEnvironmentCollector(EnvironmentCollectorInterface):
6-
PLUGIN_NAME = "mkdocs"
6+
PLUGIN_NAME = "properdocs"
77

88
def finalize_config(self, config: dict[str, dict]) -> None:
99
for env_name, plugin_env_entry in self.config.items():
10-
path = plugin_env_entry.get("path", "mkdocs.yml")
10+
path = plugin_env_entry.get("path", "properdocs.yml")
1111

1212
deps = get_deps(config_file=self.root / path)
1313
env = config.setdefault(env_name, {})
@@ -17,6 +17,6 @@ def finalize_config(self, config: dict[str, dict]) -> None:
1717
env.setdefault("detached", True)
1818

1919
scripts_config = env.setdefault("scripts", {})
20-
scripts_config.setdefault("build", f"mkdocs build -f {path} {{args}}")
21-
scripts_config.setdefault("serve", f"mkdocs serve -f {path} {{args}}")
22-
scripts_config.setdefault("gh-deploy", f"mkdocs gh-deploy -f {path} {{args}}")
20+
scripts_config.setdefault("build", f"properdocs build -f {path} {{args}}")
21+
scripts_config.setdefault("serve", f"properdocs serve -f {path} {{args}}")
22+
scripts_config.setdefault("gh-deploy", f"properdocs gh-deploy -f {path} {{args}}")

pyproject.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "hatch-mkdocs"
7-
description = "Plugin for Hatch to infer env dependencies from mkdocs.yml"
6+
name = "hatch-properdocs"
7+
description = "Plugin for Hatch to infer env dependencies from properdocs.yml"
88
readme = "README.md"
99
license = "MIT"
10-
keywords = ["mkdocs"]
10+
keywords = ["properdocs"]
1111
authors = [
1212
{name = "Oleh Prypin", email = "oleh@pryp.in"},
1313
]
@@ -35,23 +35,23 @@ dynamic = ["version"]
3535
requires-python = ">=3.9"
3636
dependencies = [
3737
"hatch >=1.6.0",
38-
"mkdocs-get-deps >=0.2.0",
38+
"properdocs",
3939
]
4040

4141
[project.urls]
42-
Documentation = "https://github.com/mkdocs/hatch-mkdocs#readme"
43-
Source = "https://github.com/mkdocs/hatch-mkdocs"
44-
Issues = "https://github.com/mkdocs/hatch-mkdocs/issues"
45-
History = "https://github.com/mkdocs/hatch-mkdocs/releases"
42+
Documentation = "https://github.com/ProperDocs/hatch-properdocs#readme"
43+
Source = "https://github.com/ProperDocs/hatch-properdocs"
44+
Issues = "https://github.com/ProperDocs/hatch-properdocs/issues"
45+
History = "https://github.com/ProperDocs/hatch-properdocs/releases"
4646

4747
[project.entry-points.hatch]
48-
hatch-mkdocs = "hatch_mkdocs.hatch_hooks"
48+
hatch-properdocs = "hatch_properdocs.hatch_hooks"
4949

5050
[tool.hatch.version]
51-
path = "hatch_mkdocs/__init__.py"
51+
path = "hatch_properdocs/__init__.py"
5252

5353
[tool.hatch.build.targets.sdist]
54-
include = ["/hatch_mkdocs"]
54+
include = ["/hatch_properdocs"]
5555

5656
[tool.hatch.env]
5757
requires = ["hatch-pip-compile >=1.7.0"]
@@ -67,7 +67,7 @@ dependencies = [
6767
"mypy",
6868
]
6969
[tool.hatch.envs.types.scripts]
70-
check = "mypy {args} hatch_mkdocs"
70+
check = "mypy {args} hatch_properdocs"
7171

7272
[tool.hatch.envs.style]
7373
type = "pip-compile"
@@ -76,8 +76,8 @@ dependencies = [
7676
"ruff",
7777
]
7878
[tool.hatch.envs.style.scripts]
79-
check = "ruff check hatch_mkdocs {args}"
80-
format = "ruff format -q hatch_mkdocs"
79+
check = "ruff check hatch_properdocs {args}"
80+
format = "ruff format -q hatch_properdocs"
8181
fix = [
8282
"check --fix --unsafe-fixes",
8383
"format",

0 commit comments

Comments
 (0)