Skip to content

Commit bbce302

Browse files
authored
1 parent 8de7b2d commit bbce302

File tree

123 files changed

+7671
-134
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

+7671
-134
lines changed

.github/BUG-REPORT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Prerequisites
22

33
* [ ] Are you running the latest version of this application?
4-
* [ ] Have you checked the [Frequently Asked Questions](https://github.com/jackdewinter/pymarkdown/blob/main/docs/faq.md) document?
4+
* [ ] Have you checked the [Frequently Asked Questions](https://pymarkdown.readthedocs.io/en/latest/faq) document?
55
* [ ] Have you simplified the bug report to the essential details?
66
* [ ] Do you have a distinct command line to report?
77
* [ ] Can you clearly state the configuration for this bug report?

.github/FEATURE-REQUEST.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Prerequisites
22

33
* [ ] Are you running the latest version of this application?
4-
* [ ] Have you checked the [Frequently Asked Questions](https://github.com/jackdewinter/pymarkdown/blob/main/docs/faq.md) document?
4+
* [ ] Have you checked the [Frequently Asked Questions](https://pymarkdown.readthedocs.io/en/latest/faq) document?
55
* [ ] Did you perform a cursory search of other issues to look for related issues?
66

77
## Feature Request

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ assignees: ''
1010
## Prerequisites
1111

1212
* [ ] Are you running the latest version of this application?
13-
* [ ] Have you checked the [Frequently Asked Questions](https://github.com/jackdewinter/pymarkdown/blob/main/docs/faq.md) document?
13+
* [ ] Have you checked the [Frequently Asked Questions](https://pymarkdown.readthedocs.io/en/latest/faq) document?
1414
* [ ] Have you simplified the bug report to the essential details?
1515
* [ ] Do you have a distinct command line to report?
1616
* [ ] Can you clearly state the configuration for this bug report?

.github/ISSUE_TEMPLATE/feature_request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ assignees: ''
1010
## Prerequisites
1111

1212
* [ ] Are you running the latest version of this application?
13-
* [ ] Have you checked the [Frequently Asked Questions](https://github.com/jackdewinter/pymarkdown/blob/main/docs/faq.md) document?
13+
* [ ] Have you checked the [Frequently Asked Questions](https://pymarkdown.readthedocs.io/en/latest/faq) document?
1414
* [ ] Did you perform a cursory search of other issues to look for related issues?
1515

1616
## Feature Request

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This project required Python 3.8 or later to function.
6565

6666
The PyMarkdown project is released with 46 out-of-the-box rules to check your
6767
Markdown with. Roughly 44 of those rules are our version of the rules provided
68-
by the [Markdown Lint](https://github.com/markdownlint/markdownlint) project.
68+
by the [Markdown Lint](https://github.com/DavidAnson/markdownlint) project.
6969
We purposefully made the decision to implement those rules as they are somewhat
7070
of a standard due to Markdown Lint being a plugin for VSCode.
7171

changelog.md

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
# Change Log
22

3-
## Unversioned - In Main, Not Released
4-
5-
### Added
6-
7-
- [Issue 1075](https://github.com/jackdewinter/pymarkdown/issues/1075)
8-
- Complete redo of advanced extensions documentation.
9-
10-
### Fixed
11-
12-
- None
13-
14-
### Changed
15-
16-
- None
3+
This changelog is kept here for historical purposes. For
4+
the current changelog, goto our
5+
[documentation site](https://pymarkdown.readthedocs.io/en/latest/changelog/).
176

187
## Version 0.9.19 - Date: 2024-04-30
198

clean.cmd

+16
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,22 @@ if defined MY_MYPY (
149149
goto executeMyPy
150150
)
151151

152+
echo {Creating extensions.md summary file...}
153+
pipenv run python newdocs\generate_extensions_file.py
154+
if ERRORLEVEL 1 (
155+
echo.
156+
echo {Creation of extensions.md summary file failed.}
157+
goto error_end
158+
)
159+
160+
echo {Creating rules.md summary file...}
161+
pipenv run python newdocs\generate_rules_file.py
162+
if ERRORLEVEL 1 (
163+
echo.
164+
echo {Creation of rules.md summary file failed.}
165+
goto error_end
166+
)
167+
152168
echo {Executing black formatter on Python code.}
153169
pipenv run black %MY_VERBOSE% .
154170
if ERRORLEVEL 1 (

newdocs/.pymarkdown.yaml

-14
This file was deleted.

newdocs/generate_extensions_file.py

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"""
2+
Quick and dirty script to create the "extensions.md" file from components
3+
of the extensions files themselves.
4+
"""
5+
6+
import os
7+
import shutil
8+
import tempfile
9+
10+
script_path = os.path.dirname(os.path.realpath(__file__))
11+
extensions_path = os.path.join(script_path, "src", "extensions")
12+
extension_files = os.listdir(extensions_path)
13+
extension_files.sort()
14+
15+
with tempfile.NamedTemporaryFile() as temp_output:
16+
temporary_file_name = temp_output.name
17+
with open(temporary_file_name, "wt", encoding="utf-8") as destination_file:
18+
destination_file.write("# Extensions\n")
19+
20+
for next_extension_file in extension_files:
21+
with open(
22+
os.path.join(extensions_path, next_extension_file), "r", encoding="utf-8"
23+
) as readme_file:
24+
file_contents = readme_file.read()
25+
26+
first_prefix = "# "
27+
assert file_contents.startswith(first_prefix)
28+
end_of_first_part = file_contents.index("\n")
29+
extension_title_text = file_contents[len(first_prefix) : end_of_first_part]
30+
31+
second_prefix = "\n## Summary\n"
32+
start_of_second_part = file_contents.index(second_prefix) + len(
33+
second_prefix
34+
)
35+
end_of_second_part = file_contents.index("\n## ", start_of_second_part)
36+
extension_summary_text = file_contents[
37+
start_of_second_part:end_of_second_part
38+
]
39+
destination_file.write(
40+
f"""\n## {extension_title_text}
41+
42+
[Full Documentation](./extensions/{next_extension_file})
43+
44+
<!--- pyml disable-next-line no-duplicate-heading-->
45+
### Summary
46+
{extension_summary_text}"""
47+
)
48+
print(temporary_file_name)
49+
50+
output_path = os.path.join(script_path, "src", "extensions.md")
51+
shutil.copyfile(temporary_file_name, output_path)

newdocs/generate_rules_file.py

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
"""
2+
Quick and dirty script to create the "rules.md" file from components
3+
of the extensions files themselves.
4+
"""
5+
6+
import os
7+
import shutil
8+
import tempfile
9+
10+
script_path = os.path.dirname(os.path.realpath(__file__))
11+
extensions_path = os.path.join(script_path, "src", "plugins")
12+
extension_files = os.listdir(extensions_path)
13+
extension_files.sort()
14+
15+
with tempfile.NamedTemporaryFile() as temp_output:
16+
temporary_file_name = temp_output.name
17+
with open(temporary_file_name, "wt", encoding="utf-8") as destination_file:
18+
destination_file.write("# Rules\n")
19+
20+
for next_extension_file in extension_files:
21+
with open(
22+
os.path.join(extensions_path, next_extension_file), "r", encoding="utf-8"
23+
) as readme_file:
24+
file_contents = readme_file.read()
25+
26+
first_prefix = "# "
27+
assert file_contents.startswith(first_prefix)
28+
dd = file_contents.index("\n")
29+
extension_title_text = file_contents[len(first_prefix) : dd]
30+
31+
end_of_first_part = file_contents.index("\n## Reasoning")
32+
replacement_text = (
33+
file_contents[dd:end_of_first_part]
34+
.replace(
35+
"## Summary",
36+
"<!--- pyml disable-next-line no-duplicate-heading-->\n### Summary",
37+
)
38+
.replace(
39+
"## Deprecation",
40+
"<!--- pyml disable-next-line no-duplicate-heading-->\n### Deprecation",
41+
)
42+
.replace("./rule_", "./plugins/rule_")
43+
)
44+
while replacement_text.startswith("\n"):
45+
replacement_text = replacement_text[1:]
46+
47+
destination_file.write(
48+
f"""\n## {extension_title_text}
49+
50+
[Full Documentation](./plugins/{next_extension_file})
51+
52+
{replacement_text}"""
53+
)
54+
print(temporary_file_name)
55+
56+
output_path = os.path.join(script_path, "src", "rules.md")
57+
shutil.copyfile(temporary_file_name, output_path)
58+
59+
# rule_md033/

newdocs/mkdocs.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,20 @@ nav:
1616
- 'advanced_extensions.md'
1717
- 'advanced_plugins.md'
1818
- 'advanced_pre-commit.md'
19+
- "Extensions & Rules":
20+
- extensions.md
21+
- rules.md
1922
- "Devloper Guide":
2023
- 'api.md'
2124
- 'development.md'
2225
- "Usual Project Stuff":
2326
- 'usual.md'
2427
- 'contribute.md'
25-
- "Changelog" : https://github.com/jackdewinter/pymarkdown/blob/main/changelog.md
26-
- "Frequently Asked Questions": https://github.com/jackdewinter/pymarkdown/blob/main/docs/faq.md
28+
- "Changelog" : changelog.md
29+
- "Frequently Asked Questions": faq.md
30+
not_in_nav: |
31+
/plugins/*
32+
/extensions/*
2733
markdown_extensions:
2834
- toc:
2935
permalink: "#"

newdocs/src/advanced_configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ the contents of:
11061106
}
11071107
```
11081108

1109-
According to the documentation on [Rule md003](https://github.com/jackdewinter/pymarkdown/blob/main/docs/rules/rule_md003.md),
1109+
According to the documentation on [Rule Md003](./plugins/rule_md003.md),
11101110
the id for that rule is `md003` and it has one alias `heading-style-h1`.
11111111
This means that the `plugins.md003` configuration takes
11121112
precedence over the `plugins.heading-style-h1` configuration,

newdocs/src/advanced_extensions.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ the documentation for [rule plugins](./advanced_plugins.md),
152152
as the only difference is the word `extensions`
153153
in the configuration item name instead of the word `plugins`.
154154

155-
## Full List of Extensions
155+
## List of Extensions
156156

157-
- [Front-Matter](./extensions/front-matter.md)
158-
- [Pragmas](./extensions/pragmas.md)
159-
- [Task List Items](./extensions/task-list-items.md)
160-
- [Strikethrough](./extensions/strikethrough.md)
161-
- [Autolinks (Extended)](./extensions/extended-autolinks.md)
162-
- [Disallowed Raw HTML](./extensions/disallowed-raw-html.md)
157+
For a full list of extensions, check out the [extensions list](./extensions.md).

0 commit comments

Comments
 (0)