mkdocs-document-dates 2.3.3__tar.gz → 2.3.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.
Files changed (28) hide show
  1. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/PKG-INFO +8 -3
  2. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/README.md +7 -2
  3. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/__init__.py +0 -2
  4. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/plugin.py +7 -4
  5. mkdocs_document_dates-2.3.5/mkdocs_document_dates/styles.py +42 -0
  6. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates.egg-info/PKG-INFO +8 -3
  7. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/setup.py +1 -1
  8. mkdocs_document_dates-2.3.3/mkdocs_document_dates/styles.py +0 -27
  9. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/LICENSE +0 -0
  10. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/hooks/pre-commit +0 -0
  11. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/hooks_installer.py +0 -0
  12. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/__init__.py +0 -0
  13. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/ar.py +0 -0
  14. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/de.py +0 -0
  15. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/en.py +0 -0
  16. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/es.py +0 -0
  17. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/fr.py +0 -0
  18. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/ja.py +0 -0
  19. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/ko.py +0 -0
  20. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/ru.py +0 -0
  21. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/zh.py +0 -0
  22. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates/lang/zh_tw.py +0 -0
  23. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates.egg-info/SOURCES.txt +0 -0
  24. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates.egg-info/dependency_links.txt +0 -0
  25. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates.egg-info/entry_points.txt +0 -0
  26. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates.egg-info/requires.txt +0 -0
  27. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/mkdocs_document_dates.egg-info/top_level.txt +0 -0
  28. {mkdocs_document_dates-2.3.3 → mkdocs_document_dates-2.3.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocs-document-dates
3
- Version: 2.3.3
3
+ Version: 2.3.5
4
4
  Summary: A MkDocs plugin for displaying accurate document creation and last modification dates.
5
5
  Home-page: https://github.com/jaywhj/mkdocs-document-dates
6
6
  Author: Aaron Wang
@@ -37,7 +37,8 @@ A MkDocs plugin for displaying <mark>accurate</mark> document creation and last
37
37
  - Cross-platform support (Windows, macOS, Linux)
38
38
  - Support for multiple time formats (date, datetime, timeago)
39
39
  - Flexible display position (top or bottom)
40
- - Support for document exclusion
40
+ - Support for customizing display styles (CSS)
41
+ - Support for document exclusion mode
41
42
  - Material Design icons, Elegant styling
42
43
  - Lightweight with no extra dependencies
43
44
  - Multi-language support
@@ -90,6 +91,10 @@ modified: 2025-02-23
90
91
  - `created` can be replaced by any of the following fields: `created, date, creation_date, created_at, date_created`
91
92
  - `modified` can be replaced by any of the following fields: `modified, updated, last_modified, updated_at, date_modified, last_update`
92
93
 
94
+ ## Custom Display Styles (CSS)
95
+
96
+ Simply modify the code in the file `docs/assets/document_dates.css`
97
+
93
98
  ## Configuration Options
94
99
 
95
100
  - **type** : Date type (default: `date` )
@@ -107,7 +112,7 @@ modified: 2025-02-23
107
112
  - **exclude** : File exclusion list (default: [] )
108
113
  - Supports glob patterns, e.g., ["private/\*", "temp.md", "drafts/\*.md"]
109
114
 
110
- ## Notes
115
+ ## Tips
111
116
 
112
117
  - It still works when using CI/CD build systems (e.g. Github Actions), used a cache file `.dates_cache.json` to solve this problem:
113
118
  1. First, you can configure the workflow like this (penultimate line) in your .github/workflows/ci.yml:
@@ -14,7 +14,8 @@ A MkDocs plugin for displaying <mark>accurate</mark> document creation and last
14
14
  - Cross-platform support (Windows, macOS, Linux)
15
15
  - Support for multiple time formats (date, datetime, timeago)
16
16
  - Flexible display position (top or bottom)
17
- - Support for document exclusion
17
+ - Support for customizing display styles (CSS)
18
+ - Support for document exclusion mode
18
19
  - Material Design icons, Elegant styling
19
20
  - Lightweight with no extra dependencies
20
21
  - Multi-language support
@@ -67,6 +68,10 @@ modified: 2025-02-23
67
68
  - `created` can be replaced by any of the following fields: `created, date, creation_date, created_at, date_created`
68
69
  - `modified` can be replaced by any of the following fields: `modified, updated, last_modified, updated_at, date_modified, last_update`
69
70
 
71
+ ## Custom Display Styles (CSS)
72
+
73
+ Simply modify the code in the file `docs/assets/document_dates.css`
74
+
70
75
  ## Configuration Options
71
76
 
72
77
  - **type** : Date type (default: `date` )
@@ -84,7 +89,7 @@ modified: 2025-02-23
84
89
  - **exclude** : File exclusion list (default: [] )
85
90
  - Supports glob patterns, e.g., ["private/\*", "temp.md", "drafts/\*.md"]
86
91
 
87
- ## Notes
92
+ ## Tips
88
93
 
89
94
  - It still works when using CI/CD build systems (e.g. Github Actions), used a cache file `.dates_cache.json` to solve this problem:
90
95
  1. First, you can configure the workflow like this (penultimate line) in your .github/workflows/ci.yml:
@@ -1,7 +1,5 @@
1
1
  """MkDocs Document Dates Plugin."""
2
2
 
3
- __version__ = '2.3.3'
4
-
5
3
  from .hooks_installer import install
6
4
 
7
5
  # 在包被导入时自动执行 hooks 安装
@@ -38,10 +38,11 @@ class DocumentDatesPlugin(BasePlugin):
38
38
 
39
39
  # 添加自定义 CSS
40
40
  css_file = Path(config['docs_dir']) / 'assets' / 'document_dates.css'
41
- css_file.parent.mkdir(parents=True, exist_ok=True)
42
- css_file.write_text(self._get_css_content())
41
+ if not css_file.exists():
42
+ css_file.parent.mkdir(parents=True, exist_ok=True)
43
+ css_file.write_text(self._get_css_content())
43
44
  config['extra_css'].append('assets/document_dates.css')
44
-
45
+
45
46
  return config
46
47
 
47
48
  def _get_date_info(self, created, modified):
@@ -50,8 +51,10 @@ class DocumentDatesPlugin(BasePlugin):
50
51
  locale = 'en'
51
52
  t = self.translations[locale]
52
53
 
54
+ position_class = 'document-dates-top' if self.config['position'] == 'top' else 'document-dates-bottom'
55
+
53
56
  return (
54
- f"<div class='document-dates-plugin-wrapper'>"
57
+ f"<div class='document-dates-plugin-wrapper {position_class}'>"
55
58
  f"<div class='document-dates-plugin'>"
56
59
  f"<span title='{t['created_time']}: {created.strftime(self.config['date_format'])}'><span class='material-icons'>add_circle</span>"
57
60
  f"{self._get_formatted_date(created)}</span>"
@@ -0,0 +1,42 @@
1
+
2
+ DOCUMENT_DATES_CSS = """
3
+ .document-dates-plugin {
4
+ color: #8e8e8e;
5
+ font-size: 0.75rem;
6
+ padding: 0.2rem 0;
7
+ opacity: 0.7;
8
+ display: flex;
9
+ gap: 1.5rem;
10
+ align-items: center;
11
+ margin-bottom: 0.3rem;
12
+ }
13
+ .document-dates-plugin span {
14
+ display: inline-flex;
15
+ align-items: center;
16
+ gap: 0.3rem;
17
+ }
18
+ .document-dates-plugin .material-icons {
19
+ font-size: 0.9rem;
20
+ opacity: 0.7;
21
+ }
22
+
23
+
24
+ /* top position style */
25
+ .document-dates-plugin-wrapper.document-dates-top {
26
+ margin-top: -1.2rem;
27
+ padding-bottom: 0.3rem;
28
+ border-bottom: 1px solid rgba(0, 0, 0, 0.07);
29
+ }
30
+ /* bottom position style */
31
+ .document-dates-plugin-wrapper.document-dates-bottom {
32
+ margin: 1rem 0;
33
+ padding-bottom: 0.3rem;
34
+ border-bottom: 1px solid rgba(0, 0, 0, 0.07);
35
+ }
36
+
37
+
38
+ /* Hide the footnote divider immediately following the date information with the CSS adjacent sibling selector */
39
+ .document-dates-plugin-wrapper + .footnote hr {
40
+ display: none;
41
+ }
42
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocs-document-dates
3
- Version: 2.3.3
3
+ Version: 2.3.5
4
4
  Summary: A MkDocs plugin for displaying accurate document creation and last modification dates.
5
5
  Home-page: https://github.com/jaywhj/mkdocs-document-dates
6
6
  Author: Aaron Wang
@@ -37,7 +37,8 @@ A MkDocs plugin for displaying <mark>accurate</mark> document creation and last
37
37
  - Cross-platform support (Windows, macOS, Linux)
38
38
  - Support for multiple time formats (date, datetime, timeago)
39
39
  - Flexible display position (top or bottom)
40
- - Support for document exclusion
40
+ - Support for customizing display styles (CSS)
41
+ - Support for document exclusion mode
41
42
  - Material Design icons, Elegant styling
42
43
  - Lightweight with no extra dependencies
43
44
  - Multi-language support
@@ -90,6 +91,10 @@ modified: 2025-02-23
90
91
  - `created` can be replaced by any of the following fields: `created, date, creation_date, created_at, date_created`
91
92
  - `modified` can be replaced by any of the following fields: `modified, updated, last_modified, updated_at, date_modified, last_update`
92
93
 
94
+ ## Custom Display Styles (CSS)
95
+
96
+ Simply modify the code in the file `docs/assets/document_dates.css`
97
+
93
98
  ## Configuration Options
94
99
 
95
100
  - **type** : Date type (default: `date` )
@@ -107,7 +112,7 @@ modified: 2025-02-23
107
112
  - **exclude** : File exclusion list (default: [] )
108
113
  - Supports glob patterns, e.g., ["private/\*", "temp.md", "drafts/\*.md"]
109
114
 
110
- ## Notes
115
+ ## Tips
111
116
 
112
117
  - It still works when using CI/CD build systems (e.g. Github Actions), used a cache file `.dates_cache.json` to solve this problem:
113
118
  1. First, you can configure the workflow like this (penultimate line) in your .github/workflows/ci.yml:
@@ -7,7 +7,7 @@ try:
7
7
  except FileNotFoundError:
8
8
  long_description = "A MkDocs plugin for displaying accurate document creation and last modification dates."
9
9
 
10
- VERSION = '2.3.3'
10
+ VERSION = '2.3.5'
11
11
 
12
12
  setup(
13
13
  name="mkdocs-document-dates",
@@ -1,27 +0,0 @@
1
-
2
- DOCUMENT_DATES_CSS = """
3
- .document-dates-plugin {
4
- color: #8e8e8e;
5
- font-size: 0.75rem;
6
- padding: 0.2rem 0;
7
- opacity: 0.8;
8
- display: flex;
9
- gap: 1.5rem;
10
- align-items: center;
11
- margin-bottom: 0.3rem;
12
- }
13
- .document-dates-plugin span {
14
- display: inline-flex;
15
- align-items: center;
16
- gap: 0.3rem;
17
- }
18
- .document-dates-plugin .material-icons {
19
- font-size: 0.9rem;
20
- opacity: 0.7;
21
- }
22
- .document-dates-plugin-wrapper {
23
- margin: 0.3rem 0 1rem 0;
24
- border-bottom: 1px solid rgba(0, 0, 0, 0.07);
25
- padding-bottom: 0.5rem;
26
- }
27
- """