Skip to content

Commit 643ba92

Browse files
committed
schemas: Do not category version by month
1 parent d01f7ea commit 643ba92

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/sphinxnotes/project/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616

1717
from . import meta
1818

19+
1920
def setup(app: Sphinx):
2021
meta.pre_setup(app)
2122

2223
from . import schemas
24+
2325
schemas.setup(app)
2426

2527
return meta.post_setup(app)

src/sphinxnotes/project/schemas.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
from typing import TYPE_CHECKING
1515
from os import path
1616

17-
from sphinxnotes.any.api import Schema, Field as F, by_year, by_month
17+
from sphinxnotes.any.api import Schema, Field as F, by_year
18+
19+
from . import meta
1820

1921
if TYPE_CHECKING:
2022
from sphinx.application import Sphinx
@@ -44,7 +46,7 @@ def _config_inited(app: Sphinx, config: Config) -> None:
4446
'version',
4547
name=F(uniq=True, ref=True, required=True, form=F.Forms.LINES),
4648
attrs={
47-
'date': F(ref=True, indexers=[by_year, by_month]),
49+
'date': F(ref=True, indexers=[by_year]),
4850
},
4951
content=F(form=F.Forms.LINES),
5052
description_template=_read_template_file('version'),
@@ -89,6 +91,10 @@ def _config_inited(app: Sphinx, config: Config) -> None:
8991

9092

9193
def setup(app: Sphinx):
94+
meta.pre_setup(app)
95+
9296
app.setup_extension('sphinxnotes.any')
9397
# Should have priority over sphinxnotes.any's "config-inited" callback.
9498
app.connect('config-inited', _config_inited, priority=400)
99+
100+
return meta.post_setup(app)

0 commit comments

Comments
 (0)