mkdocs-include-markdown-plugin 7.2.2__tar.gz → 7.3.0__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.
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/PKG-INFO +14 -1
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/README.md +13 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/pyproject.toml +1 -1
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/config.py +1 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/event.py +40 -16
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/.gitignore +0 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/LICENSE +0 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/__init__.py +0 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/cache.py +0 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/directive.py +0 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/files_watcher.py +0 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/logger.py +0 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/placeholders.py +0 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/plugin.py +0 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/process.py +0 -0
- {mkdocs_include_markdown_plugin-7.2.2 → mkdocs_include_markdown_plugin-7.3.0}/src/mkdocs_include_markdown_plugin/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mkdocs-include-markdown-plugin
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.3.0
|
|
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,6 +96,7 @@ plugins:
|
|
|
96
96
|
start: <!--start-->
|
|
97
97
|
end: <!--end-->
|
|
98
98
|
recursive: true
|
|
99
|
+
order: alpha-path
|
|
99
100
|
```
|
|
100
101
|
|
|
101
102
|
#### `opening_tag` and `closing_tag`
|
|
@@ -176,6 +177,18 @@ plugins:
|
|
|
176
177
|
include: replace
|
|
177
178
|
```
|
|
178
179
|
|
|
180
|
+
<!-- mdpo-disable-next-line -->
|
|
181
|
+
|
|
182
|
+
#### `include_from_url`
|
|
183
|
+
|
|
184
|
+
Allow including content from URLs.
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
plugins:
|
|
188
|
+
- include-markdown:
|
|
189
|
+
include_from_url: true
|
|
190
|
+
```
|
|
191
|
+
|
|
179
192
|
### Reference
|
|
180
193
|
|
|
181
194
|
This plugin provides two directives, one to include Markdown files and another
|
|
@@ -61,6 +61,7 @@ plugins:
|
|
|
61
61
|
start: <!--start-->
|
|
62
62
|
end: <!--end-->
|
|
63
63
|
recursive: true
|
|
64
|
+
order: alpha-path
|
|
64
65
|
```
|
|
65
66
|
|
|
66
67
|
#### `opening_tag` and `closing_tag`
|
|
@@ -141,6 +142,18 @@ plugins:
|
|
|
141
142
|
include: replace
|
|
142
143
|
```
|
|
143
144
|
|
|
145
|
+
<!-- mdpo-disable-next-line -->
|
|
146
|
+
|
|
147
|
+
#### `include_from_url`
|
|
148
|
+
|
|
149
|
+
Allow including content from URLs.
|
|
150
|
+
|
|
151
|
+
```yaml
|
|
152
|
+
plugins:
|
|
153
|
+
- include-markdown:
|
|
154
|
+
include_from_url: true
|
|
155
|
+
```
|
|
156
|
+
|
|
144
157
|
### Reference
|
|
145
158
|
|
|
146
159
|
This plugin provides two directives, one to include Markdown files and another
|
|
@@ -55,6 +55,7 @@ if TYPE_CHECKING: # pragma: no cover
|
|
|
55
55
|
@dataclass
|
|
56
56
|
class Settings: # noqa: D101
|
|
57
57
|
exclude: list[str] | None
|
|
58
|
+
include_from_url: bool = False
|
|
58
59
|
|
|
59
60
|
|
|
60
61
|
def get_file_content( # noqa: PLR0913, PLR0915
|
|
@@ -169,14 +170,25 @@ def get_file_content( # noqa: PLR0913, PLR0915
|
|
|
169
170
|
order,
|
|
170
171
|
)
|
|
171
172
|
|
|
172
|
-
if is_url
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
173
|
+
if is_url:
|
|
174
|
+
if 'order' in used_arguments: # pragma: no cover
|
|
175
|
+
location = process.file_lineno_message(
|
|
176
|
+
page_src_path, docs_dir, directive_lineno(),
|
|
177
|
+
)
|
|
178
|
+
logger.warning(
|
|
179
|
+
f"Ignoring 'order' argument of 'include' directive"
|
|
180
|
+
f" at {location} because the included path is a URL",
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
if not settings.include_from_url:
|
|
184
|
+
location = process.file_lineno_message(
|
|
185
|
+
page_src_path, docs_dir, directive_lineno(),
|
|
186
|
+
)
|
|
187
|
+
raise PluginError(
|
|
188
|
+
f'Including from URL at {location} is not allowed because'
|
|
189
|
+
' include-markdown is configured with include_from_url set'
|
|
190
|
+
' to false',
|
|
191
|
+
)
|
|
180
192
|
|
|
181
193
|
if not file_paths_to_include:
|
|
182
194
|
location = process.file_lineno_message(
|
|
@@ -414,14 +426,25 @@ def get_file_content( # noqa: PLR0913, PLR0915
|
|
|
414
426
|
order,
|
|
415
427
|
)
|
|
416
428
|
|
|
417
|
-
if is_url
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
429
|
+
if is_url:
|
|
430
|
+
if 'order' in used_arguments: # pragma: no cover
|
|
431
|
+
location = process.file_lineno_message(
|
|
432
|
+
page_src_path, docs_dir, directive_lineno(),
|
|
433
|
+
)
|
|
434
|
+
logger.warning(
|
|
435
|
+
f"Ignoring 'order' argument of 'include-markdown' directive"
|
|
436
|
+
f" at {location} because the included path is a URL",
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
if not settings.include_from_url:
|
|
440
|
+
location = process.file_lineno_message(
|
|
441
|
+
page_src_path, docs_dir, directive_lineno(),
|
|
442
|
+
)
|
|
443
|
+
raise PluginError(
|
|
444
|
+
f'Including from URL at {location} is not allowed because'
|
|
445
|
+
' include-markdown is configured with include_from_url set'
|
|
446
|
+
' to false',
|
|
447
|
+
)
|
|
425
448
|
|
|
426
449
|
if not file_paths_to_include:
|
|
427
450
|
location = process.file_lineno_message(
|
|
@@ -713,6 +736,7 @@ def on_page_markdown(
|
|
|
713
736
|
},
|
|
714
737
|
Settings(
|
|
715
738
|
exclude=config.exclude,
|
|
739
|
+
include_from_url=config.include_from_url,
|
|
716
740
|
),
|
|
717
741
|
files_watcher=plugin._files_watcher,
|
|
718
742
|
http_cache=plugin._cache or http_cache,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|