mkdocs-document-dates 3.4.7__tar.gz → 3.4.8__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_document_dates-3.4.7/mkdocs_document_dates.egg-info → mkdocs_document_dates-3.4.8}/PKG-INFO +3 -3
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/README.md +2 -2
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/cache_manager.py +6 -14
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/plugin.py +63 -51
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/utils.py +0 -10
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8/mkdocs_document_dates.egg-info}/PKG-INFO +3 -3
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/setup.py +1 -1
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/LICENSE +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/MANIFEST.in +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/__init__.py +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/hooks/pre-commit +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/hooks_installer.py +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/config/user.config.css +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/config/user.config.js +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/core/core.css +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/core/core.js +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/core/default.config.js +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/core/timeago.full.min.js +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/core/timeago.min.js +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/core/utils.js +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/fonts/material-icons.css +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/fonts/materialicons.woff2 +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/templates/recently_updated.html +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/tippy/backdrop.css +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/tippy/light.css +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/tippy/material.css +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/tippy/popper.min.js +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/tippy/scale.css +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/tippy/shift-away.css +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/tippy/tippy.css +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/static/tippy/tippy.umd.min.js +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates.egg-info/SOURCES.txt +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates.egg-info/dependency_links.txt +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates.egg-info/entry_points.txt +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates.egg-info/requires.txt +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates.egg-info/top_level.txt +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/pyproject.toml +0 -0
- {mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/setup.cfg +0 -0
{mkdocs_document_dates-3.4.7/mkdocs_document_dates.egg-info → mkdocs_document_dates-3.4.8}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mkdocs-document-dates
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.8
|
|
4
4
|
Summary: A new generation MkDocs plugin for displaying exact creation time, last update time, authors, email of documents
|
|
5
5
|
Home-page: https://github.com/jaywhj/mkdocs-document-dates
|
|
6
6
|
Author: Aaron Wang
|
|
@@ -47,9 +47,9 @@ A new generation MkDocs plugin for displaying exact **creation time, last update
|
|
|
47
47
|
- [x] Smart Tooltip Hover Tips
|
|
48
48
|
- [x] Multi-language support, localization support, intelligent recognition of user language, automatic adaptation
|
|
49
49
|
- [x] Cross-platform support (Windows, macOS, Linux)
|
|
50
|
-
- [x] **Ultimate build efficiency**: O(1), no need to set env
|
|
50
|
+
- [x] **Ultimate build efficiency**: O(1), no need to set the env var `!ENV` to distinguish runs
|
|
51
51
|
|
|
52
|
-
|
|
|
52
|
+
| Build Speed Comparison: | 100 md: | 1000 md: | Time Complexity: |
|
|
53
53
|
| --------------------------- | :-----: | :------: | :----------: |
|
|
54
54
|
| git-revision-date-localized | > 3 s | > 30 s | O(n) |
|
|
55
55
|
| document-dates | < 0.1 s | < 0.15 s | O(1) |
|
|
@@ -21,9 +21,9 @@ A new generation MkDocs plugin for displaying exact **creation time, last update
|
|
|
21
21
|
- [x] Smart Tooltip Hover Tips
|
|
22
22
|
- [x] Multi-language support, localization support, intelligent recognition of user language, automatic adaptation
|
|
23
23
|
- [x] Cross-platform support (Windows, macOS, Linux)
|
|
24
|
-
- [x] **Ultimate build efficiency**: O(1), no need to set env
|
|
24
|
+
- [x] **Ultimate build efficiency**: O(1), no need to set the env var `!ENV` to distinguish runs
|
|
25
25
|
|
|
26
|
-
|
|
|
26
|
+
| Build Speed Comparison: | 100 md: | 1000 md: | Time Complexity: |
|
|
27
27
|
| --------------------------- | :-----: | :------: | :----------: |
|
|
28
28
|
| git-revision-date-localized | > 3 s | > 30 s | O(n) |
|
|
29
29
|
| document-dates | < 0.1 s | < 0.15 s | O(1) |
|
{mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/cache_manager.py
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import subprocess
|
|
3
3
|
from pathlib import Path
|
|
4
|
-
from .utils import
|
|
4
|
+
from .utils import read_jsonl_cache, write_jsonl_cache, get_file_creation_time, get_git_first_commit_time
|
|
5
5
|
|
|
6
6
|
logger = logging.getLogger("mkdocs.plugins.document_dates")
|
|
7
7
|
logger.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, CRITICAL
|
|
@@ -72,29 +72,21 @@ def update_cache():
|
|
|
72
72
|
logger.info(f"No tracked markdown files found in {docs_dir}")
|
|
73
73
|
continue
|
|
74
74
|
|
|
75
|
-
#
|
|
76
|
-
json_cache_file = docs_dir / '.dates_cache.json'
|
|
77
|
-
json_dates_cache = read_json_cache(json_cache_file)
|
|
78
|
-
|
|
79
|
-
# 读取新的JSONL缓存文件(如果存在)
|
|
75
|
+
# 读取 JSONL 缓存
|
|
80
76
|
jsonl_cache_file = docs_dir / '.dates_cache.jsonl'
|
|
81
77
|
jsonl_dates_cache = read_jsonl_cache(jsonl_cache_file)
|
|
82
78
|
|
|
83
79
|
# 根据 git已跟踪的文件来更新
|
|
84
80
|
for rel_path in tracked_files:
|
|
85
81
|
try:
|
|
86
|
-
# 如果文件已在JSONL缓存中,跳过
|
|
82
|
+
# 如果文件已在 JSONL 缓存中,跳过
|
|
87
83
|
if rel_path in jsonl_dates_cache:
|
|
88
84
|
continue
|
|
89
85
|
|
|
90
86
|
full_path = docs_dir / rel_path
|
|
91
|
-
|
|
92
|
-
if rel_path in json_dates_cache:
|
|
93
|
-
jsonl_dates_cache[rel_path] = json_dates_cache[rel_path]
|
|
94
|
-
project_updated = True
|
|
95
|
-
elif full_path.exists():
|
|
87
|
+
if full_path.exists():
|
|
96
88
|
created_time = get_file_creation_time(full_path).astimezone()
|
|
97
|
-
if not jsonl_cache_file.exists()
|
|
89
|
+
if not jsonl_cache_file.exists():
|
|
98
90
|
git_time = get_git_first_commit_time(full_path)
|
|
99
91
|
if git_time:
|
|
100
92
|
created_time = min(created_time, git_time)
|
|
@@ -110,7 +102,7 @@ def update_cache():
|
|
|
110
102
|
if len(jsonl_dates_cache) > len(tracked_files):
|
|
111
103
|
project_updated = True
|
|
112
104
|
|
|
113
|
-
# 如果有更新,写入JSONL缓存文件
|
|
105
|
+
# 如果有更新,写入 JSONL 缓存文件
|
|
114
106
|
if project_updated or not jsonl_cache_file.exists():
|
|
115
107
|
global_updated = write_jsonl_cache(jsonl_cache_file, jsonl_dates_cache, tracked_files)
|
|
116
108
|
except subprocess.CalledProcessError as e:
|
|
@@ -8,6 +8,7 @@ from pathlib import Path
|
|
|
8
8
|
from mkdocs.plugins import BasePlugin
|
|
9
9
|
from mkdocs.config import config_options
|
|
10
10
|
from mkdocs.structure.pages import Page
|
|
11
|
+
from mkdocs.utils import get_relative_url
|
|
11
12
|
from urllib.parse import urlparse
|
|
12
13
|
from .utils import get_file_creation_time, load_git_cache, read_jsonl_cache,is_excluded, get_recently_updated_files
|
|
13
14
|
|
|
@@ -164,31 +165,6 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
164
165
|
|
|
165
166
|
return nav
|
|
166
167
|
|
|
167
|
-
def _render_recently_updated_html(self, docs_dir, template_path, recently_updated_data):
|
|
168
|
-
# 获取自定义模板路径
|
|
169
|
-
if template_path:
|
|
170
|
-
user_full_path = docs_dir / template_path
|
|
171
|
-
|
|
172
|
-
# 选择模板路径
|
|
173
|
-
if template_path and user_full_path.is_file():
|
|
174
|
-
template_dir = user_full_path.parent
|
|
175
|
-
template_file = user_full_path.name
|
|
176
|
-
else:
|
|
177
|
-
# 默认模板路径
|
|
178
|
-
default_template_path = Path(__file__).parent / 'static' / 'templates' / 'recently_updated.html'
|
|
179
|
-
template_dir = default_template_path.parent
|
|
180
|
-
template_file = default_template_path.name
|
|
181
|
-
|
|
182
|
-
# 加载模板
|
|
183
|
-
env = Environment(
|
|
184
|
-
loader=FileSystemLoader(str(template_dir)),
|
|
185
|
-
autoescape=select_autoescape(["html", "xml"])
|
|
186
|
-
)
|
|
187
|
-
template = env.get_template(template_file)
|
|
188
|
-
|
|
189
|
-
# 渲染模板
|
|
190
|
-
return template.render(recent_docs=recently_updated_data)
|
|
191
|
-
|
|
192
168
|
def on_page_markdown(self, markdown, page: Page, config, files):
|
|
193
169
|
# 获取相对路径,src_uri 总是以"/"分隔
|
|
194
170
|
rel_path = getattr(page.file, 'src_uri', page.file.src_path)
|
|
@@ -206,6 +182,10 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
206
182
|
|
|
207
183
|
# 获取作者信息
|
|
208
184
|
authors = self._get_author_info(rel_path, page, config)
|
|
185
|
+
if len(authors) == 1:
|
|
186
|
+
a = authors[0]
|
|
187
|
+
if not a.avatar and self.github_username:
|
|
188
|
+
a.avatar = f"https://avatars.githubusercontent.com/{self.github_username}"
|
|
209
189
|
|
|
210
190
|
# 在排除前暴露 meta 信息给前端使用
|
|
211
191
|
page.meta['document_dates_created'] = created.isoformat()
|
|
@@ -237,6 +217,7 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
237
217
|
if item.is_file():
|
|
238
218
|
shutil.copy2(item, target_dir / item.name)
|
|
239
219
|
|
|
220
|
+
|
|
240
221
|
def _extract_github_username(self, url):
|
|
241
222
|
try:
|
|
242
223
|
parsed = urlparse(url)
|
|
@@ -260,6 +241,32 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
260
241
|
logger.info(f"Error parsing .authors.yml: {e}")
|
|
261
242
|
|
|
262
243
|
|
|
244
|
+
def _render_recently_updated_html(self, docs_dir, template_path, recently_updated_data):
|
|
245
|
+
# 获取自定义模板路径
|
|
246
|
+
if template_path:
|
|
247
|
+
user_full_path = docs_dir / template_path
|
|
248
|
+
|
|
249
|
+
# 选择模板路径
|
|
250
|
+
if template_path and user_full_path.is_file():
|
|
251
|
+
template_dir = user_full_path.parent
|
|
252
|
+
template_file = user_full_path.name
|
|
253
|
+
else:
|
|
254
|
+
# 默认模板路径
|
|
255
|
+
default_template_path = Path(__file__).parent / 'static' / 'templates' / 'recently_updated.html'
|
|
256
|
+
template_dir = default_template_path.parent
|
|
257
|
+
template_file = default_template_path.name
|
|
258
|
+
|
|
259
|
+
# 加载模板
|
|
260
|
+
env = Environment(
|
|
261
|
+
loader=FileSystemLoader(str(template_dir)),
|
|
262
|
+
autoescape=select_autoescape(["html", "xml"])
|
|
263
|
+
)
|
|
264
|
+
template = env.get_template(template_file)
|
|
265
|
+
|
|
266
|
+
# 渲染模板
|
|
267
|
+
return template.render(recent_docs=recently_updated_data)
|
|
268
|
+
|
|
269
|
+
|
|
263
270
|
def _find_meta_date(self, meta, field_names):
|
|
264
271
|
for field in field_names:
|
|
265
272
|
if field in meta:
|
|
@@ -291,41 +298,42 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
291
298
|
if not self.config['show_author']:
|
|
292
299
|
return None
|
|
293
300
|
# 1. meta author
|
|
294
|
-
authors = self._process_meta_author(page.meta)
|
|
301
|
+
authors = self._process_meta_author(page.meta, page.url)
|
|
295
302
|
if authors:
|
|
296
303
|
return authors
|
|
304
|
+
|
|
297
305
|
# 2. git author
|
|
298
306
|
if rel_path in self.dates_cache:
|
|
299
307
|
authors_list = self.dates_cache[rel_path].get('authors')
|
|
300
308
|
if authors_list:
|
|
301
309
|
authors = []
|
|
302
|
-
for
|
|
303
|
-
full_author = self.authors_yml.get(
|
|
310
|
+
for data in authors_list:
|
|
311
|
+
full_author = self.authors_yml.get(data['name'])
|
|
304
312
|
if full_author:
|
|
305
|
-
authors.append(full_author)
|
|
306
|
-
# authors.append(Author(**{**vars(full_author), **dict}))
|
|
313
|
+
authors.append(self._get_repaired_author(full_author, page.url))
|
|
307
314
|
else:
|
|
308
|
-
authors.append(Author(**
|
|
315
|
+
authors.append(Author(**data))
|
|
309
316
|
return authors
|
|
317
|
+
|
|
310
318
|
# 3. site_author 或 PC username
|
|
311
319
|
name = config.get('site_author') or Path.home().name
|
|
312
320
|
full_author = self.authors_yml.get(name)
|
|
313
321
|
if full_author:
|
|
314
|
-
return [full_author]
|
|
315
|
-
# return [Author(**{**vars(full_author), "name": name})]
|
|
322
|
+
return [self._get_repaired_author(full_author, page.url)]
|
|
316
323
|
else:
|
|
317
324
|
return [Author(name=name)]
|
|
318
325
|
|
|
319
|
-
def _process_meta_author(self, meta):
|
|
326
|
+
def _process_meta_author(self, meta, page_url):
|
|
320
327
|
try:
|
|
321
328
|
# 匹配 authors 数组
|
|
322
329
|
author_objs = []
|
|
323
330
|
authors_data = meta.get('authors')
|
|
324
331
|
for key in authors_data or []:
|
|
325
|
-
|
|
326
|
-
if
|
|
327
|
-
|
|
328
|
-
|
|
332
|
+
full_author = self.authors_yml.get(key)
|
|
333
|
+
if full_author:
|
|
334
|
+
author_objs.append(self._get_repaired_author(full_author, page_url))
|
|
335
|
+
else:
|
|
336
|
+
author_objs.append(Author(name=str(key)))
|
|
329
337
|
if author_objs:
|
|
330
338
|
return author_objs
|
|
331
339
|
|
|
@@ -337,14 +345,26 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
337
345
|
name = email.partition('@')[0]
|
|
338
346
|
full_author = self.authors_yml.get(name)
|
|
339
347
|
if full_author:
|
|
340
|
-
return [full_author]
|
|
341
|
-
# return [Author(**{**vars(full_author), "name": name, "email": email or full_author.email})]
|
|
348
|
+
return [self._get_repaired_author(full_author, page_url)]
|
|
342
349
|
else:
|
|
343
350
|
return [Author(name=name, email=email)]
|
|
344
351
|
except Exception as e:
|
|
345
352
|
logger.warning(f"Error processing author meta: {e}")
|
|
346
353
|
return None
|
|
347
354
|
|
|
355
|
+
def _get_repaired_author(self, author: Author, page_url: str) -> Author:
|
|
356
|
+
try:
|
|
357
|
+
if not author.avatar:
|
|
358
|
+
return author
|
|
359
|
+
parsed = urlparse(author.avatar)
|
|
360
|
+
if parsed.scheme or author.avatar.startswith('//'):
|
|
361
|
+
return author
|
|
362
|
+
# 处理本地路径(相对路径 & 绝对路径)
|
|
363
|
+
avatar = get_relative_url(author.avatar.lstrip('/'), page_url or '')
|
|
364
|
+
return Author(**{**vars(author), 'avatar': avatar})
|
|
365
|
+
except Exception:
|
|
366
|
+
return author
|
|
367
|
+
|
|
348
368
|
|
|
349
369
|
def _get_formatted_date(self, date: datetime):
|
|
350
370
|
if self.config['type'] == 'timeago':
|
|
@@ -382,13 +402,6 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
382
402
|
return f'<a href="mailto:{author.email}">{author.name}</a>'
|
|
383
403
|
return author.name
|
|
384
404
|
|
|
385
|
-
def get_avatar_img_url(author):
|
|
386
|
-
if author.avatar:
|
|
387
|
-
return author.avatar
|
|
388
|
-
elif self.github_username and len(authors) == 1:
|
|
389
|
-
return f"https://avatars.githubusercontent.com/{self.github_username}"
|
|
390
|
-
return ""
|
|
391
|
-
|
|
392
405
|
if self.config['show_author'] == 'text':
|
|
393
406
|
# 显示文本模式
|
|
394
407
|
tooltip_text = ', '.join(get_author_tooltip(author) for author in authors)
|
|
@@ -407,11 +420,10 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
407
420
|
html_parts.append("<div class='avatar-group'>")
|
|
408
421
|
for author in authors:
|
|
409
422
|
tooltip = get_author_tooltip(author)
|
|
410
|
-
img_url = get_avatar_img_url(author)
|
|
411
423
|
html_parts.append(
|
|
412
424
|
f"<div class='avatar-wrapper' data-name='{author.name}' data-tippy-content data-tippy-raw='{tooltip}'>"
|
|
413
425
|
f"<span class='avatar-text'></span>"
|
|
414
|
-
f"<img class='avatar' src='{
|
|
426
|
+
f"<img class='avatar' src='{author.avatar}' onerror=\"this.style.display='none'\" />"
|
|
415
427
|
f"</div>"
|
|
416
428
|
)
|
|
417
429
|
html_parts.append("</div>")
|
|
@@ -426,14 +438,14 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
426
438
|
|
|
427
439
|
def _insert_date_info(self, markdown: str, date_info: str):
|
|
428
440
|
if self.config['position'] == 'top':
|
|
429
|
-
first_line, insert_pos = self.
|
|
441
|
+
first_line, insert_pos = self._find_markdown_body_start(markdown)
|
|
430
442
|
if first_line.startswith(('# ', '<h1')):
|
|
431
443
|
return markdown[:insert_pos] + '\n' + date_info + '\n' + markdown[insert_pos:]
|
|
432
444
|
else:
|
|
433
445
|
return f"{date_info}\n{markdown}"
|
|
434
446
|
return f"{markdown}\n\n{date_info}"
|
|
435
447
|
|
|
436
|
-
def
|
|
448
|
+
def _find_markdown_body_start(self, text: str):
|
|
437
449
|
pos = 0
|
|
438
450
|
length = len(text)
|
|
439
451
|
in_comment = False
|
|
@@ -171,16 +171,6 @@ def get_recently_updated_files(docs_dir_path: Path, files: Files, exclude_list:
|
|
|
171
171
|
|
|
172
172
|
return doc_mtime_map, recently_updated_results
|
|
173
173
|
|
|
174
|
-
def read_json_cache(cache_file: Path):
|
|
175
|
-
dates_cache = {}
|
|
176
|
-
if cache_file.exists():
|
|
177
|
-
try:
|
|
178
|
-
with open(cache_file, 'r', encoding='utf-8') as f:
|
|
179
|
-
dates_cache = json.load(f)
|
|
180
|
-
except (IOError, json.JSONDecodeError) as e:
|
|
181
|
-
logger.warning(f"Error reading from '.dates_cache.json': {str(e)}")
|
|
182
|
-
return dates_cache
|
|
183
|
-
|
|
184
174
|
def read_jsonl_cache(jsonl_file: Path):
|
|
185
175
|
dates_cache = {}
|
|
186
176
|
if jsonl_file.exists():
|
{mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8/mkdocs_document_dates.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mkdocs-document-dates
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.8
|
|
4
4
|
Summary: A new generation MkDocs plugin for displaying exact creation time, last update time, authors, email of documents
|
|
5
5
|
Home-page: https://github.com/jaywhj/mkdocs-document-dates
|
|
6
6
|
Author: Aaron Wang
|
|
@@ -47,9 +47,9 @@ A new generation MkDocs plugin for displaying exact **creation time, last update
|
|
|
47
47
|
- [x] Smart Tooltip Hover Tips
|
|
48
48
|
- [x] Multi-language support, localization support, intelligent recognition of user language, automatic adaptation
|
|
49
49
|
- [x] Cross-platform support (Windows, macOS, Linux)
|
|
50
|
-
- [x] **Ultimate build efficiency**: O(1), no need to set env
|
|
50
|
+
- [x] **Ultimate build efficiency**: O(1), no need to set the env var `!ENV` to distinguish runs
|
|
51
51
|
|
|
52
|
-
|
|
|
52
|
+
| Build Speed Comparison: | 100 md: | 1000 md: | Time Complexity: |
|
|
53
53
|
| --------------------------- | :-----: | :------: | :----------: |
|
|
54
54
|
| git-revision-date-localized | > 3 s | > 30 s | O(n) |
|
|
55
55
|
| document-dates | < 0.1 s | < 0.15 s | O(1) |
|
|
File without changes
|
|
File without changes
|
{mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/__init__.py
RENAMED
|
File without changes
|
{mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/hooks/pre-commit
RENAMED
|
File without changes
|
{mkdocs_document_dates-3.4.7 → mkdocs_document_dates-3.4.8}/mkdocs_document_dates/hooks_installer.py
RENAMED
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|