fix: Interpret custom_dir relative to current directory, not config directory
The custom theme dir handling was not working in case the mkdocs config file was not in the top-level directory. Since mkdocs itself seems only to work in the top-level directory, this PR modifies mkdocs_semiliterate to interpret custom theme dirs relative to the current directory. Also, improves the harmonization between current mkdocs_simple_plugin code and this code. Resolves #28.
This commit is contained in:
parent
9b13ee0b3a
commit
bceddb0701
10 changed files with 466 additions and 16 deletions
4
tests/fixtures/theme-mod-location/etc/doc_theme/.base.generator
vendored
Normal file
4
tests/fixtures/theme-mod-location/etc/doc_theme/.base.generator
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{! "\syspath mkdocs/themes/readthedocs/base.html"
|
||||
extract:
|
||||
replace: [ ['([<]body.*$)', '\1\n<p>Kilroy was here.</p>\n'] ]
|
||||
!}
|
15
tests/fixtures/theme-mod-location/etc/mkdocs.yml
vendored
Normal file
15
tests/fixtures/theme-mod-location/etc/mkdocs.yml
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
site_name: syspath inclusion
|
||||
docs_dir: ../refsite # dummy
|
||||
site_dir: ../site
|
||||
theme:
|
||||
name: readthedocs
|
||||
custom_dir: doc_theme/
|
||||
plugins:
|
||||
- semiliterate:
|
||||
ignore: [refsite]
|
||||
merge_docs_dir: false
|
||||
include: []
|
||||
semiliterate:
|
||||
- pattern: '[.](base).generator$' # Amend readthedocs theme
|
||||
destination: '\1.html'
|
||||
ensurelines: false
|
Loading…
Add table
Add a link
Reference in a new issue