mkdocs-include-markdown-plugin 6.0.4__tar.gz → 6.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (14) hide show
  1. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/LICENSE +1 -1
  2. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/PKG-INFO +57 -46
  3. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/README.md +55 -44
  4. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/pyproject.toml +11 -9
  5. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/src/mkdocs_include_markdown_plugin/event.py +6 -6
  6. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/.gitignore +0 -0
  7. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/src/mkdocs_include_markdown_plugin/__init__.py +0 -0
  8. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/src/mkdocs_include_markdown_plugin/cache.py +0 -0
  9. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/src/mkdocs_include_markdown_plugin/config.py +0 -0
  10. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/src/mkdocs_include_markdown_plugin/directive.py +0 -0
  11. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/src/mkdocs_include_markdown_plugin/files_watcher.py +0 -0
  12. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/src/mkdocs_include_markdown_plugin/plugin.py +0 -0
  13. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/src/mkdocs_include_markdown_plugin/process.py +0 -0
  14. {mkdocs_include_markdown_plugin-6.0.4 → mkdocs_include_markdown_plugin-6.0.5}/src/mkdocs_include_markdown_plugin/py.typed +0 -0
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright 2017-2023 Joe Rickerby and contributors
190
+ Copyright 2017-2024 Joe Rickerby and contributors
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: mkdocs-include-markdown-plugin
3
- Version: 6.0.4
3
+ Version: 6.0.5
4
4
  Summary: Mkdocs Markdown includer plugin.
5
5
  Project-URL: Source, https://github.com/mondeja/mkdocs-include-markdown-plugin
6
6
  Project-URL: Documentation, https://github.com/mondeja/mkdocs-include-markdown-plugin#documentation
@@ -96,46 +96,51 @@ plugins:
96
96
  end: <!--end-->
