Skip to content

Commit 827c71e

Browse files
SilverRainZMiMoCode
andcommitted
docs: Format dates as YYYY-MM-DD in examples
Co-authored-by: MiMoCode <mimo@xiaomi.com>
1 parent f5301ca commit 827c71e

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ a revision list:
8282
The most recent 3 commits:
8383
8484
{% for r in load_extra('recentupdate', 3) %}
85-
``{{ r.date }}``
85+
``{{ r.date.strftime('%Y-%m-%d') }}``
8686
{{ r.message[0] }}
8787
{% endfor %}
8888

docs/usage.rst

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ This is a basic example:
6262
.. data.render::
6363
6464
{% for r in load_extra('recentupdate', count=5) %}
65-
``👤{{ r.author }}`` @ ``📅 {{ r.date }}``
65+
``👤 {{ r.author }}`` @ ``📅 {{ r.date.strftime('%Y-%m-%d') }}``::
66+
6667
{{ r.message[0] }}
6768
{% endfor %}
6869
@@ -74,7 +75,7 @@ Examples
7475
.. data.render::
7576
7677
{% for r in load_extra('recentupdate', count=5) %}
77-
``📅 {{ r.date }}``
78+
``📅 {{ r.date.strftime('%Y-%m-%d') }}``
7879
{% if r.changed_docs -%}
7980
:Modified: {{ r.changed_docs | roles("doc") | join(", ") }}
8081
{% endif %}
@@ -93,10 +94,10 @@ Examples
9394

9495
.. data.render::
9596
96-
Recent changes of the ``docs/index.rst`` file:
97+
Recent changes of the :doc:`changelog`:
9798
98-
{% for r in load_extra('recentupdate', count=5, paths=['docs/index.rst']) %}
99-
``{{ r.date }}`` — {{ r.message[0] }}
99+
{% for r in load_extra('recentupdate', count=5, paths=['docs/changelog.rst']) %}
100+
``{{ r.date.strftime('%Y-%m-%d') }}`` — {{ r.message[0] }}
100101
{% endfor %}
101102
102103
.. example:: Recent Updates to Current Document
@@ -106,20 +107,21 @@ Examples
106107
Recent changes to this document:
107108
108109
{% for r in load_extra('recentupdate', count=5, current_doc=True) %}
109-
``{{ r.date }}`` — {{ r.message[0] }}
110+
``{{ r.date.strftime('%Y-%m-%d') }}`` — {{ r.message[0] }}
110111
{% endfor %}
111112
112113
.. example:: Grouped Recent Updates
113114

114115
.. data.render::
115116
116-
Recent updates grouped by day:
117+
Recent updates grouped by month:
117118
118-
{% for r in load_extra('recentupdate', count=10, group_by='month') %}
119+
{% for r in load_extra('recentupdate', count=5, group_by='month') %}
119120
``📅 {{ r.date.strftime('%Y-%m') }}``
120-
{% for msg in r.message[:3] %}
121-
{{ msg }}
122-
{% endfor %}
121+
::
122+
{% for msg in r.message %}
123+
{{ msg }}
124+
{%- endfor %}
123125
{% endfor %}
124126
125127
``sphinxnotes-render``

0 commit comments

Comments
 (0)