mkdocs-document-dates 3.4.5__tar.gz → 3.4.6__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 (38) hide show
  1. {mkdocs_document_dates-3.4.5/mkdocs_document_dates.egg-info → mkdocs_document_dates-3.4.6}/PKG-INFO +3 -4
  2. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/README.md +2 -3
  3. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/plugin.py +1 -1
  4. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/core/core.js +6 -4
  5. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/templates/recently_updated.html +2 -2
  6. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/utils.py +4 -4
  7. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6/mkdocs_document_dates.egg-info}/PKG-INFO +3 -4
  8. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/setup.py +1 -1
  9. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/LICENSE +0 -0
  10. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/MANIFEST.in +0 -0
  11. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/__init__.py +0 -0
  12. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/cache_manager.py +0 -0
  13. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/hooks/pre-commit +0 -0
  14. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/hooks_installer.py +0 -0
  15. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/config/user.config.css +0 -0
  16. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/config/user.config.js +0 -0
  17. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/core/core.css +0 -0
  18. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/core/default.config.js +0 -0
  19. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/core/timeago.full.min.js +0 -0
  20. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/core/timeago.min.js +0 -0
  21. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/core/utils.js +0 -0
  22. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/fonts/material-icons.css +0 -0
  23. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/fonts/materialicons.woff2 +0 -0
  24. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/tippy/backdrop.css +0 -0
  25. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/tippy/light.css +0 -0
  26. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/tippy/material.css +0 -0
  27. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/tippy/popper.min.js +0 -0
  28. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/tippy/scale.css +0 -0
  29. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/tippy/shift-away.css +0 -0
  30. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/tippy/tippy.css +0 -0
  31. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates/static/tippy/tippy.umd.min.js +0 -0
  32. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates.egg-info/SOURCES.txt +0 -0
  33. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates.egg-info/dependency_links.txt +0 -0
  34. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates.egg-info/entry_points.txt +0 -0
  35. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates.egg-info/requires.txt +0 -0
  36. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/mkdocs_document_dates.egg-info/top_level.txt +0 -0
  37. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/pyproject.toml +0 -0
  38. {mkdocs_document_dates-3.4.5 → mkdocs_document_dates-3.4.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocs-document-dates
3
- Version: 3.4.5
3
+ Version: 3.4.6
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
@@ -37,13 +37,13 @@ A new generation MkDocs plugin for displaying exact **creation time, last update
37
37
  ## Features
38
38
 
39
39
  - [x] Always displays **exact** meta information of the document and works in any environment (no Git, Git environments, Docker containers, all CI/CD build systems, etc.)
40
+ - [x] Support list display of recently updated documents (in descending order of update time)
40
41
  - [x] Support for manually specifying time and author in `Front Matter`
41
42
  - [x] Support for multiple time formats (date, datetime, timeago)
42
43
  - [x] Support for multiple author modes (avatar, text, hidden)
43
44
  - [x] Flexible display position (top or bottom)
44
45
  - [x] Elegant styling (fully customizable)
45
46
  - [x] Smart Tooltip Hover Tips
46
- - [x] Support list display of recently updated documents
47
47
  - [x] Multi-language support, localization support, intelligent recognition of user language, automatic adaptation
48
48
  - [x] Cross-platform support (Windows, macOS, Linux)
49
49
  - [x] **Ultimate build efficiency**: O(1), no need to set env vars to distinguish runs
@@ -81,7 +81,6 @@ plugins:
81
81
  date_format: '%Y-%m-%d' # Date format strings (e.g., %Y-%m-%d, %b %d, %Y)
82
82
  time_format: '%H:%M:%S' # Time format strings (valid only if type=datetime)
83
83
  show_author: true # Author display mode: true(avatar) text(text) false(hidden)
84
- recently-updated: true # Whether to turn on recently updated data, default: false
85
84
  ```
86
85
 
87
86
  ## Customization Settings
@@ -94,7 +93,7 @@ In addition to the above basic configuration, the plug-in also provides a wealth
94
93
  - [Set Plugin Style](https://jaywhj.netlify.app/document-dates-en#Set-Plugin-Style): Such as icons, themes, colors, fonts, animations, dividing line, etc.
95
94
  - [Add Localization Language](https://jaywhj.netlify.app/document-dates-en#Add-Localization-Language): More localization languages for `timeago` and `tooltip`
96
95
  - [Use Template Variables](https://jaywhj.netlify.app/document-dates-en#Use-Template-Variables): Can be used to optimize `sitemap.xml` for site SEO, can be used to re-customize plug-ins, etc.
97
- - [Add Recently Updated Module](https://jaywhj.netlify.app/document-dates-en#Add-Recently-Updated-Module): Enable list of recently updated documents
96
+ - [Add Recently Updated Module](https://jaywhj.netlify.app/document-dates-en#Add-Recently-Updated-Module): Enable list of recently updated documents (in descending order of update time)
98
97
  - [Other Tips](https://jaywhj.netlify.app/document-dates-en#Other-Tips): Introduction to technical principles, caching mechanisms, and how to use it in Docker
99
98
  - [Development Stories](https://jaywhj.netlify.app/document-dates-en#Development-Stories): Describes the origin of the plug-in, the difficulties and solutions encountered in development, and the principles and directions of product design
100
99
 
@@ -11,13 +11,13 @@ A new generation MkDocs plugin for displaying exact **creation time, last update
11
11
  ## Features
12
12
 
13
13
  - [x] Always displays **exact** meta information of the document and works in any environment (no Git, Git environments, Docker containers, all CI/CD build systems, etc.)
14
+ - [x] Support list display of recently updated documents (in descending order of update time)
14
15
  - [x] Support for manually specifying time and author in `Front Matter`
15
16
  - [x] Support for multiple time formats (date, datetime, timeago)
16
17
  - [x] Support for multiple author modes (avatar, text, hidden)
17
18
  - [x] Flexible display position (top or bottom)
18
19
  - [x] Elegant styling (fully customizable)
19
20
  - [x] Smart Tooltip Hover Tips
20
- - [x] Support list display of recently updated documents
21
21
  - [x] Multi-language support, localization support, intelligent recognition of user language, automatic adaptation
22
22
  - [x] Cross-platform support (Windows, macOS, Linux)
23
23
  - [x] **Ultimate build efficiency**: O(1), no need to set env vars to distinguish runs
@@ -55,7 +55,6 @@ plugins:
55
55
  date_format: '%Y-%m-%d' # Date format strings (e.g., %Y-%m-%d, %b %d, %Y)
56
56
  time_format: '%H:%M:%S' # Time format strings (valid only if type=datetime)
57
57
  show_author: true # Author display mode: true(avatar) text(text) false(hidden)
58
- recently-updated: true # Whether to turn on recently updated data, default: false
59
58
  ```
60
59
 
61
60
  ## Customization Settings
@@ -68,7 +67,7 @@ In addition to the above basic configuration, the plug-in also provides a wealth
68
67
  - [Set Plugin Style](https://jaywhj.netlify.app/document-dates-en#Set-Plugin-Style): Such as icons, themes, colors, fonts, animations, dividing line, etc.
69
68
  - [Add Localization Language](https://jaywhj.netlify.app/document-dates-en#Add-Localization-Language): More localization languages for `timeago` and `tooltip`
70
69
  - [Use Template Variables](https://jaywhj.netlify.app/document-dates-en#Use-Template-Variables): Can be used to optimize `sitemap.xml` for site SEO, can be used to re-customize plug-ins, etc.
71
- - [Add Recently Updated Module](https://jaywhj.netlify.app/document-dates-en#Add-Recently-Updated-Module): Enable list of recently updated documents
70
+ - [Add Recently Updated Module](https://jaywhj.netlify.app/document-dates-en#Add-Recently-Updated-Module): Enable list of recently updated documents (in descending order of update time)
72
71
  - [Other Tips](https://jaywhj.netlify.app/document-dates-en#Other-Tips): Introduction to technical principles, caching mechanisms, and how to use it in Docker
73
72
  - [Development Stories](https://jaywhj.netlify.app/document-dates-en#Development-Stories): Describes the origin of the plug-in, the difficulties and solutions encountered in development, and the principles and directions of product design
74
73
 
@@ -422,7 +422,7 @@ class DocumentDatesPlugin(BasePlugin):
422
422
  html_parts.append(
423
423
  f"<div class='avatar-wrapper' data-name='{author.name}' data-tippy-content data-tippy-raw='{tooltip}'>"
424
424
  f"<span class='avatar-text'></span>"
425
- f"<img class='avatar' src='{img_url}' />"
425
+ f"<img class='avatar' data-src='{img_url}' />"
426
426
  f"</div>"
427
427
  )
428
428
  html_parts.append("</div>")
@@ -1,5 +1,5 @@
1
1
  /*
2
- 1.生成字符头像
2
+ 1.生成头像
3
3
  */
4
4
  function isLatin(name) {
5
5
  return /^[A-Za-z\s]+$/.test(name.trim());
@@ -34,9 +34,11 @@ function generateAvatar() {
34
34
 
35
35
  const imgEl = wrapper.querySelector('img.avatar');
36
36
  if (imgEl) {
37
- const src = (imgEl.getAttribute('src') || '').trim();
38
- if (src) {
39
- imgEl.onerror = () => imgEl.style.display = 'none';
37
+ // 先设置 onerror,再设置 src(设置src时就会立即触发加载)
38
+ imgEl.onerror = () => imgEl.style.display = 'none';
39
+ const dataSrc = (imgEl.getAttribute('data-src') || '').trim();
40
+ if (dataSrc) {
41
+ imgEl.src = dataSrc;
40
42
  } else {
41
43
  imgEl.style.display = 'none';
42
44
  }
@@ -16,9 +16,9 @@
16
16
  .recently-updated-item span {
17
17
  font-size: 0.85em;
18
18
  color: rgba(142, 142, 142, 0.5);
19
- margin-right: 8px;
19
+ margin-right: 5px;
20
20
  flex-shrink: 0;
21
- width: 90px;
21
+ width: 95px;
22
22
  }
23
23
  .recently-updated-item a {
24
24
  overflow: hidden;
@@ -62,9 +62,9 @@ def load_git_cache(docs_dir_path: Path):
62
62
  current_commit = tuple(line.split('|', 2))
63
63
  elif line.endswith('.md') and current_commit:
64
64
  name, email, created = current_commit
65
- # 使用 defaultdict(dict)结构,有序去重,保持作者首次出现的顺序
65
+ # 使用 defaultdict(dict)结构,处理有序与去重
66
66
  # a.巧用 Python 字典的 setdefault 特性来去重(setdefault 为不存在的键提供初始值,不会覆盖已有值)
67
- # b.巧用 Python 3.7+ 字典的插入顺序特性来保留内容插入顺序(Python 3.7+ 字典会保持插入顺序)
67
+ # b.巧用 Python 字典的插入顺序特性来保留内容插入顺序(Python 3.7+ 字典会保持插入顺序)
68
68
  authors_dict[line].setdefault((name, email), None)
69
69
  first_commit.setdefault(line, created)
70
70
 
@@ -102,7 +102,7 @@ def get_file_creation_time(file_path):
102
102
  def get_recently_updated_files(docs_dir_path: Path, files: Files, exclude_list: list, limit: int = 10, recent_enable: bool = False):
103
103
  doc_mtime_map = {}
104
104
  try:
105
- # 1. 获取 git 信息,只记录已跟踪的文件首次出现的信息(最近一次提交时间)
105
+ # 1. 获取 git 信息,只记录已跟踪的文件最近一次的提交信息
106
106
  git_root = Path(subprocess.check_output(
107
107
  ['git', 'rev-parse', '--show-toplevel'],
108
108
  cwd=docs_dir_path, encoding='utf-8'
@@ -123,7 +123,7 @@ def get_recently_updated_files(docs_dir_path: Path, files: Files, exclude_list:
123
123
  line = line.strip()
124
124
  if not line:
125
125
  continue
126
- if '|' in line: # commit header
126
+ if '|' in line:
127
127
  ts = float(line.split('|')[2])
128
128
  elif line.endswith('.md') and line in tracked_files and ts:
129
129
  # 只记录第一次出现的文件,即最近一次提交(setdefault 机制不会覆盖已有值)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocs-document-dates
3
- Version: 3.4.5
3
+ Version: 3.4.6
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
@@ -37,13 +37,13 @@ A new generation MkDocs plugin for displaying exact **creation time, last update
37
37
  ## Features
38
38
 
39
39
  - [x] Always displays **exact** meta information of the document and works in any environment (no Git, Git environments, Docker containers, all CI/CD build systems, etc.)
40
+ - [x] Support list display of recently updated documents (in descending order of update time)
40
41
  - [x] Support for manually specifying time and author in `Front Matter`
41
42
  - [x] Support for multiple time formats (date, datetime, timeago)
42
43
  - [x] Support for multiple author modes (avatar, text, hidden)
43
44
  - [x] Flexible display position (top or bottom)
44
45
  - [x] Elegant styling (fully customizable)
45
46
  - [x] Smart Tooltip Hover Tips
46
- - [x] Support list display of recently updated documents
47
47
  - [x] Multi-language support, localization support, intelligent recognition of user language, automatic adaptation
48
48
  - [x] Cross-platform support (Windows, macOS, Linux)
49
49
  - [x] **Ultimate build efficiency**: O(1), no need to set env vars to distinguish runs
@@ -81,7 +81,6 @@ plugins:
81
81
  date_format: '%Y-%m-%d' # Date format strings (e.g., %Y-%m-%d, %b %d, %Y)
82
82
  time_format: '%H:%M:%S' # Time format strings (valid only if type=datetime)
83
83
  show_author: true # Author display mode: true(avatar) text(text) false(hidden)
84
- recently-updated: true # Whether to turn on recently updated data, default: false
85
84
  ```
86
85
 
87
86
  ## Customization Settings
@@ -94,7 +93,7 @@ In addition to the above basic configuration, the plug-in also provides a wealth
94
93
  - [Set Plugin Style](https://jaywhj.netlify.app/document-dates-en#Set-Plugin-Style): Such as icons, themes, colors, fonts, animations, dividing line, etc.
95
94
  - [Add Localization Language](https://jaywhj.netlify.app/document-dates-en#Add-Localization-Language): More localization languages for `timeago` and `tooltip`
96
95
  - [Use Template Variables](https://jaywhj.netlify.app/document-dates-en#Use-Template-Variables): Can be used to optimize `sitemap.xml` for site SEO, can be used to re-customize plug-ins, etc.
97
- - [Add Recently Updated Module](https://jaywhj.netlify.app/document-dates-en#Add-Recently-Updated-Module): Enable list of recently updated documents
96
+ - [Add Recently Updated Module](https://jaywhj.netlify.app/document-dates-en#Add-Recently-Updated-Module): Enable list of recently updated documents (in descending order of update time)
98
97
  - [Other Tips](https://jaywhj.netlify.app/document-dates-en#Other-Tips): Introduction to technical principles, caching mechanisms, and how to use it in Docker
99
98
  - [Development Stories](https://jaywhj.netlify.app/document-dates-en#Development-Stories): Describes the origin of the plug-in, the difficulties and solutions encountered in development, and the principles and directions of product design
100
99
 
@@ -23,7 +23,7 @@ class CustomInstallCommand(install):
23
23
  install.run(self)
24
24
 
25
25
 
26
- VERSION = '3.4.5'
26
+ VERSION = '3.4.6'
27
27
 
28
28
  setup(
29
29
  name="mkdocs-document-dates",