Skip to content

Commit 4e039a8

Browse files
authored
Merge pull request #24 from ProperDocs/nothemes
Split out the themes into separate packages, NOT installed by default
2 parents 2298918 + bab3ec5 commit 4e039a8

File tree

123 files changed

+1216
-1008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1216
-1008
lines changed

.gitattributes

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
properdocs/contrib/search/lunr-language/** linguist-vendored
2-
properdocs/themes/mkdocs/js/** linguist-vendored
3-
properdocs/themes/mkdocs/js/base.js linguist-vendored=false
4-
properdocs/themes/mkdocs/css/** linguist-vendored
5-
properdocs/themes/mkdocs/css/base.css linguist-vendored=false
6-
properdocs/themes/readthedocs/js/** linguist-vendored
7-
properdocs/themes/readthedocs/js/theme.js linguist-vendored=false
8-
properdocs/themes/readthedocs/css/** linguist-vendored
9-
properdocs/themes/readthedocs/css/theme_extra.css linguist-vendored=false
2+
packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/js/** linguist-vendored
3+
packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/js/base.js linguist-vendored=false
4+
packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/css/** linguist-vendored
5+
packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/css/base.css linguist-vendored=false
6+
packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/js/** linguist-vendored
7+
packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/js/theme.js linguist-vendored=false
8+
packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/css/** linguist-vendored
9+
packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/css/theme_extra.css linguist-vendored=false
1010
docs/img/plugin-events.svg linguist-generated

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
- name: Check packaged files
119119
shell: bash -e -x {0}
120120
run: |
121-
expected_wheel=(-eproperdocs/{templates/sitemap.xml,config/base.py,py.typed,contrib/search/lunr-language/lunr.nl.js,themes/{mkdocs,readthedocs}/{base.html,locales/{de,es}/LC_MESSAGES/messages.mo}})
122-
expected_sdist=("${expected_wheel[@]}" -e{pyproject.toml,hatch_build.py})
121+
expected_wheel=(-eproperdocs/{templates/sitemap.xml,config/base.py,py.typed,contrib/search/lunr-language/lunr.nl.js})
122+
expected_sdist=("${expected_wheel[@]}" -epyproject.toml)
123123
test "$(tar -ztf dist/properdocs-*.tar.gz | grep -F "${expected_sdist[@]}" | tee /dev/stderr | wc -l)" -eq "${#expected_sdist[@]}"
124124
test "$(unzip -l dist/properdocs-*any.whl | grep -F "${expected_wheel[@]}" | tee /dev/stderr | wc -l)" -eq "${#expected_wheel[@]}"

.jshintignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
properdocs/themes/**/js/jquery-**.min.js
2-
properdocs/themes/mkdocs/js/highlight.pack.js
3-
properdocs/themes/mkdocs/js/bootstrap.bundle.min.js
4-
properdocs/themes/mkdocs/js/modernizr-**.min.js
5-
properdocs/themes/readthedocs/js/theme.js
6-
properdocs/themes/readthedocs/js/html5shiv.min.js
2+
packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/js/highlight.pack.js
3+
packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/js/bootstrap.bundle.min.js
4+
packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/js/modernizr-**.min.js
5+
packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/js/theme.js
6+
packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/js/html5shiv.min.js
77
properdocs/contrib/search/templates/search/lunr.js
88
properdocs/contrib/search/lunr-language/lunr.**.js
99
properdocs/contrib/search/lunr-language/tinyseg.js

CONTRIBUTING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,12 @@ updated by running the `extract_messages` command. To update the
159159
`pot` file for both built-in themes, run these commands:
160160
161161
```bash
162-
pybabel extract --project=ProperDocs --copyright-holder=ProperDocs --msgid-bugs-address='https://github.com/properdocs/properdocs/issues' --no-wrap --version="$(hatch version)" --mapping-file properdocs/themes/babel.cfg --output-file properdocs/themes/mkdocs/messages.pot properdocs/themes/mkdocs
163-
pybabel extract --project=ProperDocs --copyright-holder=ProperDocs --msgid-bugs-address='https://github.com/properdocs/properdocs/issues' --no-wrap --version="$(hatch version)" --mapping-file properdocs/themes/babel.cfg --output-file properdocs/themes/readthedocs/messages.pot properdocs/themes/readthedocs
162+
(cd packages/properdocs-theme-mkdocs/ && \
163+
pybabel extract --copyright-holder=ProperDocs --msgid-bugs-address='https://github.com/properdocs/properdocs/issues' --no-wrap --version="$(hatch version)" --mapping-file babel.cfg --output-file properdocs_theme_mkdocs/messages.pot properdocs_theme_mkdocs
164+
)
165+
(cd packages/properdocs-theme-readthedocs/ && \
166+
pybabel extract --copyright-holder=ProperDocs --msgid-bugs-address='https://github.com/properdocs/properdocs/issues' --no-wrap --version="$(hatch version)" --mapping-file babel.cfg --output-file properdocs_theme_readthedocs/messages.pot properdocs_theme_readthedocs
167+
)
164168
```
165169
166170
The updated `pot` file should be included in a PR with the updated template.

