Skip to content

Commit 5973753

Browse files
authored
Merge pull request #27 from ProperDocs/yml
Read the config from properdocs.yml and fall back to mkdocs.yml
2 parents 12f9477 + 660ce25 commit 5973753

37 files changed

Lines changed: 130 additions & 124 deletions

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ It is particularly helpful if an issue report touches on all of these aspects:
2525

2626
1. What are you trying to achieve?
2727

28-
2. What is your `mkdocs.yml` configuration (+ other relevant files)? Preferably reduced to the minimal reproducible example.
28+
2. What is your `properdocs.yml` configuration (+ other relevant files)? Preferably reduced to the minimal reproducible example.
2929

3030
3. What did you expect to happen when applying this setup?
3131

@@ -119,7 +119,7 @@ Documentation files are also checked by markdownlint, so you should run this as
119119
hatch run lint:check
120120
```
121121

122-
If you add a new plugin to mkdocs.yml, you don't need to add it to any "requirements" file, because that is managed automatically.
122+
If you add a new plugin to properdocs.yml, you don't need to add it to any "requirements" file, because that is managed automatically.
123123

124124
> INFO: If you don't want to use Hatch, for documentation you can install requirements into a virtualenv, in one of these ways (with `.venv` being the virtualenv directory):
125125
>

docs/about/release-notes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ See `color_mode`, `user_color_mode_toggle` in [**documentation**](../user-guide/
102102

103103
> WARNING: **Possible breaking change.**
104104
>
105-
> jQuery is no longer included into the "mkdocs" theme. If you were relying on it in your scripts, you will need to separately add it first (into mkdocs.yml) as an extra script:
105+
> jQuery is no longer included into the "mkdocs" theme. If you were relying on it in your scripts, you will need to separately add it first (into `properdocs.yml`) as an extra script:
106106
>
107107
> ```yaml
108108
> extra_javascript:
@@ -328,11 +328,11 @@ pip install $(mkdocs get-deps)
328328
329329
The idea is that right after running this command, you can directly follow it up with `mkdocs build` and it will almost always "just work", without needing to think which dependencies to install.
330330
331-
The way it works is by scanning `mkdocs.yml` for `themes:`, `plugins:`, `markdown_extensions:` items and doing a reverse lookup based on a large list of known projects (catalog, see below).
331+
The way it works is by scanning `properdocs.yml` for `themes:`, `plugins:`, `markdown_extensions:` items and doing a reverse lookup based on a large list of known projects (catalog, see below).
332332
333333
Of course, you're welcome to use a "virtualenv" with such a command. Also note that for environments that require stability (for example CI) directly installing deps in this way is not a very reliable approach as it precludes dependency pinning.
334334
335-
The command allows overriding which config file is used (instead of `mkdocs.yml` in the current directory) as well as which catalog of projects is used (instead of downloading it from the default location). See [`mkdocs get-deps --help`](../user-guide/cli.md#properdocs-get-deps).
335+
The command allows overriding which config file is used (instead of `properdocs.yml` in the current directory) as well as which catalog of projects is used (instead of downloading it from the default location). See [`mkdocs get-deps --help`](../user-guide/cli.md#properdocs-get-deps).
336336
337337
Context: #3205
338338
@@ -356,7 +356,7 @@ Now, in addition to validating relative links, MkDocs will print `INFO` messages
356356
INFO - Doc file 'example.md' contains an absolute link '/foo/bar/', it was left as is. Did you mean 'foo/bar.md'?
357357
```
358358
359-
If you don't want any changes, not even the `INFO` messages, and wish to revert to the silence from MkDocs 1.4, add the following configs to `mkdocs.yml` (**not** recommended):
359+
If you don't want any changes, not even the `INFO` messages, and wish to revert to the silence from MkDocs 1.4, add the following configs to `properdocs.yml` (**not** recommended):
360360
361361
```yaml
362362
validation:

docs/dev-guide/plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class MyPlugin(properdocs.plugins.BasePlugin):
130130
>
131131
> ```yaml
132132
> my_plugin:
133-
> definition_file: configs/test.ini # relative to mkdocs.yml
133+
> definition_file: configs/test.ini # relative to properdocs.yml
134134
> validation:
135135
> enabled: !ENV [CI, false]
136136
> verbose: true

docs/dev-guide/themes.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ the code to describe the different features and their usage.
2323

2424
The bare minimum required for a custom theme is a `main.html` [Jinja2
2525
template] file which is placed in a directory that is *not* a child of the
26-
[docs_dir]. Within `mkdocs.yml`, set the [`theme.custom_dir`][custom_dir]
26+
[docs_dir]. Within `properdocs.yml`, set the [`theme.custom_dir`][custom_dir]
2727
option to the path of the directory containing `main.html`. The path should be
2828
relative to the configuration file. For example, given this example project
2929
layout:
3030

3131
```text
32-
mkdocs.yml
32+
properdocs.yml
3333
docs/
3434
index.md
3535
about.md
@@ -38,7 +38,7 @@ custom_theme/
3838
...
3939
```
4040

41-
... you would include the following settings in `mkdocs.yml` to use the custom theme
41+
... you would include the following settings in `properdocs.yml` to use the custom theme
4242
directory:
4343

4444
```yaml
@@ -64,7 +64,7 @@ theme:
6464
> A theme's [configuration] defined in a `mkdocs_theme.yml` file is not loaded
6565
> from `theme.custom_dir`. When an entire theme exists in `theme.custom_dir`
6666
> and `theme.name` is set to `null`, then the entire theme configuration must
67-
> be defined in the [theme] configuration option in the `mkdocs.yml` file.
67+
> be defined in the [theme] configuration option in the `properdocs.yml` file.
6868
>
6969
> However, when a theme is [packaged] up for distribution, and loaded using
7070
> the `theme.name` configuration option, then a `mkdocs_theme.yml` file
@@ -101,7 +101,7 @@ The simplest `main.html` file is the following:
101101
</html>
102102
```
103103

104-
The body content from each page specified in `mkdocs.yml` is inserted using the
104+
The body content from each page specified in `properdocs.yml` is inserted using the
105105
`{{ page.content }}` tag. Style-sheets and scripts can be brought into this
106106
theme as with a normal HTML file. Navbars and tables of contents can also be
107107
generated and included automatically, through the `nav` and `toc` objects,
@@ -232,7 +232,7 @@ The following variables are available globally on any template.
232232
#### config
233233

234234
The `config` variable is an instance of ProperDocs' config object generated from the
235-
`mkdocs.yml` config file. While you can use any config option, some commonly
235+
`properdocs.yml` config file. While you can use any config option, some commonly
236236
used options include:
237237

238238
* [config.site_name](../user-guide/configuration.md#site_name)
@@ -781,7 +781,7 @@ objects.
781781
```
782782

783783
If present, the `config` object contains the key/value pairs of config options
784-
defined for the plugin in the user's `mkdocs.yml` config file under
784+
defined for the plugin in the user's `properdocs.yml` config file under
785785
`plugings.search`. The `config` object was new in ProperDocs version *1.0*.
786786

787787
The `docs` object contains a list of document objects. Each document object is
@@ -887,7 +887,7 @@ hyphens to separate words and including the name of your theme.
887887
Most of the rest of the file can be left unedited. The last section we need to
888888
change is the entry_points. This is how ProperDocs finds the theme(s) you are
889889
including in the package. The name on the left is the one that users will use
890-
in their mkdocs.yml and the one on the right is the directory containing your
890+
in their properdocs.yml and the one on the right is the directory containing your
891891
theme files.
892892

893893
The directory you created at the start of this section with the main.html file
@@ -922,7 +922,7 @@ Then in a template, that config option could be referenced:
922922
{% endif %}
923923
```
924924

925-
And the user could override the default in their project's `mkdocs.yml` config
925+
And the user could override the default in their project's `properdocs.yml` config
926926
file:
927927

928928
```yaml
@@ -940,7 +940,7 @@ special options which alters its behavior:
940940
>
941941
> This option mirrors the [theme] config option of the same name. If this
942942
> value is not defined in the `mkdocs_theme.yml` file and the user does not
943-
> set it in `mkdocs.yml` then it will default to `en` (English). The value
943+
> set it in `properdocs.yml` then it will default to `en` (English). The value
944944
> is expected to match the language used in the text provided by the theme
945945
> (such a "next" and "previous" links) and should be used as the value of
946946
> the `<html>` tag's `lang` attribute. See [Supporting theme localization/

docs/dev-guide/translations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/locales
191191
Note that the compiled `messages.mo` file was generated based on the
192192
`messages.po` file that you just edited.
193193

194-
Then modify the `mkdocs.yml` file at the root of the project to test the new
194+
Then modify the `properdocs.yml` file at the root of the project to test the new
195195
and/or updated locale:
196196

197197
```yaml
@@ -208,7 +208,7 @@ Finally, run `properdocs serve` to check out your new localized version of the t
208208
> actual text translation `messages.po` files (the rest is ignored by git).
209209
>
210210
> After you have finished testing your work, be sure to undo the change to
211-
> the `locale` setting in the `mkdocs.yml` file before submitting your
211+
> the `locale` setting in the `properdocs.yml` file before submitting your
212212
> changes.
213213

214214
## Updating theme documentation

docs/getting-started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ Take a moment to review the initial project that has been created for you.
2828

2929
![The initial ProperDocs layout](img/initial-layout.png)
3030

31-
There's a single configuration file named `mkdocs.yml`, and a folder named
31+
There's a single configuration file named `properdocs.yml`, and a folder named
3232
`docs` that will contain your documentation source files (`docs` is
3333
the default value for the [docs_dir] configuration setting). Right now the `docs`
3434
folder just contains a single documentation page, named `index.md`.
3535

3636
ProperDocs comes with a built-in dev-server that lets you preview your documentation
37-
as you work on it. Make sure you're in the same directory as the `mkdocs.yml`
37+
as you work on it. Make sure you're in the same directory as the `properdocs.yml`
3838
configuration file, and then start the server by running the `properdocs serve`
3939
command:
4040

@@ -43,7 +43,7 @@ $ properdocs serve
4343
INFO - Building documentation...
4444
INFO - Cleaning site directory
4545
INFO - Documentation built in 0.22 seconds
46-
INFO - [15:50:43] Watching paths for changes: 'docs', 'mkdocs.yml'
46+
INFO - [15:50:43] Watching paths for changes: 'docs', 'properdocs.yml'
4747
INFO - [15:50:43] Serving on http://127.0.0.1:8000/
4848
```
4949

@@ -60,7 +60,7 @@ Open the `docs/index.md` document in your text editor of choice, change the
6060
initial heading to `MkLorum`, and save your changes. Your browser will
6161
auto-reload and you should see your updated documentation immediately.
6262

63-
Now try editing the configuration file: `mkdocs.yml`. Change the
63+
Now try editing the configuration file: `properdocs.yml`. Change the
6464
[`site_name`][site_name] setting to `MkLorum` and save the file.
6565

6666
```yaml
@@ -114,7 +114,7 @@ part!
114114
## Theming our documentation
115115

116116
Now change the configuration file to alter how the documentation is displayed by
117-
changing the theme. Edit the `mkdocs.yml` file and add a [`theme`][theme] setting:
117+
changing the theme. Edit the `properdocs.yml` file and add a [`theme`][theme] setting:
118118

119119
```yaml
120120
site_name: MkLorum

docs/user-guide/choosing-your-theme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ProperDocs includes two built-in themes ([mkdocs](#mkdocs) and
88
[readthedocs](#readthedocs)), as documented below. However, many [third party
99
themes] are available to choose from as well.
1010

11-
To choose a theme, set the [theme] configuration option in your `mkdocs.yml`
11+
To choose a theme, set the [theme] configuration option in your `properdocs.yml`
1212
config file.
1313

1414
```yaml

docs/user-guide/configuration.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Guide to all available configuration settings.
77
## Introduction
88

99
Project settings are configured by default using a YAML configuration file in
10-
the project directory named `mkdocs.yml`. You can specify another path for it
10+
the project directory named `properdocs.yml`. You can specify another path for it
1111
by using the `-f`/`--config-file` option (see `properdocs build --help`).
1212

1313
At a minimum, this configuration file must contain the `site_name`. All other settings are optional.
@@ -823,7 +823,7 @@ This alternative syntax is required if you intend to override some options via
823823

824824
NEW: **New in version 1.4.**
825825

826-
A list of paths to Python scripts (relative to `mkdocs.yml`) that are loaded and used as [plugin](#plugins) instances.
826+
A list of paths to Python scripts (relative to `properdocs.yml`) that are loaded and used as [plugin](#plugins) instances.
827827

828828
For example:
829829

@@ -884,7 +884,7 @@ the site. See the [Plugins] documentation for full details.
884884

885885
**default**: `['search']` (the "search" plugin included with ProperDocs).
886886

887-
If the `plugins` config setting is defined in the `mkdocs.yml` config file, then
887+
If the `plugins` config setting is defined in the `properdocs.yml` config file, then
888888
any defaults (such as `search`) are ignored and you need to explicitly re-enable
889889
the defaults if you would like to continue using them:
890890

@@ -1115,7 +1115,7 @@ Examples of the possible values are:
11151115
```yaml
11161116
- !relative # Relative to the directory of the current Markdown file
11171117
- !relative $docs_dir # Path of the docs_dir
1118-
- !relative $config_dir # Path of the directory that contains the main mkdocs.yml
1118+
- !relative $config_dir # Path of the directory that contains the main properdocs.yml
11191119
- !relative $config_dir/some/child/dir # Some subdirectory of the root config directory
11201120
```
11211121

@@ -1131,12 +1131,12 @@ markdown_extensions:
11311131

11321132
This allows the [pymdownx.snippets] extension to include files relative to the current Markdown file, which without this tag it would have no way of knowing.
11331133

1134-
> NOTE: Even for the default case, any extension's base path is technically the *current working directory* although the assumption is that it's the *directory of mkdocs.yml*. So even if you don't want the paths to be relative, to improve the default behavior, always prefer to use this idiom:
1134+
> NOTE: Even for the default case, any extension's base path is technically the *current working directory* although the assumption is that it's the *directory of properdocs.yml*. So even if you don't want the paths to be relative, to improve the default behavior, always prefer to use this idiom:
11351135
>
11361136
> ```yaml
11371137
> markdown_extensions:
11381138
> - pymdownx.snippets:
1139-
> base_path: !relative $config_dir # Relative to the root directory with mkdocs.yml
1139+
> base_path: !relative $config_dir # Relative to the root directory with properdocs.yml
11401140
> ```
11411141

11421142
## Configuration Inheritance
@@ -1171,15 +1171,15 @@ markdown_extensions:
11711171
```
11721172

11731173
Then, for the "foo" site, the primary configuration file would be defined at
1174-
`foo/mkdocs.yml`:
1174+
`foo/properdocs.yml`:
11751175

11761176
```yml
11771177
INHERIT: ../base.yml
11781178
site_name: Foo Project
11791179
site_url: https://example.com/foo
11801180
```
11811181

1182-
When running `properdocs build`, the file at `foo/mkdocs.yml` would be passed in as
1182+
When running `properdocs build`, the file at `foo/properdocs.yml` would be passed in as
11831183
the configuration file. ProperDocs will then parse that file, retrieve and parse the
11841184
parent file `base.yml` and deep merge the two. This would result in ProperDocs
11851185
receiving the following merged configuration:
@@ -1259,7 +1259,7 @@ path based options in the primary configuration file only.
12591259
The inheritance can also be used as a quick way to override keys on the command line - by using stdin as the config file. For example:
12601260

12611261
```bash
1262-
echo '{INHERIT: mkdocs.yml, site_name: "Renamed site"}' | properdocs build -f -
1262+
echo '{INHERIT: properdocs.yml, site_name: "Renamed site"}' | properdocs build -f -
12631263
```
12641264

12651265
[Theme Developer Guide]: ../dev-guide/themes.md

docs/user-guide/customizing-your-theme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ h1 {
2727
}
2828
```
2929

30-
Then you need to add it to `mkdocs.yml`:
30+
Then you need to add it to `properdocs.yml`:
3131

3232
```yaml
3333
extra_css:
@@ -88,7 +88,7 @@ next to your `docs_dir`:
8888
mkdir custom_theme
8989
```
9090

91-
And then point your `mkdocs.yml` configuration file at the new directory:
91+
And then point your `properdocs.yml` configuration file at the new directory:
9292

9393
```yaml
9494
theme:

docs/user-guide/deploying-your-docs.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ structure:
5454

5555
```text
5656
my-project/
57-
mkdocs.yml
57+
properdocs.yml
5858
docs/
5959
orgname.github.io/
6060
```
@@ -65,10 +65,10 @@ directories to the `orgname.github.io` repository and call the
6565

6666
```sh
6767
cd ../orgname.github.io/
68-
properdocs gh-deploy --config-file ../my-project/mkdocs.yml --remote-branch master
68+
properdocs gh-deploy --config-file ../my-project/properdocs.yml --remote-branch master
6969
```
7070

71-
Note that you need to explicitly point to the `mkdocs.yml` configuration file as
71+
Note that you need to explicitly point to the `properdocs.yml` configuration file as
7272
it is no longer in the current working directory. You also need to inform the
7373
deploy script to commit to the `master` branch. You may override the default
7474
with the [remote_branch] configuration setting, but if you forget to change
@@ -124,7 +124,7 @@ should provide some general assistance.
124124

125125
When you build your site (using the `properdocs build` command), all of the files
126126
are written to the directory assigned to the [site_dir] configuration option
127-
(defaults to `"site"`) in your `mkdocs.yaml` config file. Generally, you will
127+
(defaults to `"site"`) in your `properdocs.yml` config file. Generally, you will
128128
simply need to copy the contents of that directory to the root directory of your
129129
hosting provider's server. Depending on your hosting provider's setup, you may
130130
need to use a graphical or command line [ftp], [ssh] or [scp] client to transfer
@@ -203,7 +203,7 @@ a theme which includes all support files directly in the theme.
203203

204204
When you build your site (using the `properdocs build` command), all of the files
205205
are written to the directory assigned to the [site_dir] configuration option
206-
(defaults to `"site"`) in your `mkdocs.yaml` config file. Generally, you will
206+
(defaults to `"site"`) in your `properdocs.yml` config file. Generally, you will
207207
simply need to copy the contents of that directory and distribute it to your
208208
readers. Alternatively, you may choose to use a third party tool to convert the
209209
HTML files to some other documentation format.

0 commit comments

Comments
 (0)