Markdown-Checker 0.2.3__tar.gz → 0.2.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.
- {markdown_checker-0.2.3/src/markdown_checker.egg-info → markdown_checker-0.2.5}/PKG-INFO +3 -2
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/pyproject.toml +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/__init__.py +9 -25
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/templates/paths/broken.md +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/templates/paths/tracking.md +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/templates/urls/broken.md +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/templates/urls/locale.md +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/templates/urls/tracking.md +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/urls.py +9 -5
- markdown_checker-0.2.5/src/markdown_checker/utils/logging.py +19 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/spinner.py +1 -1
- {markdown_checker-0.2.3 → markdown_checker-0.2.5/src/markdown_checker.egg-info}/PKG-INFO +3 -2
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/SOURCES.txt +1 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/LICENSE +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/README.md +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/setup.cfg +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/markdown_link_base.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/paths.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/py.typed +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/__init__.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/generator_base.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/__init__.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/md_reports/generator.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/__init__.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/extract_links.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/format_output.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/list_files.py +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/dependency_links.txt +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/entry_points.txt +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/requires.txt +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/top_level.txt +0 -0
- {markdown_checker-0.2.3 → markdown_checker-0.2.5}/tests/test_markdown_checker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: markdown-checker
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: A markdown link validation reporting tool.
|
|
5
5
|
Author-email: John Aziz <johnaziz269@gmail.com>
|
|
6
6
|
Maintainer-email: John Aziz <johnaziz269@gmail.com>
|
|
@@ -62,6 +62,7 @@ Requires-Dist: mkdocs; extra == "docs"
|
|
|
62
62
|
Requires-Dist: mkdocs-material; extra == "docs"
|
|
63
63
|
Requires-Dist: mkdocstrings[python]; extra == "docs"
|
|
64
64
|
Requires-Dist: pymdown-extensions; extra == "docs"
|
|
65
|
+
Dynamic: license-file
|
|
65
66
|
|
|
66
67
|
[](https://pypi.org/project/markdown-checker/)
|
|
67
68
|
[](https://markdown-checker.readthedocs.io/en/latest/?badge=latest)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "markdown-checker"
|
|
3
3
|
description= "A markdown link validation reporting tool."
|
|
4
|
-
version = "0.2.
|
|
4
|
+
version = "0.2.5"
|
|
5
5
|
authors = [{ name = "John Aziz", email = "johnaziz269@gmail.com" }]
|
|
6
6
|
maintainers = [{ name = "John Aziz", email = "johnaziz269@gmail.com" }]
|
|
7
7
|
license = {file = "LICENSE"}
|
|
@@ -76,32 +76,16 @@ def detect_issues(
|
|
|
76
76
|
# currently these domains are known to have restrictions on the requests
|
|
77
77
|
skip_domains.extend(
|
|
78
78
|
[
|
|
79
|
-
"
|
|
80
|
-
"help.openai.com",
|
|
79
|
+
"openai.com",
|
|
81
80
|
"beta.openai.com",
|
|
82
|
-
"
|
|
83
|
-
"
|
|
81
|
+
"help.openai.com",
|
|
82
|
+
"platform.openai.com",
|
|
83
|
+
"vscode.dev",
|
|
84
84
|
"en.wikipedia.org",
|
|
85
|
-
"twitter.com",
|
|
86
|
-
"www.linkedin.com",
|
|
87
|
-
"make.powerautomate.com",
|
|
88
|
-
"make.powerapps.com",
|
|
89
85
|
"www.midjourney.com",
|
|
90
|
-
"
|
|
86
|
+
"www.linkedin.com",
|
|
91
87
|
"rodtrent.substack.com",
|
|
92
|
-
"
|
|
93
|
-
"www.nuget.org",
|
|
94
|
-
"www.docker.com",
|
|
95
|
-
"build.nvidia.com",
|
|
96
|
-
"dotnet.microsoft.com",
|
|
97
|
-
"www.gemini.com",
|
|
98
|
-
"upload.wikimedia.org",
|
|
99
|
-
"medium.com",
|
|
100
|
-
"blogs.nvidia.com",
|
|
101
|
-
"blog.gopenai.com",
|
|
102
|
-
"towardsdatascience.com",
|
|
103
|
-
"code.visualstudio.com",
|
|
104
|
-
"opensource.org",
|
|
88
|
+
"github.com",
|
|
105
89
|
]
|
|
106
90
|
)
|
|
107
91
|
with concurrent.futures.ProcessPoolExecutor() as executor:
|
|
@@ -165,7 +149,7 @@ class ListOfStrings(click.Option):
|
|
|
165
149
|
Ref: https://stackoverflow.com/questions/47631914/how-to-pass-several-list-of-arguments-to-click-option
|
|
166
150
|
"""
|
|
167
151
|
|
|
168
|
-
def type_cast_value(self, ctx, value):
|
|
152
|
+
def type_cast_value(self, ctx, value) -> list[str]: # type: ignore
|
|
169
153
|
try:
|
|
170
154
|
if isinstance(value, str):
|
|
171
155
|
# split the string by comma and remove empty strings
|
|
@@ -260,7 +244,7 @@ class ListOfStrings(click.Option):
|
|
|
260
244
|
"-to",
|
|
261
245
|
"--timeout",
|
|
262
246
|
type=click.IntRange(0, 50),
|
|
263
|
-
default=
|
|
247
|
+
default=15,
|
|
264
248
|
help="Timeout in seconds for the requests.",
|
|
265
249
|
required=False,
|
|
266
250
|
)
|
|
@@ -289,7 +273,7 @@ class ListOfStrings(click.Option):
|
|
|
289
273
|
required=False,
|
|
290
274
|
)
|
|
291
275
|
@click.version_option(
|
|
292
|
-
message=(f"%(prog)s, %(version)s\
|
|
276
|
+
message=(f"%(prog)s, %(version)s\nPython ({platform.python_implementation()}) {platform.python_version()}"),
|
|
293
277
|
)
|
|
294
278
|
def main(
|
|
295
279
|
src: tuple[Path, ...],
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
We have automatically detected missing tracking IDs from the following relative paths in your files.
|
|
4
4
|
Review and add tracking to paths to resolve this issue.
|
|
5
5
|
|
|
6
|
-
Check the file paths and associated paths inside them.
|
|
6
|
+
Check the file paths and associated paths inside them.
|
|
@@ -27,7 +27,7 @@ class MarkdownURL(MarkdownLinkBase):
|
|
|
27
27
|
"""
|
|
28
28
|
return self.parsed_url.netloc
|
|
29
29
|
|
|
30
|
-
def is_alive(self, timeout: int =
|
|
30
|
+
def is_alive(self, timeout: int = 15, retries: int = 3) -> bool:
|
|
31
31
|
"""
|
|
32
32
|
Check if the URL is alive
|
|
33
33
|
|
|
@@ -38,14 +38,18 @@ class MarkdownURL(MarkdownLinkBase):
|
|
|
38
38
|
Returns:
|
|
39
39
|
bool: True if the URL is alive, False otherwise
|
|
40
40
|
"""
|
|
41
|
+
headers = {
|
|
42
|
+
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
|
43
|
+
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
|
|
44
|
+
}
|
|
41
45
|
for _ in range(retries):
|
|
42
46
|
try:
|
|
43
|
-
response = requests.head(self.link, timeout=timeout, allow_redirects=True)
|
|
44
|
-
if response.status_code
|
|
47
|
+
response = requests.head(self.link, timeout=timeout, allow_redirects=True, headers=headers)
|
|
48
|
+
if 200 <= response.status_code < 300:
|
|
45
49
|
return True
|
|
46
50
|
else:
|
|
47
|
-
response = requests.get(self.link, timeout=timeout, allow_redirects=True)
|
|
48
|
-
if response.status_code
|
|
51
|
+
response = requests.get(self.link, timeout=timeout, allow_redirects=True, headers=headers)
|
|
52
|
+
if 200 <= response.status_code < 300:
|
|
49
53
|
return True
|
|
50
54
|
except requests.RequestException:
|
|
51
55
|
continue
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Utilities for logging config.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def setup_logging(
|
|
9
|
+
level: int = logging.INFO,
|
|
10
|
+
format: str = "[%(asctime)s] %(levelname)s in %(module)s: %(message)s",
|
|
11
|
+
) -> None:
|
|
12
|
+
"""
|
|
13
|
+
Setup logging
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
level (int): The logging level
|
|
17
|
+
format (str): The logging format
|
|
18
|
+
"""
|
|
19
|
+
logging.basicConfig(level=level, format=format)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: markdown-checker
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: A markdown link validation reporting tool.
|
|
5
5
|
Author-email: John Aziz <johnaziz269@gmail.com>
|
|
6
6
|
Maintainer-email: John Aziz <johnaziz269@gmail.com>
|
|
@@ -62,6 +62,7 @@ Requires-Dist: mkdocs; extra == "docs"
|
|
|
62
62
|
Requires-Dist: mkdocs-material; extra == "docs"
|
|
63
63
|
Requires-Dist: mkdocstrings[python]; extra == "docs"
|
|
64
64
|
Requires-Dist: pymdown-extensions; extra == "docs"
|
|
65
|
+
Dynamic: license-file
|
|
65
66
|
|
|
66
67
|
[](https://pypi.org/project/markdown-checker/)
|
|
67
68
|
[](https://markdown-checker.readthedocs.io/en/latest/?badge=latest)
|
|
@@ -25,5 +25,6 @@ src/markdown_checker/utils/__init__.py
|
|
|
25
25
|
src/markdown_checker/utils/extract_links.py
|
|
26
26
|
src/markdown_checker/utils/format_output.py
|
|
27
27
|
src/markdown_checker/utils/list_files.py
|
|
28
|
+
src/markdown_checker/utils/logging.py
|
|
28
29
|
src/markdown_checker/utils/spinner.py
|
|
29
30
|
tests/test_markdown_checker.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/markdown_link_base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/reports/generator_base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/extract_links.py
RENAMED
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker/utils/format_output.py
RENAMED
|
File without changes
|
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/requires.txt
RENAMED
|
File without changes
|
{markdown_checker-0.2.3 → markdown_checker-0.2.5}/src/markdown_checker.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|