mkdocs-document-dates 3.0.0__tar.gz → 3.0.1__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.0.0 → mkdocs_document_dates-3.0.1}/PKG-INFO +3 -3
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/README.md +1 -1
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/hooks/pre-commit +33 -10
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/hooks_installer.py +23 -16
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/plugin.py +122 -73
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/static/document-dates.config.css +11 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/static/document-dates.config.js +2 -22
- mkdocs_document_dates-3.0.1/mkdocs_document_dates/static/languages/ar.json +18 -0
- mkdocs_document_dates-3.0.1/mkdocs_document_dates/static/languages/de.json +18 -0
- mkdocs_document_dates-3.0.1/mkdocs_document_dates/static/languages/en.json +18 -0
- mkdocs_document_dates-3.0.1/mkdocs_document_dates/static/languages/es.json +18 -0
- mkdocs_document_dates-3.0.1/mkdocs_document_dates/static/languages/fr.json +18 -0
- mkdocs_document_dates-3.0.1/mkdocs_document_dates/static/languages/ja.json +18 -0
- mkdocs_document_dates-3.0.1/mkdocs_document_dates/static/languages/ko.json +18 -0
- mkdocs_document_dates-3.0.1/mkdocs_document_dates/static/languages/ru.json +18 -0
- mkdocs_document_dates-3.0.1/mkdocs_document_dates/static/languages/zh.json +18 -0
- mkdocs_document_dates-3.0.1/mkdocs_document_dates/static/languages/zh_tw.json +18 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates.egg-info/PKG-INFO +3 -3
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates.egg-info/SOURCES.txt +10 -11
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/setup.py +4 -3
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/__init__.py +0 -22
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/ar.py +0 -19
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/de.py +0 -19
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/en.py +0 -19
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/es.py +0 -19
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/fr.py +0 -19
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/ja.py +0 -19
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/ko.py +0 -19
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/ru.py +0 -19
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/zh.py +0 -19
- mkdocs_document_dates-3.0.0/mkdocs_document_dates/lang/zh_tw.py +0 -19
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/LICENSE +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/__init__.py +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/static/tippy/backdrop.css +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/static/tippy/light.css +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/static/tippy/material.css +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/static/tippy/popper.min.js +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/static/tippy/scale.css +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/static/tippy/shift-away.css +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/static/tippy/tippy.css +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/static/tippy/tippy.umd.min.js +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates.egg-info/dependency_links.txt +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates.egg-info/entry_points.txt +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates.egg-info/requires.txt +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates.egg-info/top_level.txt +0 -0
- {mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/setup.cfg +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mkdocs-document-dates
|
3
|
-
Version: 3.0.
|
4
|
-
Summary: A MkDocs plugin for displaying
|
3
|
+
Version: 3.0.1
|
4
|
+
Summary: A MkDocs plugin for displaying the exact creation date and last modification date of markdown documents.
|
5
5
|
Home-page: https://github.com/jaywhj/mkdocs-document-dates
|
6
6
|
Author: Aaron Wang
|
7
7
|
Classifier: Programming Language :: Python :: 3
|
@@ -27,7 +27,7 @@ English | [简体中文](README_zh.md)
|
|
27
27
|
|
28
28
|
|
29
29
|
|
30
|
-
A MkDocs plugin for displaying the <mark>exact</mark> creation and last modification
|
30
|
+
A MkDocs plugin for displaying the <mark>exact</mark> creation date and last modification date of markdown documents.
|
31
31
|
|
32
32
|
## Features
|
33
33
|
|
@@ -4,7 +4,7 @@ English | [简体中文](README_zh.md)
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
-
A MkDocs plugin for displaying the <mark>exact</mark> creation and last modification
|
7
|
+
A MkDocs plugin for displaying the <mark>exact</mark> creation date and last modification date of markdown documents.
|
8
8
|
|
9
9
|
## Features
|
10
10
|
|
{mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/hooks/pre-commit
RENAMED
@@ -5,9 +5,16 @@ import sys
|
|
5
5
|
import json
|
6
6
|
import platform
|
7
7
|
import subprocess
|
8
|
+
import logging
|
8
9
|
from datetime import datetime
|
9
10
|
from pathlib import Path
|
10
11
|
|
12
|
+
# 配置日志等级 (INFO WARNING ERROR)
|
13
|
+
logging.basicConfig(
|
14
|
+
level=logging.WARNING,
|
15
|
+
format='%(levelname)s - %(message)s'
|
16
|
+
)
|
17
|
+
|
11
18
|
def find_mkdocs_projects():
|
12
19
|
try:
|
13
20
|
git_root = Path(subprocess.check_output(
|
@@ -20,9 +27,14 @@ def find_mkdocs_projects():
|
|
20
27
|
if config_file.name.lower() in ('mkdocs.yml', 'mkdocs.yaml'):
|
21
28
|
projects.append(config_file.parent)
|
22
29
|
|
30
|
+
if not projects:
|
31
|
+
logging.info("No MkDocs projects found in the repository")
|
23
32
|
return projects
|
24
33
|
except subprocess.CalledProcessError as e:
|
25
|
-
|
34
|
+
logging.error(f"Failed to find the Git repository root: {e}")
|
35
|
+
return []
|
36
|
+
except Exception as e:
|
37
|
+
logging.error(f"Unexpected error while searching for MkDocs projects: {e}")
|
26
38
|
return []
|
27
39
|
|
28
40
|
def get_file_dates(file_path):
|
@@ -38,11 +50,14 @@ def get_file_dates(file_path):
|
|
38
50
|
created = datetime.fromtimestamp(stat.st_birthtime)
|
39
51
|
except AttributeError:
|
40
52
|
created = datetime.fromtimestamp(stat.st_ctime)
|
41
|
-
|
53
|
+
logging.warning(f"Birth time not available for {file_path}, using ctime instead")
|
54
|
+
else: # Linux and other systems
|
42
55
|
created = modified
|
56
|
+
logging.info(f"Creation time not supported on {system}, using modification time for {file_path}")
|
43
57
|
|
44
58
|
return created.isoformat(), modified.isoformat()
|
45
|
-
except (OSError, ValueError):
|
59
|
+
except (OSError, ValueError) as e:
|
60
|
+
logging.error(f"Failed to get file dates for {file_path}: {e}")
|
46
61
|
current_time = datetime.now()
|
47
62
|
return current_time.isoformat(), current_time.isoformat()
|
48
63
|
|
@@ -50,12 +65,16 @@ def update_dates_cache():
|
|
50
65
|
for project_dir in find_mkdocs_projects():
|
51
66
|
docs_dir = project_dir / 'docs'
|
52
67
|
if not docs_dir.exists():
|
53
|
-
|
68
|
+
logging.error(f"Document directory does not exist: {docs_dir}")
|
54
69
|
continue
|
55
70
|
|
56
71
|
dates_cache = {}
|
57
72
|
md_files = list(docs_dir.rglob("*.md"))
|
58
73
|
|
74
|
+
if not md_files:
|
75
|
+
logging.info(f"No markdown files found in {docs_dir}")
|
76
|
+
continue
|
77
|
+
|
59
78
|
for md_file in md_files:
|
60
79
|
try:
|
61
80
|
rel_path = str(md_file.relative_to(docs_dir))
|
@@ -65,24 +84,28 @@ def update_dates_cache():
|
|
65
84
|
"modified": modified
|
66
85
|
}
|
67
86
|
except Exception as e:
|
68
|
-
|
87
|
+
logging.error(f"Error processing file {md_file}: {e}")
|
69
88
|
|
70
89
|
if not dates_cache:
|
90
|
+
logging.warning(f"No valid dates cache generated for {project_dir}")
|
71
91
|
continue
|
72
92
|
|
73
93
|
cache_file = docs_dir / '.dates_cache.json'
|
74
94
|
try:
|
75
|
-
with open(cache_file, "w") as f:
|
95
|
+
with open(cache_file, "w", encoding='utf-8') as f:
|
76
96
|
json.dump(dates_cache, f, indent=2, ensure_ascii=False)
|
77
97
|
subprocess.run(["git", "add", str(cache_file)], check=True)
|
78
|
-
|
79
|
-
except
|
80
|
-
|
98
|
+
logging.info(f"Successfully updated cache file: {cache_file}")
|
99
|
+
except (IOError, json.JSONDecodeError) as e:
|
100
|
+
logging.error(f"Failed to write cache file {cache_file}: {e}")
|
101
|
+
raise
|
102
|
+
except subprocess.CalledProcessError as e:
|
103
|
+
logging.error(f"Failed to add cache file to git: {e}")
|
81
104
|
raise
|
82
105
|
|
83
106
|
if __name__ == "__main__":
|
84
107
|
try:
|
85
108
|
update_dates_cache()
|
86
109
|
except Exception as e:
|
87
|
-
|
110
|
+
logging.error(f"Hook execution failed: {e}")
|
88
111
|
sys.exit(1)
|
{mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/hooks_installer.py
RENAMED
@@ -1,10 +1,17 @@
|
|
1
1
|
import os
|
2
2
|
import sys
|
3
3
|
import shutil
|
4
|
+
import logging
|
4
5
|
import subprocess
|
5
6
|
from pathlib import Path
|
6
7
|
import platform
|
7
8
|
|
9
|
+
# 配置日志等级 (INFO WARNING ERROR)
|
10
|
+
logging.basicConfig(
|
11
|
+
level=logging.WARNING,
|
12
|
+
format='%(levelname)s: %(message)s'
|
13
|
+
)
|
14
|
+
|
8
15
|
def get_config_dir():
|
9
16
|
if platform.system().lower().startswith('win'):
|
10
17
|
return Path(os.getenv('APPDATA', str(Path.home() / 'AppData' / 'Roaming')))
|
@@ -17,7 +24,7 @@ def install():
|
|
17
24
|
try:
|
18
25
|
subprocess.run(['git', '--version'], check=True, capture_output=True, encoding='utf-8')
|
19
26
|
except (subprocess.CalledProcessError, FileNotFoundError):
|
20
|
-
|
27
|
+
logging.warning("Git not detected, skip hooks installation")
|
21
28
|
return False
|
22
29
|
|
23
30
|
# 准备配置目录
|
@@ -25,27 +32,23 @@ def install():
|
|
25
32
|
try:
|
26
33
|
config_dir.mkdir(parents=True, exist_ok=True)
|
27
34
|
except PermissionError:
|
28
|
-
|
35
|
+
logging.error(f"No permission to create directory: {config_dir}")
|
29
36
|
return False
|
30
37
|
except Exception as e:
|
31
|
-
|
38
|
+
logging.error(f"Failed to create directory {config_dir}: {str(e)}")
|
32
39
|
return False
|
33
40
|
|
34
41
|
hook_path = config_dir / 'pre-commit'
|
35
|
-
|
36
|
-
# 复制 hook 文件到配置目录
|
37
42
|
source_hook = Path(__file__).parent / 'hooks' / 'pre-commit'
|
38
|
-
if not source_hook.exists():
|
39
|
-
print(f"Error: Source hook file does not exist: {source_hook}")
|
40
|
-
return False
|
41
43
|
|
44
|
+
# 复制 hook 文件到配置目录
|
42
45
|
try:
|
43
46
|
shutil.copy2(source_hook, hook_path)
|
44
47
|
except PermissionError:
|
45
|
-
|
48
|
+
logging.error(f"No permission to copy file to: {hook_path}")
|
46
49
|
return False
|
47
50
|
except Exception as e:
|
48
|
-
|
51
|
+
logging.error(f"Failed to copy file to {hook_path}: {str(e)}")
|
49
52
|
return False
|
50
53
|
|
51
54
|
# 设置文件权限
|
@@ -53,20 +56,24 @@ def install():
|
|
53
56
|
os.chmod(config_dir, 0o755)
|
54
57
|
os.chmod(hook_path, 0o755)
|
55
58
|
except OSError as e:
|
56
|
-
|
59
|
+
logging.warning(f"Failed to set file permissions: {str(e)}")
|
57
60
|
|
58
61
|
# 配置全局 git hooks 路径
|
59
62
|
try:
|
60
|
-
subprocess.run(
|
61
|
-
|
62
|
-
|
63
|
+
subprocess.run(
|
64
|
+
['git', 'config', '--global', 'core.hooksPath', str(config_dir)],
|
65
|
+
check=True,
|
66
|
+
capture_output=True,
|
67
|
+
encoding='utf-8'
|
68
|
+
)
|
69
|
+
logging.info(f"Git hooks successfully installed in: {config_dir}")
|
63
70
|
return True
|
64
71
|
except subprocess.CalledProcessError as e:
|
65
|
-
|
72
|
+
logging.error(f"Failed to set git hooks path: {str(e)}")
|
66
73
|
return False
|
67
74
|
|
68
75
|
except Exception as e:
|
69
|
-
|
76
|
+
logging.error(f"Unexpected error during hooks installation: {str(e)}")
|
70
77
|
return False
|
71
78
|
|
72
79
|
if __name__ == '__main__':
|
@@ -2,11 +2,18 @@ import os
|
|
2
2
|
import json
|
3
3
|
import shutil
|
4
4
|
import platform
|
5
|
+
import logging
|
5
6
|
from datetime import datetime
|
6
7
|
from pathlib import Path
|
7
8
|
from mkdocs.plugins import BasePlugin
|
8
9
|
from mkdocs.config import config_options
|
9
|
-
|
10
|
+
|
11
|
+
# 配置日志等级 (INFO WARNING ERROR)
|
12
|
+
logging.basicConfig(
|
13
|
+
level=logging.WARNING,
|
14
|
+
format='%(levelname)s: %(message)s'
|
15
|
+
)
|
16
|
+
|
10
17
|
|
11
18
|
class DocumentDatesPlugin(BasePlugin):
|
12
19
|
config_scheme = (
|
@@ -22,9 +29,12 @@ class DocumentDatesPlugin(BasePlugin):
|
|
22
29
|
|
23
30
|
def __init__(self):
|
24
31
|
super().__init__()
|
25
|
-
self.translations =
|
32
|
+
self.translations = {}
|
26
33
|
|
27
34
|
def on_config(self, config):
|
35
|
+
# 加载 json 语言文件
|
36
|
+
self.translations = self._load_translations(config['docs_dir'])
|
37
|
+
|
28
38
|
if 'extra_css' not in config:
|
29
39
|
config['extra_css'] = []
|
30
40
|
|
@@ -33,18 +43,22 @@ class DocumentDatesPlugin(BasePlugin):
|
|
33
43
|
if material_icons_url not in config['extra_css']:
|
34
44
|
config['extra_css'].append(material_icons_url)
|
35
45
|
|
36
|
-
|
37
|
-
# 加载 static 目录下的所有资源
|
46
|
+
# 复制 css 和 js 资源文件
|
38
47
|
source_dir = Path(__file__).parent / 'static'
|
39
48
|
dest_dir = Path(config['docs_dir']) / 'assets/document_dates'
|
40
49
|
dest_dir.mkdir(parents=True, exist_ok=True)
|
41
50
|
|
42
|
-
# 复制 static 目录到 document_dates 目录,对于配置文件(document-dates.config.css 和 document-dates.config.js),只在目标不存在时才复制
|
43
51
|
for item in source_dir.glob('**/*'):
|
44
52
|
if item.is_file():
|
45
53
|
relative_path = item.relative_to(source_dir)
|
46
54
|
dest_path = dest_dir / relative_path
|
47
55
|
dest_path.parent.mkdir(parents=True, exist_ok=True)
|
56
|
+
|
57
|
+
# 跳过 languages 目录下的文件
|
58
|
+
if 'languages' in str(relative_path):
|
59
|
+
continue
|
60
|
+
|
61
|
+
# 对于配置文件只在目标不存在时才复制,其他文件则直接复制
|
48
62
|
if not dest_path.exists() or item.name not in ['document-dates.config.css', 'document-dates.config.js']:
|
49
63
|
shutil.copy2(item, dest_path)
|
50
64
|
|
@@ -83,40 +97,6 @@ class DocumentDatesPlugin(BasePlugin):
|
|
83
97
|
|
84
98
|
return config
|
85
99
|
|
86
|
-
def _get_date_info(self, created, modified):
|
87
|
-
locale = self.config['locale']
|
88
|
-
if locale not in self.translations:
|
89
|
-
locale = 'en'
|
90
|
-
t = self.translations[locale]
|
91
|
-
|
92
|
-
position_class = 'document-dates-top' if self.config['position'] == 'top' else 'document-dates-bottom'
|
93
|
-
|
94
|
-
return (
|
95
|
-
f"<div class='document-dates-plugin-wrapper {position_class}'>"
|
96
|
-
f"<div class='document-dates-plugin'>"
|
97
|
-
f"<span data-tippy-content='{t['created_time']}: {created.strftime(self.config['date_format'])}'>"
|
98
|
-
f"<span class='material-icons' data-icon='doc_created'>add_circle</span>"
|
99
|
-
f"{self._get_formatted_date(created)}</span>"
|
100
|
-
f"<span data-tippy-content='{t['modified_time']}: {modified.strftime(self.config['date_format'])}'>"
|
101
|
-
f"<span class='material-icons' data-icon='doc_modified'>update</span>"
|
102
|
-
f"{self._get_formatted_date(modified)}</span>"
|
103
|
-
f"</div>"
|
104
|
-
f"</div>"
|
105
|
-
)
|
106
|
-
|
107
|
-
def _insert_date_info(self, markdown, date_info):
|
108
|
-
if not markdown.strip():
|
109
|
-
return markdown
|
110
|
-
|
111
|
-
if self.config['position'] == 'top':
|
112
|
-
lines = markdown.splitlines()
|
113
|
-
for i, line in enumerate(lines):
|
114
|
-
if line.startswith('#'):
|
115
|
-
lines.insert(i + 1, date_info)
|
116
|
-
return '\n'.join(lines)
|
117
|
-
return f"{date_info}\n{markdown}"
|
118
|
-
return f"{markdown}\n\n{date_info}"
|
119
|
-
|
120
100
|
def on_page_markdown(self, markdown, page, config, files):
|
121
101
|
file_path = Path(page.file.abs_src_path)
|
122
102
|
|
@@ -135,6 +115,43 @@ class DocumentDatesPlugin(BasePlugin):
|
|
135
115
|
# 将日期信息写入 markdown
|
136
116
|
return self._insert_date_info(markdown, date_info)
|
137
117
|
|
118
|
+
|
119
|
+
def _get_translation_dirs(self, docs_dir):
|
120
|
+
# 内置语言文件目录
|
121
|
+
builtin_dir = Path(__file__).parent / 'static' / 'languages'
|
122
|
+
# 用户自定义语言文件目录
|
123
|
+
custom_dir = Path(docs_dir) / 'assets' / 'document_dates' / 'languages'
|
124
|
+
|
125
|
+
# 复制 en.json 文件到用户自定义语言文件目录作为参考范例
|
126
|
+
custom_en_json = custom_dir / 'en.json'
|
127
|
+
if not custom_en_json.exists():
|
128
|
+
custom_dir.mkdir(parents=True, exist_ok=True)
|
129
|
+
en_json = builtin_dir / 'en.json'
|
130
|
+
shutil.copy2(en_json, custom_en_json)
|
131
|
+
|
132
|
+
return [builtin_dir, custom_dir]
|
133
|
+
|
134
|
+
def _load_translations(self, docs_dir=None):
|
135
|
+
translations = {}
|
136
|
+
|
137
|
+
for trans_dir in self._get_translation_dirs(docs_dir):
|
138
|
+
if not trans_dir.exists():
|
139
|
+
continue
|
140
|
+
|
141
|
+
for lang_file in trans_dir.glob('*.json'):
|
142
|
+
try:
|
143
|
+
with lang_file.open('r', encoding='utf-8') as f:
|
144
|
+
lang_data = json.load(f)
|
145
|
+
# 自定义语言会覆盖内置语言
|
146
|
+
translations[lang_file.stem] = lang_data
|
147
|
+
except json.JSONDecodeError as e:
|
148
|
+
logging.error(f"Invalid JSON format in language file {lang_file}: {str(e)}")
|
149
|
+
except Exception as e:
|
150
|
+
logging.error(f"Error loading language file {lang_file}: {str(e)}")
|
151
|
+
|
152
|
+
return translations
|
153
|
+
|
154
|
+
|
138
155
|
def _is_excluded(self, file_path: Path, docs_dir: Path) -> bool:
|
139
156
|
for pattern in self.config['exclude']:
|
140
157
|
if self._matches_exclude_pattern(file_path, docs_dir, pattern):
|
@@ -167,29 +184,6 @@ class DocumentDatesPlugin(BasePlugin):
|
|
167
184
|
except ValueError:
|
168
185
|
return False
|
169
186
|
|
170
|
-
def _find_meta_date(self, meta: dict, field_names: list, default_date: datetime) -> datetime:
|
171
|
-
"""从meta中查找第一个匹配的日期字段"""
|
172
|
-
for field in field_names:
|
173
|
-
if field in meta:
|
174
|
-
result = self._parse_meta_date(meta[field], default_date)
|
175
|
-
if result != default_date: # 找到有效日期
|
176
|
-
return result
|
177
|
-
return default_date
|
178
|
-
|
179
|
-
def _process_meta_dates(self, meta: dict, created: datetime, modified: datetime) -> tuple[datetime, datetime]:
|
180
|
-
"""处理meta中的日期字段,支持多种字段名"""
|
181
|
-
result_created = self._find_meta_date(meta, self.config['created_field_names'], created)
|
182
|
-
result_modified = self._find_meta_date(meta, self.config['modified_field_names'], modified)
|
183
|
-
return result_created, result_modified
|
184
|
-
|
185
|
-
def _parse_meta_date(self, date_str: str | None, default_date: datetime) -> datetime:
|
186
|
-
if not date_str:
|
187
|
-
return default_date
|
188
|
-
|
189
|
-
try:
|
190
|
-
return datetime.fromisoformat(str(date_str).strip("'\""))
|
191
|
-
except (ValueError, TypeError):
|
192
|
-
return default_date
|
193
187
|
|
194
188
|
def _get_file_dates(self, file_path, config):
|
195
189
|
try:
|
@@ -223,22 +217,42 @@ class DocumentDatesPlugin(BasePlugin):
|
|
223
217
|
created = modified
|
224
218
|
|
225
219
|
return created, modified
|
226
|
-
|
220
|
+
|
227
221
|
except (OSError, ValueError, json.JSONDecodeError) as e:
|
228
222
|
current_time = datetime.now()
|
229
223
|
return current_time, current_time
|
230
224
|
|
231
|
-
|
225
|
+
|
226
|
+
def _parse_meta_date(self, date_str: str | None, default_date: datetime) -> datetime:
|
227
|
+
if not date_str:
|
228
|
+
return default_date
|
229
|
+
|
230
|
+
try:
|
231
|
+
return datetime.fromisoformat(str(date_str).strip("'\""))
|
232
|
+
except (ValueError, TypeError):
|
233
|
+
return default_date
|
234
|
+
|
235
|
+
def _find_meta_date(self, meta: dict, field_names: list, default_date: datetime) -> datetime:
|
236
|
+
"""从meta中查找第一个匹配的日期字段"""
|
237
|
+
for field in field_names:
|
238
|
+
if field in meta:
|
239
|
+
result = self._parse_meta_date(meta[field], default_date)
|
240
|
+
if result != default_date:
|
241
|
+
return result
|
242
|
+
return default_date
|
243
|
+
|
244
|
+
def _process_meta_dates(self, meta: dict, created: datetime, modified: datetime) -> tuple[datetime, datetime]:
|
245
|
+
"""处理meta中的日期字段, 支持多种字段名"""
|
246
|
+
result_created = self._find_meta_date(meta, self.config['created_field_names'], created)
|
247
|
+
result_modified = self._find_meta_date(meta, self.config['modified_field_names'], modified)
|
248
|
+
return result_created, result_modified
|
249
|
+
|
250
|
+
|
251
|
+
def _get_timeago(self, date, t):
|
232
252
|
now = datetime.now()
|
233
253
|
diff = now - date
|
234
254
|
seconds = diff.total_seconds()
|
235
255
|
|
236
|
-
# 获取翻译字典
|
237
|
-
locale = self.config['locale']
|
238
|
-
if locale not in self.translations:
|
239
|
-
locale = 'en'
|
240
|
-
t = self.translations[locale]
|
241
|
-
|
242
256
|
# 时间间隔判断
|
243
257
|
if seconds < 10:
|
244
258
|
return t['just_now']
|
@@ -269,9 +283,44 @@ class DocumentDatesPlugin(BasePlugin):
|
|
269
283
|
else:
|
270
284
|
return t['years_ago'].format(int(seconds / 31536000))
|
271
285
|
|
272
|
-
def _get_formatted_date(self, date):
|
286
|
+
def _get_formatted_date(self, date, translations):
|
273
287
|
if self.config['type'] == 'timeago':
|
274
|
-
return self._get_timeago(date)
|
288
|
+
return self._get_timeago(date, translations)
|
275
289
|
elif self.config['type'] == 'datetime':
|
276
290
|
return date.strftime(f"{self.config['date_format']} {self.config['time_format']}")
|
277
|
-
return date.strftime(self.config['date_format'])
|
291
|
+
return date.strftime(self.config['date_format'])
|
292
|
+
|
293
|
+
def _get_date_info(self, created, modified):
|
294
|
+
locale = self.config['locale']
|
295
|
+
if locale not in self.translations:
|
296
|
+
locale = 'en'
|
297
|
+
t = self.translations[locale]
|
298
|
+
|
299
|
+
position_class = 'document-dates-top' if self.config['position'] == 'top' else 'document-dates-bottom'
|
300
|
+
|
301
|
+
return (
|
302
|
+
f"<div class='document-dates-plugin-wrapper {position_class}'>"
|
303
|
+
f"<div class='document-dates-plugin'>"
|
304
|
+
f"<span data-tippy-content='{t['created_time']}: {created.strftime(self.config['date_format'])}'>"
|
305
|
+
f"<span class='material-icons' data-icon='doc_created'></span>"
|
306
|
+
f"{self._get_formatted_date(created, t)}</span>"
|
307
|
+
f"<span data-tippy-content='{t['modified_time']}: {modified.strftime(self.config['date_format'])}'>"
|
308
|
+
f"<span class='material-icons' data-icon='doc_modified'></span>"
|
309
|
+
f"{self._get_formatted_date(modified, t)}</span>"
|
310
|
+
f"</div>"
|
311
|
+
f"</div>"
|
312
|
+
)
|
313
|
+
|
314
|
+
|
315
|
+
def _insert_date_info(self, markdown, date_info):
|
316
|
+
if not markdown.strip():
|
317
|
+
return markdown
|
318
|
+
|
319
|
+
if self.config['position'] == 'top':
|
320
|
+
lines = markdown.splitlines()
|
321
|
+
for i, line in enumerate(lines):
|
322
|
+
if line.startswith('#'):
|
323
|
+
lines.insert(i + 1, date_info)
|
324
|
+
return '\n'.join(lines)
|
325
|
+
return f"{date_info}\n{markdown}"
|
326
|
+
return f"{markdown}\n\n{date_info}"
|
@@ -24,6 +24,17 @@
|
|
24
24
|
margin-right: 0.3rem;
|
25
25
|
}
|
26
26
|
|
27
|
+
/* customized icons, just change the icon name.
|
28
|
+
Google Fonts Icons (2500+): https://fonts.google.com/icons */
|
29
|
+
.document-dates-plugin .material-icons[data-icon="doc_created"]::before {
|
30
|
+
/* add_circle, add_circle, note_add, add */
|
31
|
+
content: "add_circle";
|
32
|
+
}
|
33
|
+
.document-dates-plugin .material-icons[data-icon="doc_modified"]::before {
|
34
|
+
/* update, check_circle, task, refresh */
|
35
|
+
content: "update";
|
36
|
+
}
|
37
|
+
|
27
38
|
|
28
39
|
/* 2. Plug-in wrapper styles
|
29
40
|
including divider, margin, padding, etc
|
@@ -1,24 +1,4 @@
|
|
1
|
-
|
2
|
-
/* 1. Customized Icons (optional)
|
3
|
-
Just change the icon name. default: add_circle, update
|
4
|
-
the icon names, see Google Fonts Icons (2500+): https://fonts.google.com/icons
|
5
|
-
*/
|
6
|
-
/*
|
7
|
-
const iconConfig = {
|
8
|
-
doc_created: 'note_add', // default: add_circle
|
9
|
-
doc_modified: 'task', // default: update
|
10
|
-
};
|
11
|
-
// For updating icons dynamically based on the data-icon attribute
|
12
|
-
document.addEventListener('DOMContentLoaded', () => {
|
13
|
-
document.querySelectorAll('.material-icons[data-icon]').forEach(icon => {
|
14
|
-
const defaultIcon = icon.getAttribute('data-icon');
|
15
|
-
icon.textContent = iconConfig[defaultIcon] || defaultIcon;
|
16
|
-
});
|
17
|
-
});
|
18
|
-
*/
|
19
|
-
|
20
|
-
|
21
|
-
/* 2. Tooltip properties
|
1
|
+
/* Tooltip properties
|
22
2
|
including theme, placement, animation, arrow, etc
|
23
3
|
*/
|
24
4
|
// Match Tooltip's theme with Material's color scheme
|
@@ -44,7 +24,7 @@ const tippyInstances = tippy('[data-tippy-content]', {
|
|
44
24
|
});
|
45
25
|
|
46
26
|
|
47
|
-
/*
|
27
|
+
/* Automatic theme switching
|
48
28
|
Set Tooltip's theme to change automatically with the Material's light/dark color scheme
|
49
29
|
If you don't need this feature, just delete the code below
|
50
30
|
*/
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"just_now": "الآن",
|
3
|
+
"seconds_ago": "منذ {} ثانية",
|
4
|
+
"minute_ago": "منذ دقيقة",
|
5
|
+
"minutes_ago": "منذ {} دقيقة",
|
6
|
+
"hour_ago": "منذ ساعة",
|
7
|
+
"hours_ago": "منذ {} ساعة",
|
8
|
+
"day_ago": "منذ يوم",
|
9
|
+
"days_ago": "منذ {} يوم",
|
10
|
+
"week_ago": "منذ أسبوع",
|
11
|
+
"weeks_ago": "منذ {} أسبوع",
|
12
|
+
"month_ago": "منذ شهر",
|
13
|
+
"months_ago": "منذ {} شهر",
|
14
|
+
"year_ago": "منذ سنة",
|
15
|
+
"years_ago": "منذ {} سنة",
|
16
|
+
"created_time": "تاريخ الإنشاء",
|
17
|
+
"modified_time": "تاريخ التعديل"
|
18
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"just_now": "gerade jetzt",
|
3
|
+
"seconds_ago": "vor {} Sekunden",
|
4
|
+
"minute_ago": "vor einer Minute",
|
5
|
+
"minutes_ago": "vor {} Minuten",
|
6
|
+
"hour_ago": "vor einer Stunde",
|
7
|
+
"hours_ago": "vor {} Stunden",
|
8
|
+
"day_ago": "vor einem Tag",
|
9
|
+
"days_ago": "vor {} Tagen",
|
10
|
+
"week_ago": "vor einer Woche",
|
11
|
+
"weeks_ago": "vor {} Wochen",
|
12
|
+
"month_ago": "vor einem Monat",
|
13
|
+
"months_ago": "vor {} Monaten",
|
14
|
+
"year_ago": "vor einem Jahr",
|
15
|
+
"years_ago": "vor {} Jahren",
|
16
|
+
"created_time": "Erstellungszeit",
|
17
|
+
"modified_time": "Änderungszeit"
|
18
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"just_now": "just now",
|
3
|
+
"seconds_ago": "{} seconds ago",
|
4
|
+
"minute_ago": "1 minute ago",
|
5
|
+
"minutes_ago": "{} minutes ago",
|
6
|
+
"hour_ago": "1 hour ago",
|
7
|
+
"hours_ago": "{} hours ago",
|
8
|
+
"day_ago": "1 day ago",
|
9
|
+
"days_ago": "{} days ago",
|
10
|
+
"week_ago": "1 week ago",
|
11
|
+
"weeks_ago": "{} weeks ago",
|
12
|
+
"month_ago": "1 month ago",
|
13
|
+
"months_ago": "{} months ago",
|
14
|
+
"year_ago": "1 year ago",
|
15
|
+
"years_ago": "{} years ago",
|
16
|
+
"created_time": "Created",
|
17
|
+
"modified_time": "Last Update"
|
18
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"just_now": "justo ahora",
|
3
|
+
"seconds_ago": "hace {} segundos",
|
4
|
+
"minute_ago": "hace un minuto",
|
5
|
+
"minutes_ago": "hace {} minutos",
|
6
|
+
"hour_ago": "hace una hora",
|
7
|
+
"hours_ago": "hace {} horas",
|
8
|
+
"day_ago": "hace un día",
|
9
|
+
"days_ago": "hace {} días",
|
10
|
+
"week_ago": "hace una semana",
|
11
|
+
"weeks_ago": "hace {} semanas",
|
12
|
+
"month_ago": "hace un mes",
|
13
|
+
"months_ago": "hace {} meses",
|
14
|
+
"year_ago": "hace un año",
|
15
|
+
"years_ago": "hace {} años",
|
16
|
+
"created_time": "Fecha de creación",
|
17
|
+
"modified_time": "Fecha de modificación"
|
18
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"just_now": "à l'instant",
|
3
|
+
"seconds_ago": "il y a {} secondes",
|
4
|
+
"minute_ago": "il y a une minute",
|
5
|
+
"minutes_ago": "il y a {} minutes",
|
6
|
+
"hour_ago": "il y a une heure",
|
7
|
+
"hours_ago": "il y a {} heures",
|
8
|
+
"day_ago": "il y a un jour",
|
9
|
+
"days_ago": "il y a {} jours",
|
10
|
+
"week_ago": "il y a une semaine",
|
11
|
+
"weeks_ago": "il y a {} semaines",
|
12
|
+
"month_ago": "il y a un mois",
|
13
|
+
"months_ago": "il y a {} mois",
|
14
|
+
"year_ago": "il y a un an",
|
15
|
+
"years_ago": "il y a {} ans",
|
16
|
+
"created_time": "Date de création",
|
17
|
+
"modified_time": "Date de modification"
|
18
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"just_now": "たった今",
|
3
|
+
"seconds_ago": "{} 秒前",
|
4
|
+
"minute_ago": "1 分前",
|
5
|
+
"minutes_ago": "{} 分前",
|
6
|
+
"hour_ago": "1 時間前",
|
7
|
+
"hours_ago": "{} 時間前",
|
8
|
+
"day_ago": "1 日前",
|
9
|
+
"days_ago": "{} 日前",
|
10
|
+
"week_ago": "1 週間前",
|
11
|
+
"weeks_ago": "{} 週間前",
|
12
|
+
"month_ago": "1 ヶ月前",
|
13
|
+
"months_ago": "{} ヶ月前",
|
14
|
+
"year_ago": "1 年前",
|
15
|
+
"years_ago": "{} 年前",
|
16
|
+
"created_time": "作成日時",
|
17
|
+
"modified_time": "更新日時"
|
18
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"just_now": "방금",
|
3
|
+
"seconds_ago": "{} 초 전",
|
4
|
+
"minute_ago": "1 분 전",
|
5
|
+
"minutes_ago": "{} 분 전",
|
6
|
+
"hour_ago": "1 시간 전",
|
7
|
+
"hours_ago": "{} 시간 전",
|
8
|
+
"day_ago": "1 일 전",
|
9
|
+
"days_ago": "{} 일 전",
|
10
|
+
"week_ago": "1 주 전",
|
11
|
+
"weeks_ago": "{} 주 전",
|
12
|
+
"month_ago": "1 개월 전",
|
13
|
+
"months_ago": "{} 개월 전",
|
14
|
+
"year_ago": "1 년 전",
|
15
|
+
"years_ago": "{} 년 전",
|
16
|
+
"created_time": "작성일",
|
17
|
+
"modified_time": "수정일"
|
18
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"just_now": "только что",
|
3
|
+
"seconds_ago": "{} секунд назад",
|
4
|
+
"minute_ago": "минуту назад",
|
5
|
+
"minutes_ago": "{} минут назад",
|
6
|
+
"hour_ago": "час назад",
|
7
|
+
"hours_ago": "{} часов назад",
|
8
|
+
"day_ago": "день назад",
|
9
|
+
"days_ago": "{} дней назад",
|
10
|
+
"week_ago": "неделю назад",
|
11
|
+
"weeks_ago": "{} недель назад",
|
12
|
+
"month_ago": "месяц назад",
|
13
|
+
"months_ago": "{} месяцев назад",
|
14
|
+
"year_ago": "год назад",
|
15
|
+
"years_ago": "{} лет назад",
|
16
|
+
"created_time": "Дата создания",
|
17
|
+
"modified_time": "Дата изменения"
|
18
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"just_now": "刚刚",
|
3
|
+
"seconds_ago": "{} 秒前",
|
4
|
+
"minute_ago": "1 分钟前",
|
5
|
+
"minutes_ago": "{} 分钟前",
|
6
|
+
"hour_ago": "1 小时前",
|
7
|
+
"hours_ago": "{} 小时前",
|
8
|
+
"day_ago": "1 天前",
|
9
|
+
"days_ago": "{} 天前",
|
10
|
+
"week_ago": "1 周前",
|
11
|
+
"weeks_ago": "{} 周前",
|
12
|
+
"month_ago": "1 个月前",
|
13
|
+
"months_ago": "{} 个月前",
|
14
|
+
"year_ago": "1 年前",
|
15
|
+
"years_ago": "{} 年前",
|
16
|
+
"created_time": "创建时间",
|
17
|
+
"modified_time": "最后更新"
|
18
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"just_now": "剛剛",
|
3
|
+
"seconds_ago": "{} 秒前",
|
4
|
+
"minute_ago": "1 分鐘前",
|
5
|
+
"minutes_ago": "{} 分鐘前",
|
6
|
+
"hour_ago": "1 小時前",
|
7
|
+
"hours_ago": "{} 小時前",
|
8
|
+
"day_ago": "1 天前",
|
9
|
+
"days_ago": "{} 天前",
|
10
|
+
"week_ago": "1 週前",
|
11
|
+
"weeks_ago": "{} 週前",
|
12
|
+
"month_ago": "1 個月前",
|
13
|
+
"months_ago": "{} 個月前",
|
14
|
+
"year_ago": "1 年前",
|
15
|
+
"years_ago": "{} 年前",
|
16
|
+
"created_time": "建立時間",
|
17
|
+
"modified_time": "修改時間"
|
18
|
+
}
|
{mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates.egg-info/PKG-INFO
RENAMED
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mkdocs-document-dates
|
3
|
-
Version: 3.0.
|
4
|
-
Summary: A MkDocs plugin for displaying
|
3
|
+
Version: 3.0.1
|
4
|
+
Summary: A MkDocs plugin for displaying the exact creation date and last modification date of markdown documents.
|
5
5
|
Home-page: https://github.com/jaywhj/mkdocs-document-dates
|
6
6
|
Author: Aaron Wang
|
7
7
|
Classifier: Programming Language :: Python :: 3
|
@@ -27,7 +27,7 @@ English | [简体中文](README_zh.md)
|
|
27
27
|
|
28
28
|
|
29
29
|
|
30
|
-
A MkDocs plugin for displaying the <mark>exact</mark> creation and last modification
|
30
|
+
A MkDocs plugin for displaying the <mark>exact</mark> creation date and last modification date of markdown documents.
|
31
31
|
|
32
32
|
## Features
|
33
33
|
|
@@ -11,19 +11,18 @@ mkdocs_document_dates.egg-info/entry_points.txt
|
|
11
11
|
mkdocs_document_dates.egg-info/requires.txt
|
12
12
|
mkdocs_document_dates.egg-info/top_level.txt
|
13
13
|
mkdocs_document_dates/hooks/pre-commit
|
14
|
-
mkdocs_document_dates/lang/__init__.py
|
15
|
-
mkdocs_document_dates/lang/ar.py
|
16
|
-
mkdocs_document_dates/lang/de.py
|
17
|
-
mkdocs_document_dates/lang/en.py
|
18
|
-
mkdocs_document_dates/lang/es.py
|
19
|
-
mkdocs_document_dates/lang/fr.py
|
20
|
-
mkdocs_document_dates/lang/ja.py
|
21
|
-
mkdocs_document_dates/lang/ko.py
|
22
|
-
mkdocs_document_dates/lang/ru.py
|
23
|
-
mkdocs_document_dates/lang/zh.py
|
24
|
-
mkdocs_document_dates/lang/zh_tw.py
|
25
14
|
mkdocs_document_dates/static/document-dates.config.css
|
26
15
|
mkdocs_document_dates/static/document-dates.config.js
|
16
|
+
mkdocs_document_dates/static/languages/ar.json
|
17
|
+
mkdocs_document_dates/static/languages/de.json
|
18
|
+
mkdocs_document_dates/static/languages/en.json
|
19
|
+
mkdocs_document_dates/static/languages/es.json
|
20
|
+
mkdocs_document_dates/static/languages/fr.json
|
21
|
+
mkdocs_document_dates/static/languages/ja.json
|
22
|
+
mkdocs_document_dates/static/languages/ko.json
|
23
|
+
mkdocs_document_dates/static/languages/ru.json
|
24
|
+
mkdocs_document_dates/static/languages/zh.json
|
25
|
+
mkdocs_document_dates/static/languages/zh_tw.json
|
27
26
|
mkdocs_document_dates/static/tippy/backdrop.css
|
28
27
|
mkdocs_document_dates/static/tippy/light.css
|
29
28
|
mkdocs_document_dates/static/tippy/material.css
|
@@ -5,15 +5,15 @@ try:
|
|
5
5
|
with open("README.md", "r", encoding="utf-8") as fh:
|
6
6
|
long_description = fh.read()
|
7
7
|
except FileNotFoundError:
|
8
|
-
long_description = "A MkDocs plugin for displaying
|
8
|
+
long_description = "A MkDocs plugin for displaying the exact creation date and last modification date of markdown documents."
|
9
9
|
|
10
|
-
VERSION = '3.0.
|
10
|
+
VERSION = '3.0.1'
|
11
11
|
|
12
12
|
setup(
|
13
13
|
name="mkdocs-document-dates",
|
14
14
|
version=VERSION,
|
15
15
|
author="Aaron Wang",
|
16
|
-
description="A MkDocs plugin for displaying
|
16
|
+
description="A MkDocs plugin for displaying the exact creation date and last modification date of markdown documents.",
|
17
17
|
long_description=long_description,
|
18
18
|
long_description_content_type="text/markdown",
|
19
19
|
url="https://github.com/jaywhj/mkdocs-document-dates",
|
@@ -38,6 +38,7 @@ setup(
|
|
38
38
|
package_data={
|
39
39
|
'mkdocs_document_dates': [
|
40
40
|
'hooks/*',
|
41
|
+
'static/languages/*',
|
41
42
|
'static/tippy/*',
|
42
43
|
'static/*.config.css',
|
43
44
|
'static/*.config.js'
|
@@ -1,22 +0,0 @@
|
|
1
|
-
from pathlib import Path
|
2
|
-
import importlib.util
|
3
|
-
|
4
|
-
def load_translations():
|
5
|
-
translations = {}
|
6
|
-
translations_dir = Path(__file__).parent
|
7
|
-
|
8
|
-
for lang_file in translations_dir.glob('*.py'):
|
9
|
-
if lang_file.stem == '__init__':
|
10
|
-
continue
|
11
|
-
|
12
|
-
spec = importlib.util.spec_from_file_location(
|
13
|
-
f"translations.{lang_file.stem}",
|
14
|
-
lang_file
|
15
|
-
)
|
16
|
-
module = importlib.util.module_from_spec(spec)
|
17
|
-
spec.loader.exec_module(module)
|
18
|
-
|
19
|
-
if hasattr(module, 'translations'):
|
20
|
-
translations[lang_file.stem] = module.translations
|
21
|
-
|
22
|
-
return translations
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
translations = {
|
3
|
-
'just_now': 'الآن',
|
4
|
-
'seconds_ago': 'منذ {} ثانية',
|
5
|
-
'minute_ago': 'منذ دقيقة',
|
6
|
-
'minutes_ago': 'منذ {} دقيقة',
|
7
|
-
'hour_ago': 'منذ ساعة',
|
8
|
-
'hours_ago': 'منذ {} ساعة',
|
9
|
-
'day_ago': 'منذ يوم',
|
10
|
-
'days_ago': 'منذ {} يوم',
|
11
|
-
'week_ago': 'منذ أسبوع',
|
12
|
-
'weeks_ago': 'منذ {} أسبوع',
|
13
|
-
'month_ago': 'منذ شهر',
|
14
|
-
'months_ago': 'منذ {} شهر',
|
15
|
-
'year_ago': 'منذ سنة',
|
16
|
-
'years_ago': 'منذ {} سنة',
|
17
|
-
'created_time': 'تاريخ الإنشاء',
|
18
|
-
'modified_time': 'تاريخ التعديل',
|
19
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
translations = {
|
3
|
-
'just_now': 'gerade jetzt',
|
4
|
-
'seconds_ago': 'vor {} Sekunden',
|
5
|
-
'minute_ago': 'vor einer Minute',
|
6
|
-
'minutes_ago': 'vor {} Minuten',
|
7
|
-
'hour_ago': 'vor einer Stunde',
|
8
|
-
'hours_ago': 'vor {} Stunden',
|
9
|
-
'day_ago': 'vor einem Tag',
|
10
|
-
'days_ago': 'vor {} Tagen',
|
11
|
-
'week_ago': 'vor einer Woche',
|
12
|
-
'weeks_ago': 'vor {} Wochen',
|
13
|
-
'month_ago': 'vor einem Monat',
|
14
|
-
'months_ago': 'vor {} Monaten',
|
15
|
-
'year_ago': 'vor einem Jahr',
|
16
|
-
'years_ago': 'vor {} Jahren',
|
17
|
-
'created_time': 'Erstellungszeit',
|
18
|
-
'modified_time': 'Änderungszeit',
|
19
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
translations = {
|
3
|
-
'just_now': 'just now',
|
4
|
-
'seconds_ago': '{} seconds ago',
|
5
|
-
'minute_ago': '1 minute ago',
|
6
|
-
'minutes_ago': '{} minutes ago',
|
7
|
-
'hour_ago': '1 hour ago',
|
8
|
-
'hours_ago': '{} hours ago',
|
9
|
-
'day_ago': '1 day ago',
|
10
|
-
'days_ago': '{} days ago',
|
11
|
-
'week_ago': '1 week ago',
|
12
|
-
'weeks_ago': '{} weeks ago',
|
13
|
-
'month_ago': '1 month ago',
|
14
|
-
'months_ago': '{} months ago',
|
15
|
-
'year_ago': '1 year ago',
|
16
|
-
'years_ago': '{} years ago',
|
17
|
-
'created_time': 'Created',
|
18
|
-
'modified_time': 'Last Update',
|
19
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
translations = {
|
3
|
-
'just_now': 'justo ahora',
|
4
|
-
'seconds_ago': 'hace {} segundos',
|
5
|
-
'minute_ago': 'hace un minuto',
|
6
|
-
'minutes_ago': 'hace {} minutos',
|
7
|
-
'hour_ago': 'hace una hora',
|
8
|
-
'hours_ago': 'hace {} horas',
|
9
|
-
'day_ago': 'hace un día',
|
10
|
-
'days_ago': 'hace {} días',
|
11
|
-
'week_ago': 'hace una semana',
|
12
|
-
'weeks_ago': 'hace {} semanas',
|
13
|
-
'month_ago': 'hace un mes',
|
14
|
-
'months_ago': 'hace {} meses',
|
15
|
-
'year_ago': 'hace un año',
|
16
|
-
'years_ago': 'hace {} años',
|
17
|
-
'created_time': 'Fecha de creación',
|
18
|
-
'modified_time': 'Fecha de modificación',
|
19
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
translations = {
|
3
|
-
'just_now': 'à l\'instant',
|
4
|
-
'seconds_ago': 'il y a {} secondes',
|
5
|
-
'minute_ago': 'il y a une minute',
|
6
|
-
'minutes_ago': 'il y a {} minutes',
|
7
|
-
'hour_ago': 'il y a une heure',
|
8
|
-
'hours_ago': 'il y a {} heures',
|
9
|
-
'day_ago': 'il y a un jour',
|
10
|
-
'days_ago': 'il y a {} jours',
|
11
|
-
'week_ago': 'il y a une semaine',
|
12
|
-
'weeks_ago': 'il y a {} semaines',
|
13
|
-
'month_ago': 'il y a un mois',
|
14
|
-
'months_ago': 'il y a {} mois',
|
15
|
-
'year_ago': 'il y a un an',
|
16
|
-
'years_ago': 'il y a {} ans',
|
17
|
-
'created_time': 'Date de création',
|
18
|
-
'modified_time': 'Date de modification',
|
19
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
translations = {
|
3
|
-
'just_now': 'たった今',
|
4
|
-
'seconds_ago': '{} 秒前',
|
5
|
-
'minute_ago': '1 分前',
|
6
|
-
'minutes_ago': '{} 分前',
|
7
|
-
'hour_ago': '1 時間前',
|
8
|
-
'hours_ago': '{} 時間前',
|
9
|
-
'day_ago': '1 日前',
|
10
|
-
'days_ago': '{} 日前',
|
11
|
-
'week_ago': '1 週間前',
|
12
|
-
'weeks_ago': '{} 週間前',
|
13
|
-
'month_ago': '1 ヶ月前',
|
14
|
-
'months_ago': '{} ヶ月前',
|
15
|
-
'year_ago': '1 年前',
|
16
|
-
'years_ago': '{} 年前',
|
17
|
-
'created_time': '作成日時',
|
18
|
-
'modified_time': '更新日時',
|
19
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
translations = {
|
3
|
-
'just_now': '방금',
|
4
|
-
'seconds_ago': '{} 초 전',
|
5
|
-
'minute_ago': '1 분 전',
|
6
|
-
'minutes_ago': '{} 분 전',
|
7
|
-
'hour_ago': '1 시간 전',
|
8
|
-
'hours_ago': '{} 시간 전',
|
9
|
-
'day_ago': '1 일 전',
|
10
|
-
'days_ago': '{} 일 전',
|
11
|
-
'week_ago': '1 주 전',
|
12
|
-
'weeks_ago': '{} 주 전',
|
13
|
-
'month_ago': '1 개월 전',
|
14
|
-
'months_ago': '{} 개월 전',
|
15
|
-
'year_ago': '1 년 전',
|
16
|
-
'years_ago': '{} 년 전',
|
17
|
-
'created_time': '작성일',
|
18
|
-
'modified_time': '수정일',
|
19
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
translations = {
|
3
|
-
'just_now': 'только что',
|
4
|
-
'seconds_ago': '{} секунд назад',
|
5
|
-
'minute_ago': 'минуту назад',
|
6
|
-
'minutes_ago': '{} минут назад',
|
7
|
-
'hour_ago': 'час назад',
|
8
|
-
'hours_ago': '{} часов назад',
|
9
|
-
'day_ago': 'день назад',
|
10
|
-
'days_ago': '{} дней назад',
|
11
|
-
'week_ago': 'неделю назад',
|
12
|
-
'weeks_ago': '{} недель назад',
|
13
|
-
'month_ago': 'месяц назад',
|
14
|
-
'months_ago': '{} месяцев назад',
|
15
|
-
'year_ago': 'год назад',
|
16
|
-
'years_ago': '{} лет назад',
|
17
|
-
'created_time': 'Дата создания',
|
18
|
-
'modified_time': 'Дата изменения',
|
19
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
translations = {
|
3
|
-
'just_now': '刚刚',
|
4
|
-
'seconds_ago': '{} 秒前',
|
5
|
-
'minute_ago': '1 分钟前',
|
6
|
-
'minutes_ago': '{} 分钟前',
|
7
|
-
'hour_ago': '1 小时前',
|
8
|
-
'hours_ago': '{} 小时前',
|
9
|
-
'day_ago': '1 天前',
|
10
|
-
'days_ago': '{} 天前',
|
11
|
-
'week_ago': '1 周前',
|
12
|
-
'weeks_ago': '{} 周前',
|
13
|
-
'month_ago': '1 个月前',
|
14
|
-
'months_ago': '{} 个月前',
|
15
|
-
'year_ago': '1 年前',
|
16
|
-
'years_ago': '{} 年前',
|
17
|
-
'created_time': '创建时间',
|
18
|
-
'modified_time': '最后更新',
|
19
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
translations = {
|
3
|
-
'just_now': '剛剛',
|
4
|
-
'seconds_ago': '{} 秒前',
|
5
|
-
'minute_ago': '1 分鐘前',
|
6
|
-
'minutes_ago': '{} 分鐘前',
|
7
|
-
'hour_ago': '1 小時前',
|
8
|
-
'hours_ago': '{} 小時前',
|
9
|
-
'day_ago': '1 天前',
|
10
|
-
'days_ago': '{} 天前',
|
11
|
-
'week_ago': '1 週前',
|
12
|
-
'weeks_ago': '{} 週前',
|
13
|
-
'month_ago': '1 個月前',
|
14
|
-
'months_ago': '{} 個月前',
|
15
|
-
'year_ago': '1 年前',
|
16
|
-
'years_ago': '{} 年前',
|
17
|
-
'created_time': '建立時間',
|
18
|
-
'modified_time': '修改時間',
|
19
|
-
}
|
File without changes
|
{mkdocs_document_dates-3.0.0 → mkdocs_document_dates-3.0.1}/mkdocs_document_dates/__init__.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
|