mkdocs-document-dates 3.5__tar.gz → 3.5.2__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.5/mkdocs_document_dates.egg-info → mkdocs_document_dates-3.5.2}/PKG-INFO +16 -10
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/README.md +14 -8
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/plugin.py +44 -42
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/config/user.config.css +29 -25
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/config/user.config.js +2 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/core/core.css +133 -72
- mkdocs_document_dates-3.5.2/mkdocs_document_dates/static/core/core.js +393 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/core/default.config.js +1 -0
- mkdocs_document_dates-3.5.2/mkdocs_document_dates/static/core/md5.min.js +2 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/utils.py +0 -1
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2/mkdocs_document_dates.egg-info}/PKG-INFO +16 -10
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates.egg-info/SOURCES.txt +1 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/setup.py +2 -2
- mkdocs_document_dates-3.5/mkdocs_document_dates/static/core/core.js +0 -197
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/LICENSE +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/MANIFEST.in +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/__init__.py +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/cache_manager.py +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/hooks/pre-commit +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/hooks_installer.py +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/core/timeago.full.min.js +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/core/timeago.min.js +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/core/utils.js +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/fonts/material-icons.css +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/fonts/materialicons.woff2 +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/templates/recently_updated.html +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/tippy/backdrop.css +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/tippy/light.css +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/tippy/material.css +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/tippy/popper.min.js +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/tippy/scale.css +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/tippy/shift-away.css +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/tippy/tippy.css +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/tippy/tippy.umd.min.js +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates.egg-info/dependency_links.txt +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates.egg-info/entry_points.txt +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates.egg-info/requires.txt +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates.egg-info/top_level.txt +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/pyproject.toml +0 -0
- {mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/setup.cfg +0 -0
{mkdocs_document_dates-3.5/mkdocs_document_dates.egg-info → mkdocs_document_dates-3.5.2}/PKG-INFO
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mkdocs-document-dates
|
|
3
|
-
Version: 3.5
|
|
4
|
-
Summary: A new generation MkDocs plugin for displaying exact creation
|
|
3
|
+
Version: 3.5.2
|
|
4
|
+
Summary: A new generation MkDocs plugin for displaying exact creation date, last updated date, authors, email of documents
|
|
5
5
|
Home-page: https://github.com/jaywhj/mkdocs-document-dates
|
|
6
6
|
Author: Aaron Wang
|
|
7
7
|
Author-email: aaronwqt@gmail.com
|
|
@@ -44,9 +44,7 @@ A new generation MkDocs plugin for displaying exact **creation date, last update
|
|
|
44
44
|
- [x] Support for manually configuring author's name, link, avatar, email, etc.
|
|
45
45
|
- [x] Flexible display position (top or bottom)
|
|
46
46
|
- [x] Elegant styling (fully customizable)
|
|
47
|
-
- [x] Smart Tooltip Hover Tips
|
|
48
47
|
- [x] Multi-language support, localization support, intelligent recognition of user language, automatic adaptation
|
|
49
|
-
- [x] Cross-platform support (Windows, macOS, Linux)
|
|
50
48
|
- [x] **Ultimate build efficiency**: O(1), no need to set the env var `!ENV` to distinguish runs
|
|
51
49
|
|
|
52
50
|
| Build Speed Comparison: | 100 md: | 1000 md: | Time Complexity: |
|
|
@@ -81,9 +79,6 @@ plugins:
|
|
|
81
79
|
- blog/* # Example: exclude all files in blog folder, including subfolders
|
|
82
80
|
date_format: '%Y-%m-%d' # Date format strings (e.g., %Y-%m-%d, %b %d, %Y)
|
|
83
81
|
time_format: '%H:%M:%S' # Time format strings (valid only if type=datetime)
|
|
84
|
-
show_created: true # Show creation date: true false, default: true
|
|
85
|
-
show_updated: true # Show last updated date: true false, default: true
|
|
86
|
-
show_author: true # Show author: true(avatar) text(text) false(hidden), default: true
|
|
87
82
|
```
|
|
88
83
|
|
|
89
84
|
## Customization Settings
|
|
@@ -93,11 +88,22 @@ In addition to the above basic configuration, the plug-in also provides a wealth
|
|
|
93
88
|
- [Specify Datetime](https://jaywhj.netlify.app/document-dates-en#Specify-Datetime): Introduces the mechanism for obtaining document dates and methods for personalized customization, you can manually specify the creation date and last updated date for each document
|
|
94
89
|
- [Specify Author](https://jaywhj.netlify.app/document-dates-en#Specify-Author): Introduces the mechanism for obtaining document authors and methods for personalized customization, you can manually specify the author information for each document, such as name, link, avatar, email, etc.
|
|
95
90
|
- [Specify Avatar](https://jaywhj.netlify.app/document-dates-en#Specify-Avatar): You can manually specify the avatar for each author, support local file path and URL path
|
|
96
|
-
- [
|
|
97
|
-
- [
|
|
98
|
-
- [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.
|
|
91
|
+
- [Configuration Structure and Style](https://jaywhj.netlify.app/document-dates-en#Structure-and-Style): You can freely configure the plugin's display structure in mkdocs.yml or Front Matter. You can quickly set the plugin styles through preset entrances, such as icons, themes, colors, fonts, animations, dividing line and so on
|
|
92
|
+
- [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.
|
|
99
93
|
- [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 date), this is ideal for sites with a large number of documents, so that readers can quickly see what's new
|
|
94
|
+
- [Add Localization Language](https://jaywhj.netlify.app/document-dates-en#Add-Localization-Language): More localization languages for `timeago` and `tooltip`
|
|
100
95
|
- [Other Tips](https://jaywhj.netlify.app/document-dates-en#Other-Tips): Introducing the Do's of using plugin in Docker
|
|
101
96
|
- [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
|
|
102
97
|
|
|
103
98
|
See the documentation for details: https://jaywhj.netlify.app/document-dates-en
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
<br />
|
|
102
|
+
|
|
103
|
+
## Chat Group
|
|
104
|
+
|
|
105
|
+
**Discord**: https://discord.gg/cvTfge4AUy
|
|
106
|
+
|
|
107
|
+
**Wechat**:
|
|
108
|
+
|
|
109
|
+
<img src="wechat-group.jpg" width="140" />
|
|
@@ -18,9 +18,7 @@ A new generation MkDocs plugin for displaying exact **creation date, last update
|
|
|
18
18
|
- [x] Support for manually configuring author's name, link, avatar, email, etc.
|
|
19
19
|
- [x] Flexible display position (top or bottom)
|
|
20
20
|
- [x] Elegant styling (fully customizable)
|
|
21
|
-
- [x] Smart Tooltip Hover Tips
|
|
22
21
|
- [x] Multi-language support, localization support, intelligent recognition of user language, automatic adaptation
|
|
23
|
-
- [x] Cross-platform support (Windows, macOS, Linux)
|
|
24
22
|
- [x] **Ultimate build efficiency**: O(1), no need to set the env var `!ENV` to distinguish runs
|
|
25
23
|
|
|
26
24
|
| Build Speed Comparison: | 100 md: | 1000 md: | Time Complexity: |
|
|
@@ -55,9 +53,6 @@ plugins:
|
|
|
55
53
|
- blog/* # Example: exclude all files in blog folder, including subfolders
|
|
56
54
|
date_format: '%Y-%m-%d' # Date format strings (e.g., %Y-%m-%d, %b %d, %Y)
|
|
57
55
|
time_format: '%H:%M:%S' # Time format strings (valid only if type=datetime)
|
|
58
|
-
show_created: true # Show creation date: true false, default: true
|
|
59
|
-
show_updated: true # Show last updated date: true false, default: true
|
|
60
|
-
show_author: true # Show author: true(avatar) text(text) false(hidden), default: true
|
|
61
56
|
```
|
|
62
57
|
|
|
63
58
|
## Customization Settings
|
|
@@ -67,11 +62,22 @@ In addition to the above basic configuration, the plug-in also provides a wealth
|
|
|
67
62
|
- [Specify Datetime](https://jaywhj.netlify.app/document-dates-en#Specify-Datetime): Introduces the mechanism for obtaining document dates and methods for personalized customization, you can manually specify the creation date and last updated date for each document
|
|
68
63
|
- [Specify Author](https://jaywhj.netlify.app/document-dates-en#Specify-Author): Introduces the mechanism for obtaining document authors and methods for personalized customization, you can manually specify the author information for each document, such as name, link, avatar, email, etc.
|
|
69
64
|
- [Specify Avatar](https://jaywhj.netlify.app/document-dates-en#Specify-Avatar): You can manually specify the avatar for each author, support local file path and URL path
|
|
70
|
-
- [
|
|
71
|
-
- [
|
|
72
|
-
- [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.
|
|
65
|
+
- [Configuration Structure and Style](https://jaywhj.netlify.app/document-dates-en#Structure-and-Style): You can freely configure the plugin's display structure in mkdocs.yml or Front Matter. You can quickly set the plugin styles through preset entrances, such as icons, themes, colors, fonts, animations, dividing line and so on
|
|
66
|
+
- [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.
|
|
73
67
|
- [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 date), this is ideal for sites with a large number of documents, so that readers can quickly see what's new
|
|
68
|
+
- [Add Localization Language](https://jaywhj.netlify.app/document-dates-en#Add-Localization-Language): More localization languages for `timeago` and `tooltip`
|
|
74
69
|
- [Other Tips](https://jaywhj.netlify.app/document-dates-en#Other-Tips): Introducing the Do's of using plugin in Docker
|
|
75
70
|
- [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
|
|
76
71
|
|
|
77
72
|
See the documentation for details: https://jaywhj.netlify.app/document-dates-en
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
<br />
|
|
76
|
+
|
|
77
|
+
## Chat Group
|
|
78
|
+
|
|
79
|
+
**Discord**: https://discord.gg/cvTfge4AUy
|
|
80
|
+
|
|
81
|
+
**Wechat**:
|
|
82
|
+
|
|
83
|
+
<img src="wechat-group.jpg" width="140" />
|
|
@@ -54,7 +54,6 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
54
54
|
docs_dir_path = Path(config['docs_dir'])
|
|
55
55
|
|
|
56
56
|
# 加载 author 配置
|
|
57
|
-
self._extract_github_username(config.get('repo_url'))
|
|
58
57
|
authors_file = docs_dir_path / 'authors.yml'
|
|
59
58
|
if not authors_file.exists():
|
|
60
59
|
try:
|
|
@@ -133,6 +132,7 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
133
132
|
|
|
134
133
|
# 添加自定义 JS 文件
|
|
135
134
|
config['extra_javascript'].extend([
|
|
135
|
+
'assets/document_dates/core/md5.min.js',
|
|
136
136
|
'assets/document_dates/core/default.config.js',
|
|
137
137
|
'assets/document_dates/user.config.js',
|
|
138
138
|
'assets/document_dates/core/utils.js',
|
|
@@ -158,10 +158,6 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
158
158
|
|
|
159
159
|
# 获取作者信息
|
|
160
160
|
authors = self._get_author_info(rel_path, page, config)
|
|
161
|
-
if authors and len(authors) == 1:
|
|
162
|
-
a = authors[0]
|
|
163
|
-
if not a.avatar and self.github_username:
|
|
164
|
-
a.avatar = f"https://avatars.githubusercontent.com/{self.github_username}"
|
|
165
161
|
|
|
166
162
|
# 在排除前暴露 meta 信息给前端使用
|
|
167
163
|
page.meta['document_dates_created'] = created.isoformat()
|
|
@@ -173,7 +169,7 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
173
169
|
return markdown
|
|
174
170
|
|
|
175
171
|
# 生成日期和作者信息 HTML
|
|
176
|
-
info_html = self._generate_html_info(created, updated, authors)
|
|
172
|
+
info_html = self._generate_html_info(page.meta, created, updated, authors)
|
|
177
173
|
|
|
178
174
|
# 将信息写入 markdown
|
|
179
175
|
return self._insert_date_info(markdown, info_html)
|
|
@@ -225,17 +221,6 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
225
221
|
shutil.copy2(item, target_dir / item.name)
|
|
226
222
|
|
|
227
223
|
|
|
228
|
-
def _extract_github_username(self, url):
|
|
229
|
-
try:
|
|
230
|
-
parsed = urlparse(url)
|
|
231
|
-
if parsed.netloc != 'github.com':
|
|
232
|
-
return
|
|
233
|
-
path_parts = [p for p in parsed.path.split('/') if p]
|
|
234
|
-
if path_parts:
|
|
235
|
-
self.github_username = path_parts[0]
|
|
236
|
-
except Exception as e:
|
|
237
|
-
logger.info(f"Error parsing URL: {e}")
|
|
238
|
-
|
|
239
224
|
def _load_authors_from_yaml(self, file_path: Path):
|
|
240
225
|
if not file_path.exists():
|
|
241
226
|
return
|
|
@@ -378,9 +363,18 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
378
363
|
return date.strftime(f"{self.config['date_format']} {self.config['time_format']}")
|
|
379
364
|
return date.strftime(self.config['date_format'])
|
|
380
365
|
|
|
381
|
-
def _generate_html_info(self, created: datetime, updated: datetime, authors=None):
|
|
366
|
+
def _generate_html_info(self, meta, created: datetime, updated: datetime, authors=None):
|
|
382
367
|
try:
|
|
383
|
-
|
|
368
|
+
show_created = self.config['show_created'] and meta.get('show_created') is not False
|
|
369
|
+
show_updated = self.config['show_updated'] and meta.get('show_updated') is not False
|
|
370
|
+
show_author = self.config['show_author'] and meta.get('show_author') is not False
|
|
371
|
+
|
|
372
|
+
show_dates = show_created or show_updated
|
|
373
|
+
show_plugin = show_dates or show_author
|
|
374
|
+
if not show_plugin:
|
|
375
|
+
return ""
|
|
376
|
+
|
|
377
|
+
# 构建插件骨架 HTML
|
|
384
378
|
html_parts = []
|
|
385
379
|
position_class = 'document-dates-top' if self.config['position'] == 'top' else 'document-dates-bottom'
|
|
386
380
|
html_parts.append(f"<div class='document-dates-plugin-wrapper {position_class}'>")
|
|
@@ -389,19 +383,24 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
389
383
|
def build_time_icon(time_obj: datetime, icon: str):
|
|
390
384
|
formatted = time_obj.strftime(self.config['date_format'])
|
|
391
385
|
return (
|
|
392
|
-
f"<span data-tippy-content data-tippy-raw='{formatted}'>"
|
|
386
|
+
f"<span class='dd-item' data-tippy-content data-tippy-raw='{formatted}'>"
|
|
393
387
|
f"<span class='material-icons' data-icon='{icon}'></span>"
|
|
394
|
-
f"<time datetime='{time_obj.isoformat()}'>"
|
|
395
|
-
f"
|
|
388
|
+
f"<time datetime='{time_obj.isoformat()}'>{self._get_formatted_date(time_obj)}</time>"
|
|
389
|
+
f"</span>"
|
|
396
390
|
)
|
|
397
391
|
|
|
398
|
-
|
|
392
|
+
# 构建日期
|
|
393
|
+
if show_dates:
|
|
394
|
+
html_parts.append("<div class='dd-left'>")
|
|
395
|
+
if show_created:
|
|
399
396
|
html_parts.append(build_time_icon(created, 'doc_created'))
|
|
400
|
-
if
|
|
397
|
+
if show_updated:
|
|
401
398
|
html_parts.append(build_time_icon(updated, 'doc_updated'))
|
|
399
|
+
if show_dates:
|
|
400
|
+
html_parts.append("</div>")
|
|
402
401
|
|
|
403
|
-
#
|
|
404
|
-
if
|
|
402
|
+
# 构建作者
|
|
403
|
+
if show_author and authors:
|
|
405
404
|
def get_author_tooltip(author):
|
|
406
405
|
if author.url:
|
|
407
406
|
return f'<a href="{author.url}" target="_blank">{author.name}</a>'
|
|
@@ -409,32 +408,33 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
409
408
|
return f'<a href="mailto:{author.email}">{author.name}</a>'
|
|
410
409
|
return author.name
|
|
411
410
|
|
|
412
|
-
if
|
|
411
|
+
if show_dates:
|
|
412
|
+
html_parts.append("<div class='dd-right'>")
|
|
413
|
+
else:
|
|
414
|
+
html_parts.append("<div class='dd-right dd-right-start'>")
|
|
415
|
+
icon = 'doc_author' if len(authors) == 1 else 'doc_authors'
|
|
416
|
+
html_parts.append(f"<span class='material-icons' data-icon='{icon}'></span>")
|
|
417
|
+
html_parts.append("<div class='author-group'>")
|
|
418
|
+
show_text = self.config['show_author'] == 'text' or meta.get('show_author') == 'text'
|
|
419
|
+
if show_text:
|
|
413
420
|
# 显示文本模式
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
f"<span data-tippy-content data-tippy-raw='{
|
|
419
|
-
f"<span class='material-icons' data-icon='{icon}'></span>"
|
|
420
|
-
f"{tooltip_text}"
|
|
421
|
-
# f"{author_text}"
|
|
422
|
-
f"</span>"
|
|
423
|
-
)
|
|
421
|
+
for index, author in enumerate(authors):
|
|
422
|
+
if index > 0:
|
|
423
|
+
html_parts.append(", ")
|
|
424
|
+
tooltip = get_author_tooltip(author)
|
|
425
|
+
html_parts.append(f"<span class='text-wrapper' data-tippy-content data-tippy-raw='{ tooltip }'>{ tooltip }</span>")
|
|
424
426
|
else:
|
|
425
427
|
# 显示头像模式(默认)
|
|
426
|
-
icon = 'doc_author' if len(authors) == 1 else 'doc_authors'
|
|
427
|
-
html_parts.append(f"<span class='material-icons' data-icon='{icon}'></span>")
|
|
428
|
-
html_parts.append("<div class='avatar-group'>")
|
|
429
428
|
for author in authors:
|
|
430
429
|
tooltip = get_author_tooltip(author)
|
|
431
430
|
html_parts.append(
|
|
432
431
|
f"<div class='avatar-wrapper' data-name='{author.name}' data-tippy-content data-tippy-raw='{tooltip}'>"
|
|
433
432
|
f"<span class='avatar-text'></span>"
|
|
434
|
-
f"<img class='avatar' src='{author.avatar}'
|
|
433
|
+
f"<img class='avatar' data-src='{author.avatar}' data-email='{author.email}' />"
|
|
435
434
|
f"</div>"
|
|
436
435
|
)
|
|
437
|
-
|
|
436
|
+
html_parts.append("</div>")
|
|
437
|
+
html_parts.append("</div>")
|
|
438
438
|
|
|
439
439
|
html_parts.append("</div></div>")
|
|
440
440
|
return ''.join(html_parts)
|
|
@@ -445,6 +445,8 @@ class DocumentDatesPlugin(BasePlugin):
|
|
|
445
445
|
|
|
446
446
|
|
|
447
447
|
def _insert_date_info(self, markdown: str, date_info: str):
|
|
448
|
+
if not date_info:
|
|
449
|
+
return markdown
|
|
448
450
|
if self.config['position'] == 'top':
|
|
449
451
|
first_line, insert_pos = self._find_markdown_body_start(markdown)
|
|
450
452
|
if first_line.startswith(('# ', '<h1')):
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
/* 1. Plug-in styles
|
|
2
|
-
including
|
|
1
|
+
/* 1. Plug-in wrapper styles
|
|
2
|
+
including divider line, margin, padding, and the hiding of this plugin, etc
|
|
3
3
|
*/
|
|
4
|
+
|
|
5
|
+
/* Remove the divider line: */
|
|
4
6
|
/*
|
|
7
|
+
.document-dates-plugin-wrapper.document-dates-top,
|
|
8
|
+
.document-dates-plugin-wrapper.document-dates-bottom {
|
|
9
|
+
border-bottom: none;
|
|
10
|
+
} */
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/* 2. Plug-in styles
|
|
15
|
+
including icons, fonts, colors, etc
|
|
16
|
+
*/
|
|
17
|
+
/*
|
|
5
18
|
.md-main .document-dates-plugin {
|
|
6
19
|
color: rgba(109, 157, 204, 0.7);
|
|
7
20
|
font-size: 0.75rem;
|
|
@@ -18,7 +31,7 @@
|
|
|
18
31
|
doc_author: person, account_circle
|
|
19
32
|
doc_authors: group, groups */
|
|
20
33
|
|
|
21
|
-
/*
|
|
34
|
+
/*
|
|
22
35
|
.document-dates-plugin .material-icons[data-icon="doc_created"]::before {
|
|
23
36
|
content: "more_time";
|
|
24
37
|
}
|
|
@@ -34,23 +47,28 @@
|
|
|
34
47
|
|
|
35
48
|
|
|
36
49
|
|
|
37
|
-
/*
|
|
38
|
-
|
|
50
|
+
/* 3. Author Avatar styles
|
|
51
|
+
e.g. shape, hover scale, grayscale mode
|
|
39
52
|
*/
|
|
40
|
-
|
|
41
|
-
/* Remove the divider line: */
|
|
42
53
|
/*
|
|
43
|
-
.
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
.avatar-wrapper {
|
|
55
|
+
border-radius: 4px;
|
|
56
|
+
filter: grayscale(0%);
|
|
57
|
+
}
|
|
58
|
+
.avatar-wrapper:hover {
|
|
59
|
+
transform: scale(1.08);
|
|
46
60
|
} */
|
|
47
61
|
|
|
48
62
|
|
|
49
63
|
|
|
50
|
-
/*
|
|
64
|
+
/* 4. Tooltip styles
|
|
51
65
|
including theme, arrow, font, color, background color, etc
|
|
52
66
|
*/
|
|
53
67
|
|
|
68
|
+
/* .tippy-box {
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
} */
|
|
71
|
+
|
|
54
72
|
/* Demo of the custom theme 'sorrel' and 'sublime', you can configure it in user.config.js (optional) */
|
|
55
73
|
/*
|
|
56
74
|
.tippy-box[data-theme~='sorrel'] {
|
|
@@ -68,17 +86,3 @@
|
|
|
68
86
|
.tippy-box[data-theme~='sublime'] > .tippy-arrow::before {
|
|
69
87
|
color: #474747;
|
|
70
88
|
} */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/* 4. Author Avatar styles
|
|
75
|
-
e.g. shape, hover scale, grayscale mode
|
|
76
|
-
*/
|
|
77
|
-
/*
|
|
78
|
-
.avatar-wrapper {
|
|
79
|
-
border-radius: 4px;
|
|
80
|
-
filter: grayscale(0%);
|
|
81
|
-
}
|
|
82
|
-
.avatar-wrapper:hover {
|
|
83
|
-
transform: scale(1.08);
|
|
84
|
-
} */
|
|
@@ -8,6 +8,7 @@ Part 1:
|
|
|
8
8
|
// tooltip_config.theme.light = 'tomato';
|
|
9
9
|
// tooltip_config.placement = 'top';
|
|
10
10
|
// tooltip_config.arrow = false;
|
|
11
|
+
// tooltip_config.zIndex = 2;
|
|
11
12
|
|
|
12
13
|
/* Or, override all configuration items: */
|
|
13
14
|
/*
|
|
@@ -23,6 +24,7 @@ TooltipConfig.setConfig({
|
|
|
23
24
|
interactive: true, // content in Tooltip is interactive
|
|
24
25
|
animation: 'scale', // animation type: scale shift-away
|
|
25
26
|
inertia: true, // animation inertia
|
|
27
|
+
// zIndex: 2, // control the display layer(z-index) of the tooltip element
|
|
26
28
|
// arrow: false, // whether to allow arrows
|
|
27
29
|
// animateFill: true, // determines if the background fill color should be animated
|
|
28
30
|
// delay: [400, null], // delay: [show, hide]: show is 400ms, and hide is null for the default value
|
{mkdocs_document_dates-3.5 → mkdocs_document_dates-3.5.2}/mkdocs_document_dates/static/core/core.css
RENAMED
|
@@ -1,26 +1,39 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
1. Plug-in wrapper styles
|
|
3
|
+
========================================================================== */
|
|
4
|
+
.document-dates-plugin-wrapper.document-dates-top,
|
|
5
|
+
.document-dates-plugin-wrapper.document-dates-bottom {
|
|
6
|
+
margin: 1rem 0;
|
|
7
|
+
border-bottom: 1px solid rgba(142, 142, 142, 0.1);
|
|
8
|
+
}
|
|
9
|
+
.md-main .document-dates-plugin-wrapper.document-dates-top {
|
|
10
|
+
margin: -1rem 0 1rem 0;
|
|
11
|
+
}
|
|
1
12
|
|
|
2
|
-
/*
|
|
3
|
-
|
|
4
|
-
|
|
13
|
+
/* Hide the footnote divider immediately following the date information with the CSS adjacent sibling selector */
|
|
14
|
+
.document-dates-plugin-wrapper + .footnote hr {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/* ==========================================================================
|
|
20
|
+
2. Plug-in Layout & Fonts
|
|
21
|
+
========================================================================== */
|
|
5
22
|
.document-dates-plugin {
|
|
6
23
|
color: #666;
|
|
7
24
|
font-size: 0.9rem;
|
|
8
25
|
display: flex;
|
|
9
26
|
align-items: center;
|
|
10
|
-
|
|
11
|
-
|
|
27
|
+
flex-wrap: nowrap;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
padding: 0.1rem 0;
|
|
30
|
+
margin-bottom: 0.5rem;
|
|
12
31
|
}
|
|
13
32
|
.md-main .document-dates-plugin {
|
|
14
33
|
color: rgba(142, 142, 142, 0.7);
|
|
15
34
|
font-size: 0.75rem;
|
|
16
35
|
}
|
|
17
|
-
|
|
18
|
-
display: inline-flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
}
|
|
21
|
-
.document-dates-plugin > span:not(:first-child) {
|
|
22
|
-
margin-left: 1.5rem;
|
|
23
|
-
}
|
|
36
|
+
|
|
24
37
|
.document-dates-plugin .material-icons {
|
|
25
38
|
font-size: 1rem;
|
|
26
39
|
opacity: 0.85;
|
|
@@ -51,92 +64,93 @@
|
|
|
51
64
|
content: "group";
|
|
52
65
|
}
|
|
53
66
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
.document-dates-plugin-wrapper.document-dates-top,
|
|
60
|
-
.document-dates-plugin-wrapper.document-dates-bottom {
|
|
61
|
-
margin: 1rem 0;
|
|
62
|
-
border-bottom: 1px solid rgba(142, 142, 142, 0.1);
|
|
67
|
+
.dd-left {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
margin-right: 1.4rem;
|
|
63
72
|
}
|
|
64
|
-
.
|
|
65
|
-
|
|
73
|
+
.dd-item {
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
flex-shrink: 0;
|
|
66
78
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.document-dates-plugin-wrapper + .footnote hr {
|
|
70
|
-
display: none;
|
|
79
|
+
.dd-left > .dd-item + .dd-item {
|
|
80
|
+
margin-left: 1.4rem;
|
|
71
81
|
}
|
|
72
82
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
font-size: 12px;
|
|
81
|
-
} */
|
|
82
|
-
|
|
83
|
-
/* Demo of the custom theme 'tomato' (optional) */
|
|
84
|
-
.tippy-box[data-theme~='tomato'] {
|
|
85
|
-
background-color: tomato;
|
|
86
|
-
color: white;
|
|
83
|
+
.dd-right {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: flex-end;
|
|
87
|
+
flex: 1 1 auto;
|
|
88
|
+
min-width: 0;
|
|
89
|
+
overflow: hidden;
|
|
87
90
|
}
|
|
88
|
-
/*
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
+
/* Left-aligned when only dd-right */
|
|
92
|
+
.dd-right.dd-right-start {
|
|
93
|
+
justify-content: flex-start;
|
|
91
94
|
}
|
|
92
|
-
/*
|
|
93
|
-
Recommended Colors:
|
|
94
|
-
tomato: rgb(241, 112, 91);
|
|
95
|
-
mung_bean: rgb(122, 145, 109);
|
|
96
|
-
cloisonné: rgb(15, 89, 164);
|
|
97
|
-
soft_blue: rgb(16, 104, 152);
|
|
98
|
-
*/
|
|
99
95
|
|
|
100
|
-
/*
|
|
101
|
-
.
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
/* JS control toggle */
|
|
97
|
+
.document-dates-plugin.is-wrapped {
|
|
98
|
+
flex-wrap: wrap;
|
|
99
|
+
}
|
|
100
|
+
.document-dates-plugin.is-wrapped .dd-right {
|
|
101
|
+
flex: 0 0 100%;
|
|
102
|
+
justify-content: flex-start;
|
|
103
|
+
margin-top: 10px;
|
|
105
104
|
}
|
|
106
105
|
|
|
107
106
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
/* ==========================================================================
|
|
108
|
+
3. Author Avatar styles
|
|
109
|
+
========================================================================== */
|
|
110
|
+
.author-group {
|
|
111
111
|
display: flex;
|
|
112
112
|
align-items: center;
|
|
113
|
-
flex-wrap:
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
flex-wrap: nowrap;
|
|
114
|
+
|
|
115
|
+
overflow-x: auto;
|
|
116
|
+
overflow-y: hidden;
|
|
117
|
+
|
|
118
|
+
/* Prevent overflow of child elements when scaling */
|
|
119
|
+
padding: 0.15rem 0.15rem 0.15rem 0;
|
|
120
|
+
|
|
121
|
+
margin-right: 10px;
|
|
122
|
+
|
|
123
|
+
/* Hide Firefox, IE scrollbar */
|
|
124
|
+
scrollbar-width: none;
|
|
125
|
+
-ms-overflow-style: none;
|
|
126
|
+
}
|
|
127
|
+
/* Hide Chrome/Safari scrollbar */
|
|
128
|
+
.author-group::-webkit-scrollbar {
|
|
129
|
+
display: none;
|
|
116
130
|
}
|
|
131
|
+
|
|
117
132
|
.avatar-wrapper {
|
|
118
|
-
margin: 0.
|
|
133
|
+
margin-left: 0.3rem;
|
|
119
134
|
position: relative;
|
|
120
|
-
width:
|
|
121
|
-
height:
|
|
135
|
+
width: 32px;
|
|
136
|
+
height: 32px;
|
|
122
137
|
border-radius: 50%;
|
|
123
138
|
overflow: hidden;
|
|
124
139
|
flex-shrink: 0;
|
|
125
|
-
opacity: 0.
|
|
140
|
+
opacity: 0.85;
|
|
126
141
|
filter: grayscale(90%);
|
|
127
142
|
transition: transform 0.2s ease, filter 0.2s ease;
|
|
143
|
+
display: block;
|
|
144
|
+
|
|
145
|
+
/* Fix bug in Safari: rounded corners may blink to show square corners */
|
|
146
|
+
will-change: transform;
|
|
147
|
+
transform: translateZ(0);
|
|
128
148
|
}
|
|
129
149
|
.avatar-wrapper:hover {
|
|
130
150
|
transform: scale(1.08);
|
|
131
151
|
filter: grayscale(0%);
|
|
132
152
|
cursor: pointer;
|
|
133
153
|
}
|
|
134
|
-
.avatar-wrapper img.avatar {
|
|
135
|
-
position: absolute;
|
|
136
|
-
width: 100%;
|
|
137
|
-
height: 100%;
|
|
138
|
-
object-fit: cover;
|
|
139
|
-
}
|
|
140
154
|
.avatar-wrapper .avatar-text {
|
|
141
155
|
position: absolute;
|
|
142
156
|
width: 100%;
|
|
@@ -150,3 +164,50 @@ Recommended Colors:
|
|
|
150
164
|
justify-content: center;
|
|
151
165
|
text-transform: capitalize;
|
|
152
166
|
}
|
|
167
|
+
.avatar-wrapper img.avatar {
|
|
168
|
+
position: absolute;
|
|
169
|
+
width: 100%;
|
|
170
|
+
height: 100%;
|
|
171
|
+
object-fit: cover;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* Show authors in text mode */
|
|
175
|
+
.author-group .text-wrapper {
|
|
176
|
+
display: inline-flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
white-space: nowrap;
|
|
179
|
+
flex-shrink: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
/* ==========================================================================
|
|
184
|
+
4. Tooltip styles, including theme, arrow, font, color, background color, etc
|
|
185
|
+
========================================================================== */
|
|
186
|
+
|
|
187
|
+
/* .tippy-box {
|
|
188
|
+
font-size: 12px;
|
|
189
|
+
} */
|
|
190
|
+
|
|
191
|
+
/* Demo of the custom theme 'tomato' (optional) */
|
|
192
|
+
.tippy-box[data-theme~='tomato'] {
|
|
193
|
+
background-color: tomato;
|
|
194
|
+
color: white;
|
|
195
|
+
}
|
|
196
|
+
/* Customize the arrow corresponding to the theme tomato */
|
|
197
|
+
.tippy-box[data-theme~='tomato'] > .tippy-arrow::before {
|
|
198
|
+
color: tomato;
|
|
199
|
+
}
|
|
200
|
+
/*
|
|
201
|
+
Recommended Colors:
|
|
202
|
+
tomato: rgb(241, 112, 91);
|
|
203
|
+
mung_bean: rgb(122, 145, 109);
|
|
204
|
+
cloisonné: rgb(15, 89, 164);
|
|
205
|
+
soft_blue: rgb(16, 104, 152);
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
/* Customize arrows, resize */
|
|
209
|
+
.tippy-arrow::before {
|
|
210
|
+
-webkit-transform: scale(0.75);
|
|
211
|
+
-ms-transform: scale(0.75);
|
|
212
|
+
transform: scale(0.75);
|
|
213
|
+
}
|