Skip to content

Commit 69e7cad

Browse files
author
Laurent Franceschetti
committed
Merge branch 'master' of github.com:fralau/mkdocs_macros_plugin into master
2 parents 5bec964 + 9a08f11 commit 69e7cad

5 files changed

Lines changed: 17 additions & 2 deletions

File tree

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include README.md
22
include LICENSE.md
33
include mkdocs_macros/*.md
4+
include mkdocs_macros/py.typed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,20 @@ you should also add the `search` plugin.
142142
If no `plugins` entry is set, MkDocs enables `search` by default; but
143143
if you use it, then you have to declare it explicitly.
144144

145+
By default, undefined variables are printed to the page as-is. If you
146+
wish for a page to fail on undefined variables, you should use the
147+
below configuration instead:
148+
149+
```yaml
150+
plugins:
151+
- search
152+
- macros
153+
on_undefined: strict
154+
```
155+
156+
For details and more options, see the [documentation](
157+
https://mkdocs-macros-plugin.readthedocs.io/en/latest/troubleshooting/#what-happens-if-a-variable-is-undefined).
158+
145159
### Check that it works
146160
The recommended way to check that the plugin works properly is to add the
147161
following command in one of the pages of your site (let's say `info.md`):

mkdocs_macros/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def _load_yaml(self):
373373
# Paths are be relative to the project root.
374374
filename = os.path.join(self.project_dir, filename)
375375
if os.path.isfile(filename):
376-
with open(filename) as f:
376+
with open(filename, encoding="utf-8") as f:
377377
# load the yaml file
378378
# NOTE: for the SafeLoader argument, see: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation
379379
content = yaml.load(f, Loader=yaml.SafeLoader)

mkdocs_macros/py.typed

Whitespace-only changes.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
def read_file(fname):
2828
"Read a local file"
29-
return open(os.path.join(os.path.dirname(__file__), fname)).read()
29+
return open(os.path.join(os.path.dirname(__file__), fname), encoding="utf-8").read()
3030

3131

3232
setup(

0 commit comments

Comments
 (0)