docs/dev-guide/translations.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ In particular, the way to know that the `pt` language should be disambiguated as
104104
So, if we pick `es` (Spanish) as our example language code, to add a translation for it to both built-in themes, run these commands:
105105

106106
```bash
107-
pybabel init --input-file properdocs/themes/mkdocs/messages.pot --output-dir properdocs/themes/mkdocs/locales -l es
108-
pybabel init --input-file properdocs/themes/readthedocs/messages.pot --output-dir properdocs/themes/readthedocs/locales -l es
107+
pybabel init --input-file packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/messages.pot --output-dir packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/locales -l es
108+
pybabel init --input-file packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/messages.pot --output-dir packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/locales -l es
109109
```
110110

111111
The above command will create a file structure as follows:
112112

113113
```text
114-
properdocs/themes/mkdocs/locales
114+
packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/locales
115115
├── es
116116
│   └── LC_MESSAGES
117117
│   └── messages.po
@@ -141,8 +141,8 @@ for.
141141
To update the `fr` translation catalog of both built-in themes, use the following commands:
142142

143143
```bash
144-
pybabel update --ignore-obsolete --input-file properdocs/themes/mkdocs/messages.pot --output-dir properdocs/themes/mkdocs/locales -l fr
145-
pybabel update --ignore-obsolete --input-file properdocs/themes/readthedocs/messages.pot --output-dir properdocs/themes/readthedocs/locales -l fr
144+
pybabel update --ignore-obsolete --input-file packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/messages.pot --output-dir packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/locales -l fr
145+
pybabel update --ignore-obsolete --input-file packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/messages.pot --output-dir packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/locales -l fr
146146
```
147147

148148
You can now move on to the next step and [add a translation] for every updated
@@ -174,14 +174,14 @@ files of your theme into `messages.mo` files. The following commands will compil
174174
the `es` translation for both built-in themes:
175175

176176
```bash
177-
pybabel compile --statistics --directory properdocs/themes/mkdocs/locales -l es
178-
pybabel compile --statistics --directory properdocs/themes/readthedocs/locales -l es
177+
pybabel compile --statistics --directory packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/locales -l es
178+
pybabel compile --statistics --directory packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/locales -l es
179179
```
180180

181181
The above command results in the following file structure:
182182

183183
```text
184-
properdocs/themes/mkdocs/locales
184+
packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/locales
185185
├── es
186186
│   └── LC_MESSAGES
187187
│   ├── messages.mo

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ supports the following options:
126126
The following locales are supported by this theme:
127127

128128
* `en`: English (default)
129-
* (see the list of existing directories `properdocs/themes/mkdocs/locales/*/`)
129+
* (see the list of existing directories `packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs/locales/*/`)
130130

131131
See the guide on [localizing your theme] for more information.
132132

@@ -203,7 +203,7 @@ theme supports the following options:
203203
The following locales are supported by this theme:
204204

205205
* `en`: English (default)
206-
* (see the list of existing directories `properdocs/themes/readthedocs/locales/*/`)
206+
* (see the list of existing directories `packages/properdocs-theme-readthedocs/properdocs_theme_readthedocs/locales/*/`)
207207

208208
See the guide on [localizing your theme] for more information.
209209

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ any additional CSS files included in the `custom_dir`.
219219
[custom_dir]: ./configuration.md#custom_dir
220220
[name]: ./configuration.md#name
221221
[mkdocs]: ./choosing-your-theme.md#mkdocs
222-
[browse source]: https://github.com/properdocs/properdocs/tree/master/properdocs/themes/mkdocs
222+
[browse source]: https://github.com/properdocs/properdocs/tree/master/packages/properdocs-theme-mkdocs/properdocs_theme_mkdocs
223223
[Template Variables]: ../dev-guide/themes.md#template-variables
224224
[Jinja documentation]: https://jinja.palletsprojects.com/en/latest/templates/#template-inheritance
225225
[super block]: https://jinja.palletsprojects.com/en/latest/templates/#super-blocks
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright © 2014-present, Tom Christie. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or
4+
without modification, are permitted provided that the following
5+
conditions are met:
6+
7+
Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
Redistributions in binary form must reproduce the above copyright
10+
notice, this list of conditions and the following disclaimer in
11+
the documentation and/or other materials provided with the
12+
distribution.
13+
14+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
15+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
19+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22+
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23+
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25+
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26+
POSSIBILITY OF SUCH DAMAGE.
File renamed without changes.

hatch_build.py renamed to packages/properdocs-theme-mkdocs/hatch_build.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ class CustomBuildHook(BuildHookInterface):
77
def initialize(self, version, build_data):
88
from babel.messages.frontend import compile_catalog
99

10-
for theme in 'mkdocs', 'readthedocs':
11-
cmd = compile_catalog()
12-
cmd.directory = os.path.join('properdocs', 'themes', theme, 'locales')
13-
cmd.finalize_options()
14-
cmd.run()
10+
cmd = compile_catalog()
11+
cmd.directory = os.path.join('properdocs_theme_mkdocs', 'locales')
12+
cmd.finalize_options()
13+
cmd.run()

0 commit comments

Comments
 (0)