97
97
  ```
98
98
 
99
- - <a name="config_tags" href="#config_tags">#</a> **opening_tag** and
100
- **closing_tag**: The default opening and closing tags. By default are
101
- `{%` and `%}`.
102
-
103
- ```yaml
104
- plugins:
105
- - include-markdown:
106
- opening_tag: "{!"
107
- closing_tag: "!}"
108
- ```
109
-
110
- - <a name="config_exclude" href="#config_exclude">#</a> **exclude**: Define
111
- global exclusion wildcard patterns. Relative paths defined here will be
112
- relative to the _docs/_ directory.
113
-
114
- ```yaml
115
- plugins:
116
- - include-markdown:
117
- exclude:
118
- - LICENSE.md
119
- - api/**
120
- ```
121
-
122
- - <a name="config_cache" href="#config_cache">#</a> **cache**: Define a
123
- expiration time in seconds for cached HTTP requests when including
124
- from URLs.
125
-
126
- ```yaml
127
- plugins:
128
- - include-markdown:
129
- cache: 600
130
- ```
131
-
132
- In order to use this feature, the dependency [platformdirs] must be installed.
133
- You can include it in the installation of the plugin adding the `cache` extra:
134
-
135
- ```txt
136
- # requirements.txt
137
- mkdocs-include-markdown-plugin[cache]
138
- ```
99
+ #### `opening_tag` and `closing_tag`
100
+
101
+ Default opening and closing tags. When not specified they are `{%` and `%}`.
102
+
103
+ ```yaml
104
+ plugins:
105
+ - include-markdown:
106
+ opening_tag: "{!"
107
+ closing_tag: "!}"
108
+ ```
109
+
110
+ <!-- mdpo-disable-next-line -->
111
+
112
+ #### `exclude`
113
+
114
+ Global exclusion wildcard patterns. Relative paths defined here will be
115
+ relative to the [`docs_dir`] directory.
116
+
117
+ ```yaml
118
+ plugins:
119
+ - include-markdown:
120
+ exclude:
121
+ - LICENSE.md
122
+ - api/**
123
+ ```
124
+
125
+ <!-- mdpo-disable-next-line -->
126
+
127
+ #### `cache`
128
+
129
+ Expiration time in seconds for cached HTTP requests when including from URLs.
130
+
131
+ ```yaml
132
+ plugins:
133
+ - include-markdown:
134
+ cache: 600
135
+ ```
136
+
137
+ In order to use this feature, the dependency [platformdirs] must be installed.
138
+ You can include it in the installation of the plugin adding the `cache` extra:
139
+
140
+ ```txt
141
+ # requirements.txt
142
+ mkdocs-include-markdown-plugin[cache]
143
+ ```
139
144
 
140
145
  ### Reference
141
146
 
@@ -148,7 +153,9 @@ Paths of included files can be either:
148
153
  - Local files:
149
154
  - Absolute paths (starting with a path separator).
150
155
  - Relative from the file that includes them (starting with `./` or `../`).
151
- - Relative from the _docs/_ directory.
156
+ - Relative to the [`docs_dir`] directory. For instance if your `docs_dir` is
157
+ _./docs/_, then `includes/header.md` will match the file
158
+ _./docs/includes/header.md_.
152
159
  - [Bash wildcard globs] matching multiple local files.
153
160
 
154
161
  File paths to include and string arguments can be wrapped by double `"` or
@@ -212,7 +219,7 @@ content to include.
212
219
 
213
220
  ```jinja
214
221
  {%
215
- include-markdown 'docs/includes/header.md'
222
+ include-markdown 'includes/header.md'
216
223
  start='<!--\n\ttable-start\n-->'
217
224
  end='<!--\n\ttable-end\n-->'
218
225
  rewrite-relative-urls=false
@@ -222,7 +229,7 @@ content to include.
222
229
 
223
230
  ```jinja
224
231
  {%
225
- include-markdown "docs/includes/header.md"
232
+ include-markdown "includes/header.md"
226
233
  heading-offset=1
227
234
  %}
228
235
  ```
@@ -303,6 +310,10 @@ Includes the content of a file or a group of files.
303
310
  [giving me the permissions][cibuildwheel-470] to separate this plugin from the
304
311
  documentation of [cibuildwheel][cibuildwheel-repo-link].
305
312
 
313
+ [Bash wildcard globs]: https://facelessuser.github.io/wcmatch/glob/#syntax
314
+
315
+ <!-- mdpo-disable -->
316
+
306
317
  [pypi-link]: https://pypi.org/project/mkdocs-include-markdown-plugin
307
318
  [pypi-version-badge-link]: https://img.shields.io/pypi/v/mkdocs-include-markdown-plugin?logo=pypi&logoColor=white
308
319
  [tests-image]: https://img.shields.io/github/actions/workflow/status/mondeja/mkdocs-include-markdown-plugin/ci.yml?logo=github&label=tests&branch=master
@@ -316,4 +327,4 @@ Includes the content of a file or a group of files.
316
327
  [cibuildwheel-repo-link]: https://github.com/pypa/cibuildwheel
317
328
  [es-readme-link]: https://github.com/mondeja/mkdocs-include-markdown-plugin/blob/master/locale/es/README.md
318
329
  [fr-readme-link]: https://github.com/mondeja/mkdocs-include-markdown-plugin/blob/master/locale/fr/README.md
319
- [Bash wildcard globs]: https://facelessuser.github.io/wcmatch/glob/#syntax
330
+ [`docs_dir`]: https://www.mkdocs.org/user-guide/configuration/#docs_dir
@@ -61,46 +61,51 @@ plugins:
61
61
  end: <!--end-->
62
62
  ```
63
63
 
64
- - <a name="config_tags" href="#config_tags">#</a> **opening_tag** and
65
- **closing_tag**: The default opening and closing tags. By default are
66
- `{%` and `%}`.
67
-
68
- ```yaml
69
- plugins:
70
- - include-markdown:
71
- opening_tag: "{!"
72
- closing_tag: "!}"
73
- ```
74
-
75
- - <a name="config_exclude" href="#config_exclude">#</a> **exclude**: Define
76
- global exclusion wildcard patterns. Relative paths defined here will be
77
- relative to the _docs/_ directory.
78
-
79
- ```yaml
80
- plugins:
81
- - include-markdown:
82
- exclude:
83
- - LICENSE.md
84
- - api/**
85
- ```
86
-
87
- - <a name="config_cache" href="#config_cache">#</a> **cache**: Define a
88
- expiration time in seconds for cached HTTP requests when including
89
- from URLs.
90
-
91
- ```yaml
92
- plugins:
93
- - include-markdown:
94
- cache: 600
95
- ```
96
-
97
- In order to use this feature, the dependency [platformdirs] must be installed.
98
- You can include it in the installation of the plugin adding the `cache` extra:
99
-
100
- ```txt
101
- # requirements.txt
102
- mkdocs-include-markdown-plugin[cache]
103
- ```
64
+ #### `opening_tag` and `closing_tag`
65
+
66
+ Default opening and closing tags. When not specified they are `{%` and `%}`.
67
+
68
+ ```yaml
69
+ plugins:
70
+ - include-markdown:
71
+ opening_tag: "{!"
72
+ closing_tag: "!}"
73
+ ```
74
+
75
+ <!-- mdpo-disable-next-line -->
76
+
77
+ #### `exclude`
78
+
79
+ Global exclusion wildcard patterns. Relative paths defined here will be
80
+ relative to the [`docs_dir`] directory.
81
+
82
+ ```yaml
83
+ plugins:
84
+ - include-markdown:
85
+ exclude:
86
+ - LICENSE.md
87
+ - api/**
88
+ ```
89
+
90
+ <!-- mdpo-disable-next-line -->
91
+
92
+ #### `cache`
93
+
94
+ Expiration time in seconds for cached HTTP requests when including from URLs.
95
+
96
+ ```yaml
97
+ plugins:
98
+ - include-markdown:
99
+ cache: 600
100
+ ```
101
+
102
+ In order to use this feature, the dependency [platformdirs] must be installed.
103
+ You can include it in the installation of the plugin adding the `cache` extra:
104
+
105
+ ```txt
106
+ # requirements.txt
107
+ mkdocs-include-markdown-plugin[cache]
108
+ ```
104
109
 
105
110
  ### Reference
106
111
 
@@ -113,7 +118,9 @@ Paths of included files can be either:
113
118
  - Local files:
114
119
  - Absolute paths (starting with a path separator).
115
120
  - Relative from the file that includes them (starting with `./` or `../`).
116
- - Relative from the _docs/_ directory.
121
+ - Relative to the [`docs_dir`] directory. For instance if your `docs_dir` is
122
+ _./docs/_, then `includes/header.md` will match the file
123
+ _./docs/includes/header.md_.
117
124
  - [Bash wildcard globs] matching multiple local files.
118
125
 
119
126
  File paths to include and string arguments can be wrapped by double `"` or
@@ -177,7 +184,7 @@ content to include.
177
184
 
178
185
  ```jinja
179
186
  {%
180
- include-markdown 'docs/includes/header.md'
187
+ include-markdown 'includes/header.md'
181
188
  start='<!--\n\ttable-start\n-->'
182
189
  end='<!--\n\ttable-end\n-->'
183
190
  rewrite-relative-urls=false
@@ -187,7 +194,7 @@ content to include.
187
194
 
188
195
  ```jinja
189
196
  {%
190
- include-markdown "docs/includes/header.md"
197
+ include-markdown "includes/header.md"
191
198
  heading-offset=1
192
199
  %}
193
200
  ```
@@ -268,6 +275,10 @@ Includes the content of a file or a group of files.
268
275
  [giving me the permissions][cibuildwheel-470] to separate this plugin from the
269
276
  documentation of [cibuildwheel][cibuildwheel-repo-link].
270
277
 
278
+ [Bash wildcard globs]: https://facelessuser.github.io/wcmatch/glob/#syntax
279
+
280
+ <!-- mdpo-disable -->
281
+
271
282
  [pypi-link]: https://pypi.org/project/mkdocs-include-markdown-plugin
272
283
  [pypi-version-badge-link]: https://img.shields.io/pypi/v/mkdocs-include-markdown-plugin?logo=pypi&logoColor=white
273
284
  [tests-image]: https://img.shields.io/github/actions/workflow/status/mondeja/mkdocs-include-markdown-plugin/ci.yml?logo=github&label=tests&branch=master
@@ -281,4 +292,4 @@ Includes the content of a file or a group of files.
281
292
  [cibuildwheel-repo-link]: https://github.com/pypa/cibuildwheel
282
293
  [es-readme-link]: https://github.com/mondeja/mkdocs-include-markdown-plugin/blob/master/locale/es/README.md
283
294
  [fr-readme-link]: https://github.com/mondeja/mkdocs-include-markdown-plugin/blob/master/locale/fr/README.md
284
- [Bash wildcard globs]: https://facelessuser.github.io/wcmatch/glob/#syntax
295
+ [`docs_dir`]: https://www.mkdocs.org/user-guide/configuration/#docs_dir
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mkdocs-include-markdown-plugin"
3
- version = "6.0.4"
3
+ version = "6.0.5"
4
4
  description = "Mkdocs Markdown includer plugin."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -103,9 +103,9 @@ targets = [{ file = "pyproject.toml" }]
103
103
  [tool.project-config]
104
104
  cache = "2 days"
105
105
  style = [
106
- "gh://mondeja/project-config-styles@v5.1/base/pre-commit/md2po2md.json5",
107
- "gh://mondeja/project-config-styles@v5.1/python/base.json5",
108
- "gh://mondeja/project-config-styles@v5.1/python/mypy.json5",
106
+ "gh://mondeja/project-config-styles@v5.2.1/base/pre-commit/md2po2md.json5",
107
+ "gh://mondeja/project-config-styles@v5.2.1/python/base.json5",
108
+ "gh://mondeja/project-config-styles@v5.2.1/python/mypy.json5",
109
109
  ]
110
110
 
111
111
  [tool.coverage.run]
@@ -121,6 +121,8 @@ fail_under = 1
121
121
  [tool.ruff]
122
122
  line-length = 80
123
123
  target-version = "py38"
124
+
125
+ [tool.ruff.lint]
124
126
  select = [
125
127
  "W",
126
128
  "B",
@@ -150,19 +152,19 @@ select = [
150
152
  ]
151
153
  ignore = ["G004"]
152
154
 
153
- [tool.ruff.pydocstyle]
155
+ [tool.ruff.lint.pydocstyle]
154
156
  convention = "google"
155
157
 
156
- [tool.ruff.flake8-quotes]
158
+ [tool.ruff.lint.flake8-quotes]
157
159
  inline-quotes = "single"
158
160
  multiline-quotes = "single"
159
161
 
160
- [tool.ruff.flake8-pytest-style]
162
+ [tool.ruff.lint.flake8-pytest-style]
161
163
  fixture-parentheses = false
162
164
  parametrize-values-type = "tuple"
163
165
  parametrize-values-row-type = "tuple"
164
166
 
165
- [tool.ruff.isort]
167
+ [tool.ruff.lint.isort]
166
168
  lines-after-imports = 2
167
169
  combine-as-imports = true
168
170
  force-wrap-aliases = true
@@ -176,7 +178,7 @@ extra-standard-library = [
176
178
  "wsgiref.types"
177
179
  ]
178
180
 
179
- [tool.ruff.per-file-ignores]
181
+ [tool.ruff.lint.per-file-ignores]
180
182
  "tests/**" = [
181
183
  "I002",
182
184
  "D100",
@@ -444,8 +444,8 @@ def get_file_content( # noqa: PLR0913, PLR0915
444
444
  arguments_string,
445
445
  )
446
446
  if offset_match:
447
- offset = offset_match[1]
448
- if offset == '':
447
+ offset_raw_value = offset_match[1]
448
+ if offset_raw_value == '':
449
449
  lineno = lineno_from_content_start(
450
450
  markdown,
451
451
  directive_match_start,
@@ -456,15 +456,15 @@ def get_file_content( # noqa: PLR0913, PLR0915
456
456
  f' {os.path.relpath(page_src_path, docs_dir)}:{lineno}',
457
457
  )
458
458
  try:
459
- offset = int(offset)
459
+ offset = int(offset_raw_value)
460
460
  except ValueError:
461
461
  lineno = lineno_from_content_start(
462
462
  markdown,
463
463
  directive_match_start,
464
464
  )
465
465
  raise PluginError(
466
- f"Invalid 'heading-offset' argument \"{offset}\" in"
467
- " 'include-markdown' directive at "
466
+ f"Invalid 'heading-offset' argument \"{offset_raw_value}\""
467
+ " in 'include-markdown' directive at "
468
468
  f'{os.path.relpath(page_src_path, docs_dir)}:{lineno}',
469
469
  ) from None
470
470
  else:
@@ -556,7 +556,7 @@ def get_file_content( # noqa: PLR0913, PLR0915
556
556
  )
557
557
  )
558
558
 
559
- if offset_match:
559
+ if offset:
560
560
  new_text_to_include = process.increase_headings_offset(
561
561
  new_text_to_include,
562
562
  offset=offset + cumulative_heading_offset,