From f2b3f56c9322670b654ba44a4af75fb7673c8464 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Sun, 25 Jan 2026 23:37:54 +0800 Subject: [PATCH 01/13] [conf] Migrate to obj domain 3.0 (formerly called any domain) --- conf.py | 7 +- confs/fetch_artwork.py | 4 +- confs/schemas.py | 395 +++++++++++++++++++++++------------------ 3 files changed, 227 insertions(+), 179 deletions(-) diff --git a/conf.py b/conf.py index f98a806b7..11db0fbba 100644 --- a/conf.py +++ b/conf.py @@ -19,7 +19,7 @@ # -- Split configurations ---------------------------------------------------- -from confs.schemas import _schemas +from confs.schemas import _obj_type_defines from confs.deploy import Deployment _D = Deployment.current() @@ -95,7 +95,7 @@ # A list of warning codes to suppress arbitrary warning messages. if _D is _D.Local: - suppress_warnings = ['ref.' + x.objtype for x in _schemas] + suppress_warnings = ['ref.' + x for x in _obj_type_defines] # Auto numbered figures, tables and code-blocks if they have a caption. # numfig = True @@ -223,7 +223,8 @@ } extensions.append('sphinxnotes.any') -any_schemas = _schemas +obj_domain_name = 'any' +obj_type_defines = _obj_type_defines extensions.append('ablog') blog_path = 'blog' diff --git a/confs/fetch_artwork.py b/confs/fetch_artwork.py index 26fa70e19..90914fc4f 100644 --- a/confs/fetch_artwork.py +++ b/confs/fetch_artwork.py @@ -5,7 +5,7 @@ from sphinx.application import Sphinx from sphinx.environment import BuildEnvironment from sphinx.util import logging -from sphinxnotes.any.template import Environment as TemplateEnvironment +from sphinxnotes.data.render.template import _JinjaEnv from .deploy import Deployment @@ -34,4 +34,4 @@ def _filter(id_: str) -> str | None: def setup(app: Sphinx): - TemplateEnvironment.add_filter('fetch_artwork', fetch_artwork_filter) + _JinjaEnv.add_filter('fetch_artwork', fetch_artwork_filter) diff --git a/confs/schemas.py b/confs/schemas.py index d822133e6..67592ca29 100644 --- a/confs/schemas.py +++ b/confs/schemas.py @@ -1,179 +1,226 @@ # Definition of any domain's object schemas. # See also https://sphinx.silverrainz.me/any/. -from sphinxnotes.any.api import Schema, Field as F, by_year, by_month, PathIndexer +from sphinxnotes.any.domain import INDEXER_REGSITRY +from sphinxnotes.any.indexers import PathIndexer -by_hyphen = PathIndexer('-', 1) -by_hyphen2 = PathIndexer('-', 2) -by_slash = PathIndexer('/', 1) - -_schemas = [ - Schema('friend', - name=F(uniq=True, ref=True, required=True, form=F.Forms.LINES), - attrs={'avatar': F(), 'blog': F()}, - content=F(form=F.Forms.LINES), - description_template=open('confs/templates/friend.rst', 'r').read(), - reference_template='👤{{ title }}', - missing_reference_template='👤{{ title }}', - ambiguous_reference_template='👥{{ title }}'), - Schema('book', - name=F(required=True, ref=True, form=F.Forms.LINES), - attrs={ - 'isbn': F(uniq=True, ref=True), - 'status': F(ref=True), - 'startat': F(ref=True, form=F.Forms.WORDS, indexers=[by_year]), - 'endat': F(ref=True, form=F.Forms.WORDS, indexers=[by_year]), - }, - description_template=open('confs/templates/book.rst', 'r').read(), - reference_template='《{{ title }}》', - missing_reference_template='《{{ title }}》', - ambiguous_reference_template='《{{ title }}》'), - Schema('artwork', - name=F(ref=True), - attrs={ - 'id': F(uniq=True, ref=True, required=True, indexers=[by_hyphen]), - 'date': F(ref=True, indexers=[by_year]), - 'medium': F(ref=True, form=F.Forms.WORDS), - 'size': F(ref=True), - 'album': F(ref=True), - }, - description_template=open('confs/templates/artwork.rst', 'r').read(), - reference_template='《{% if title %}{{ title }}{% else %}{{ id }}{% endif %}》', - missing_reference_template='《{{ title }}》', - ambiguous_reference_template='{{ title }}'), - Schema('artist', - name=F(uniq=True, ref=True, required=True, form=F.Forms.LINES), - attrs={ - 'movement': F(ref=True, form=F.Forms.WORDS), - 'gallery': F(ref=True, form=F.Forms.WORDS), - 'enwiki': F(), - 'zhwiki': F(), - 'artwork': F(form=F.Forms.WORDS), - }, - description_template=open('confs/templates/artist.rst', 'r').read(), - reference_template='🧑‍🎨{{ title }}', - missing_reference_template='🧑‍🎨{{ title }}', - ambiguous_reference_template='🧑‍🎨{{ title }}'), - Schema('gallery', - name=F(uniq=True, ref=True, required=True, form=F.Forms.LINES), - attrs={'website': F()}, - description_template=open('confs/templates/gallery.rst', 'r').read(), - reference_template='🖼️{{ title }}', - missing_reference_template='🖼️{{ title }}'), - Schema('event', - name=F(ref=True, required=True), - attrs={ - 'date': F(ref=True, form=F.Forms.WORDS, indexers=[by_year]), - 'location': F(ref=True), - }, - description_template=open('confs/templates/event.rst', 'r').read(), - reference_template='📅{{ title }}', - missing_reference_template='📅{{ title }}', - ambiguous_reference_template='📅{{ title }}'), - Schema('leetcode', - name=F(ref=True, required=True), - attrs={ - 'id': F(uniq=True, ref=True), - 'diffculty': F(ref=True), - 'language': F(ref=True, form=F.Forms.WORDS), - 'key': F(ref=True, form=F.Forms.WORDS), - 'date': F(ref=True, form=F.Forms.WORDS, indexers=[by_year, by_month]), - 'reference': F(ref=True), - }, - description_template=open('confs/templates/leetcode.rst', 'r').read(), - reference_template='🧮{{ title }}', - missing_reference_template='🧮{{ title }}', - ambiguous_reference_template='🧮{{ title }}'), - Schema('term', - name=F(ref=True, required=True, form=F.Forms.LINES), - attrs={ - 'field': F(ref=True, indexers=[by_slash]), - 'enwiki': F(), - 'zhwiki': F(), - 'hide': F(), - }, - description_template=open('confs/templates/term.rst', 'r').read(), - reference_template='#️⃣{{ title }}', - missing_reference_template='#️⃣{{ title }}', - ambiguous_reference_template='#️⃣{{ title }}'), - Schema('jour', - name=F(ref=True, required=True), - attrs={ - 'date': F(ref=True, indexers=[by_year, by_month]), - 'category': F(), - }, - description_template=open('confs/templates/jour.rst', 'r').read(), - reference_template='📰{{ title }}', - missing_reference_template='📰{{ title }}', - ambiguous_reference_template='📰{{ title }}'), - Schema('okr', - name=F(ref=True, required=True), - attrs={ - 'id': F(uniq=True, ref=True, required=True, indexers=[by_hyphen2]), - - 'kr1': F(form=F.Forms.LINES), - 'kr2': F(form=F.Forms.LINES), - 'kr3': F(form=F.Forms.LINES), - 'kr4': F(form=F.Forms.LINES), - 'kr5': F(form=F.Forms.LINES), - 'kr6': F(form=F.Forms.LINES), - - 'p0': F(ref=True), - 'p1': F(ref=True), - 'p2': F(ref=True), - - 'krs': F(form=F.Forms.LINES), # deprecated - }, - description_template=open('confs/templates/okr.rst', 'r').read(), - reference_template='🎯{{ title }}', - missing_reference_template='🎯{{ title }}', - ambiguous_reference_template='🎯{{ title }}'), -Schema('people', - name=F(uniq=True, ref=True, required=True, form=F.Forms.LINES), - attrs={ - 'github': F(), - 'blog': F(), - 'enwiki': F(), - 'zhwiki': F(), - 'weibo': F(), - }, - description_template=open('confs/templates/people.rst', 'r').read(), - reference_template='👤{{ title }}'), -Schema('rhythm', - name=F(ref=True), - attrs={ - 'time': F(ref=True, required=True), - 'tempo': F(), - 'musicca': F(), - }, - content=F(form=F.Forms.LINES), - description_template=open('confs/templates/rhythm.rst', 'r').read(), - reference_template='🥁{{ title }}'), -Schema('dev', - name=F(ref=True, required=True), - attrs={ - 'id': F(uniq=True, ref=True, required=True, indexers=[by_hyphen]), - 'type': F(ref=True), - 'web': F(), - 'man': F(), - 'price': F(), - 'startat': F(ref=True, indexers=[by_year]), - 'endat': F(ref=True, indexers=[by_year]), - }, - description_template=open('confs/templates/dev.rst', 'r').read(), - reference_template='🎛️{{ title }}'), -Schema('loveletter', - name=F(ref=True, required=True), - attrs={ - 'date': F(ref=True, required=True, indexers=[by_year]), - 'nick': F(), - 'author': F(ref=True), - 'createdat': F(ref=True, indexers=[by_year]), - 'updatedat': F(ref=True, indexers=[by_year]), - }, - description_template=open('confs/templates/loveletter.rst', 'r').read(), - reference_template='💌{{ title }}', - missing_reference_template='💌{{ title }}', - ambiguous_reference_template='💌{{ title }}'), -] +INDEXER_REGSITRY['hyphen'] = PathIndexer('-', 1) +INDEXER_REGSITRY['hyphen2'] = PathIndexer('-', 2) +_obj_type_defines = { + 'friend': { + 'auto': True, + 'schema': { + 'name': 'lines of str, required, uniq, ref', + 'attrs': { + 'avatar': 'str', + 'blog': 'str', + }, + 'content': 'lines of str', + }, + 'templates': { + 'obj': open('confs/templates/friend.rst', 'r').read(), + 'header': '{{ name[0] }}', + 'ref': '👤{{ name[0] }}', + }, + }, + 'book': { + 'schema': { + 'attrs': { + 'isbn': 'str, uniq, ref', + 'status': 'str, ref', + 'startat': 'words of str, ref', + 'endat': 'words of str, ref', + }, + }, + 'templates': { + 'obj': open('confs/templates/book.rst', 'r').read(), + 'ref': '《{{ name }}》', + }, + }, + 'artwork': { + 'schema': { + 'name': 'str, ref', + 'attrs': { + 'id': 'str, required, uniq, ref, index by hyphen', + 'date': 'date, ref, index by year', + 'medium': 'words of str, ref', + 'size': 'str, ref', + 'album': 'str, ref', + }, + }, + 'templates': { + 'obj': open('confs/templates/artwork.rst', 'r').read(), + 'ref': '《{{ name }}》', + }, + }, + 'artist': { + 'schema': { + 'name': 'lines of str, required, ref', + 'attrs': { + 'movement': 'words of str, ref', + 'gallery': 'words of str, ref', + 'enwiki': 'str', + 'zhwiki': 'str', + 'artwork': 'words of str', + }, + }, + 'templates': { + 'obj': open('confs/templates/artist.rst', 'r').read(), + 'ref': '🧑‍🎨{{ name[0] }}', + }, + }, + 'gallery': { + 'schema': { + 'name': 'lines of str, required, uniq, ref', + 'attrs': { + 'website': 'str', + }, + }, + 'templates': { + 'obj': open('confs/templates/gallery.rst', 'r').read(), + 'ref': '🖼️{{ name }}', + }, + }, + 'event': { + 'schema': { + 'name': 'str, required, ref', + 'attrs': { + 'date': 'words of date, ref, index by year', + 'location': 'str, ref', + }, + }, + 'templates': { + 'obj': open('confs/templates/event.rst', 'r').read(), + 'ref': '📅{{ name }}', + }, + }, + 'leetcode': { + 'schema': { + 'name': 'str, required, ref', + 'attrs': { + 'id': 'str, uniq, ref', + 'diffculty': 'str, ref', + 'language': 'words of str, ref', + 'key': 'words of str, ref', + 'date': 'words of date, ref, index by year', + 'reference': 'str', + }, + }, + 'templates': { + 'obj': open('confs/templates/leetcode.rst', 'r').read(), + 'ref': '🧮{{ name }}', + }, + }, + 'term': { + 'schema': { + 'name': 'lines of str, required, ref', + 'attrs': { + 'field': 'str, ref, index by slash', # TODO: index by slash + 'enwiki': 'str', + 'zhwiki': 'str', + 'hide': 'bool', + }, + }, + 'templates': { + 'obj': open('confs/templates/term.rst', 'r').read(), + 'ref': '#️⃣{{ name[0] }}', + }, + }, + 'jour': { + 'schema': { + 'name': 'date, required, ref, index by year', + 'attrs': { + 'category': 'str', # TODO + }, + }, + 'templates': { + 'obj': open('confs/templates/jour.rst', 'r').read(), + 'ref': '📰{{ name }}', + }, + }, + 'okr': { + 'schema': { + 'attrs': { + 'id': 'str, required, uniq, ref, index by hyphen2', + 'kr1': 'lines of str', + 'kr2': 'lines of str', + 'kr3': 'lines of str', + 'kr4': 'lines of str', + 'kr5': 'lines of str', + 'kr6': 'lines of str', + 'p0': 'str, ref', + 'p1': 'str, ref', + 'p2': 'str, ref', + 'krs': 'lines of str', + }, + }, + 'templates': { + 'obj': open('confs/templates/okr.rst', 'r').read(), + 'ref': '🎯{{ name }}', + }, + }, + 'people': { + 'schema': { + 'name': 'lines of str, required, uniq, ref', + 'attrs': { + 'github': 'str', + 'blog': 'str', + 'enwiki': 'str', + 'zhwiki': 'str', + 'weibo': 'str', + }, + }, + 'templates': { + 'obj': open('confs/templates/people.rst', 'r').read(), + 'ref': '👤{{ name[0] }}', + }, + }, + 'rhythm': { + 'schema': { + 'name': 'str, ref', + 'attrs': { + 'time': 'str, required, ref', + 'tempo': 'str', + 'musicca': 'str', + }, + 'content': 'lines of str', + }, + 'templates': { + 'obj': open('confs/templates/rhythm.rst', 'r').read(), + 'ref': '🥁{{ name }}', + }, + }, + 'dev': { + 'schema': { + 'attrs': { + 'id': 'str, required, uniq, ref, index by hyphen', + 'type': 'str, ref', + 'web': 'str', + 'man': 'str', + 'price': 'str', + 'startat': 'str, ref', + 'endat': 'str, ref', + }, + }, + 'templates': { + 'obj': open('confs/templates/dev.rst', 'r').read(), + 'ref': '🎛️{{ name }}', + }, + }, + 'loveletter': { + 'schema': { + 'attrs': { + 'date': 'date, required, ref, index by year', + 'nick': 'str', + 'author': 'str, ref', + 'createdat': 'date, ref, index by year', + 'updatedat': 'date, ref, index by year', + }, + }, + 'templates': { + 'obj': open('confs/templates/loveletter.rst', 'r').read(), + 'ref': '💌{{ name }}', + }, + }, +} From 2d5871b5d6ce65b301f9521d4ea59aaf53de3c6a Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Fri, 30 Jan 2026 02:43:06 +0800 Subject: [PATCH 02/13] [conf] Adapt latest changes --- conf.py | 15 ++++++--------- confs/schemas.py | 7 +++---- confs/templates/jour.rst | 3 --- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/conf.py b/conf.py index 11db0fbba..71de65c59 100644 --- a/conf.py +++ b/conf.py @@ -19,7 +19,7 @@ # -- Split configurations ---------------------------------------------------- -from confs.schemas import _obj_type_defines +from confs.schemas import OBJECT_TYPES as _OBJECT_TYPES from confs.deploy import Deployment _D = Deployment.current() @@ -95,7 +95,7 @@ # A list of warning codes to suppress arbitrary warning messages. if _D is _D.Local: - suppress_warnings = ['ref.' + x for x in _obj_type_defines] + suppress_warnings = ['ref.' + x for x in _OBJECT_TYPES] # Auto numbered figures, tables and code-blocks if they have a caption. # numfig = True @@ -223,8 +223,8 @@ } extensions.append('sphinxnotes.any') -obj_domain_name = 'any' -obj_type_defines = _obj_type_defines +any_domain_name = 'any' +any_object_types = _OBJECT_TYPES extensions.append('ablog') blog_path = 'blog' @@ -372,12 +372,9 @@ extensions.append('sphinxnotes.poc') def setup(app): - # Dump any domain data: - # from conf.dump_any_domain import setup - # setup(app) - # Query artworks from LATree. from confs import fetch_artwork - fetch_artwork.setup(app) + + fetch_artwork.setup(app) # query artworks from LATree ... diff --git a/confs/schemas.py b/confs/schemas.py index 67592ca29..c68a230e4 100644 --- a/confs/schemas.py +++ b/confs/schemas.py @@ -7,7 +7,7 @@ INDEXER_REGSITRY['hyphen'] = PathIndexer('-', 1) INDEXER_REGSITRY['hyphen2'] = PathIndexer('-', 2) -_obj_type_defines = { +OBJECT_TYPES = { 'friend': { 'auto': True, 'schema': { @@ -130,14 +130,13 @@ 'jour': { 'schema': { 'name': 'date, required, ref, index by year', - 'attrs': { - 'category': 'str', # TODO - }, }, 'templates': { 'obj': open('confs/templates/jour.rst', 'r').read(), + 'header': '📰 :jour.name+by-year:`{{ name }}`', 'ref': '📰{{ name }}', }, + 'auto': True, }, 'okr': { 'schema': { diff --git a/confs/templates/jour.rst b/confs/templates/jour.rst index 7e8226a5f..665c87a32 100644 --- a/confs/templates/jour.rst +++ b/confs/templates/jour.rst @@ -1,4 +1 @@ -{% if date %}:日期: :jour.date+by-month:`{{ date }} <{{ date }}>`{% endif %} -{% if category %}:类别: {{ category }}{% endif %} - {% if content %}{{ content }}{% endif %} From 9217456ee04c7300f353a1a0440f28f1f7a8df16 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Fri, 30 Jan 2026 22:35:35 +0800 Subject: [PATCH 03/13] [conf] Suppress misc.highlighting_failure warning --- conf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 71de65c59..1870c4dab 100644 --- a/conf.py +++ b/conf.py @@ -94,8 +94,12 @@ keep_warnings = True # A list of warning codes to suppress arbitrary warning messages. +suppress_warnings = [ + 'misc.highlighting_failure' # pygment highlight error +] + if _D is _D.Local: - suppress_warnings = ['ref.' + x for x in _OBJECT_TYPES] + suppress_warnings.extend(['ref.' + x for x in _OBJECT_TYPES]) # Auto numbered figures, tables and code-blocks if they have a caption. # numfig = True From 1a04892a8160caa61f3a7d73d294d3ba7c3c0dcf Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Fri, 30 Jan 2026 22:37:25 +0800 Subject: [PATCH 04/13] [conf] Tweak schemas --- confs/schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confs/schemas.py b/confs/schemas.py index c68a230e4..13c7fd2d0 100644 --- a/confs/schemas.py +++ b/confs/schemas.py @@ -9,7 +9,6 @@ OBJECT_TYPES = { 'friend': { - 'auto': True, 'schema': { 'name': 'lines of str, required, uniq, ref', 'attrs': { @@ -172,6 +171,7 @@ }, 'templates': { 'obj': open('confs/templates/people.rst', 'r').read(), + 'header': '{{ name[0] }}', 'ref': '👤{{ name[0] }}', }, }, From ec07bdd50a142f7e63cb53fce8420f0b72723f45 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Fri, 6 Feb 2026 21:59:05 +0800 Subject: [PATCH 05/13] [conf] Introduce sphinxnotes.data!!! https://sphinx.silverrainz.me/data --- conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf.py b/conf.py index 1870c4dab..07b0ea98f 100644 --- a/conf.py +++ b/conf.py @@ -375,6 +375,8 @@ extensions.append('sphinxnotes.poc') +extensions.append('sphinxnotes.data') + def setup(app): from confs import fetch_artwork From ff73009d5a1dc1b759007d96523360c119cbbaf4 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Fri, 6 Feb 2026 22:00:13 +0800 Subject: [PATCH 06/13] [conf] Fix artwork template --- confs/templates/artwork.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/confs/templates/artwork.rst b/confs/templates/artwork.rst index a3935870c..398788899 100644 --- a/confs/templates/artwork.rst +++ b/confs/templates/artwork.rst @@ -1,16 +1,15 @@ -:编号: :artwork.id+by-path:`{{ id }} <{{ id }}>` - +:编号: :artwork.id+by-hyphen:`{{ id }} <{{ id }}>` :日期: :artwork.date+by-year:`{{ date }} <{{ date }}>` {% if size %}:尺幅: :artwork.size:`{{ size }} <{{ size }}>`{% endif %} :媒介: {% for m in medium %}:artwork.medium:`{{ m }} <{{ m }}>` {% endfor %} {% if album %}:画集: :artwork.album:`{{ album }} <{{ album }}>`{% endif %} -{% set image2 = id | fetch_artwork %} -{% if image2 %} -.. figure:: {{ image2 }} +{% set image = id | fetch_artwork %} +{% if image %} +.. figure:: {{ image }} :width: 60% - {{ title }} + {{ name }} {% else %} .. todo:: 图片未上传 {% endif %} From ca50023d2a9fba8744c12a70d9fbec455d5a1c22 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Fri, 6 Feb 2026 22:02:52 +0800 Subject: [PATCH 07/13] [conf] Use the cool object embedding fucntion! --- confs/schemas.py | 4 +- confs/templates/artwork.embed.rst | 5 + src/blog/2024-changelog.rst | 94 +++++-------------- .../zxsys/way-to-artist/find-yourself.rst | 16 ++-- 4 files changed, 41 insertions(+), 78 deletions(-) create mode 100644 confs/templates/artwork.embed.rst diff --git a/confs/schemas.py b/confs/schemas.py index 13c7fd2d0..859e6cc66 100644 --- a/confs/schemas.py +++ b/confs/schemas.py @@ -39,7 +39,7 @@ }, 'artwork': { 'schema': { - 'name': 'str, ref', + 'name': 'str, ref, required', 'attrs': { 'id': 'str, required, uniq, ref, index by hyphen', 'date': 'date, ref, index by year', @@ -51,6 +51,7 @@ 'templates': { 'obj': open('confs/templates/artwork.rst', 'r').read(), 'ref': '《{{ name }}》', + 'embed': open('confs/templates/artwork.embed.rst', 'r').read(), }, }, 'artist': { @@ -135,7 +136,6 @@ 'header': '📰 :jour.name+by-year:`{{ name }}`', 'ref': '📰{{ name }}', }, - 'auto': True, }, 'okr': { 'schema': { diff --git a/confs/templates/artwork.embed.rst b/confs/templates/artwork.embed.rst new file mode 100644 index 000000000..ee6a8c2e8 --- /dev/null +++ b/confs/templates/artwork.embed.rst @@ -0,0 +1,5 @@ +.. figure:: /_assets/aw/{{ id }}.webp + :width: 60% + :align: center + + {{ name }}, {{ id }}, {{ date }} diff --git a/src/blog/2024-changelog.rst b/src/blog/2024-changelog.rst index 0fed0c47c..831d056a6 100644 --- a/src/blog/2024-changelog.rst +++ b/src/blog/2024-changelog.rst @@ -159,14 +159,10 @@ The day after last day .. grid:: 1 2 2 2 .. grid-item:: - .. figure:: /_assets/aw/m-004.webp - - :artwork:`罗马王` + .. artwork+embed:: m-004 .. grid-item:: - .. figure:: /_assets/aw/m-005.webp - - :artwork:`贝利夫人` + .. artwork+embed:: m-005 万幸,我没有把所有东西都忘掉,但我的感受是含糊的。我到底是掌握了熟练度,还是掌握了造型的知识?我时常会质疑自己在画 :artwork:`高乃依像` 的时候,是真正理解了造型还是只是在老师的步步搀扶下「突破」了自我?之前的笔记并不能帮我画出一样的画,除了文字化的知识,我还欠缺了关键的、未知的什么东西。 @@ -250,57 +246,26 @@ The day after last day 这是来燕郊后的部分: -.. grid:: 1 2 5 5 +.. data:template:: + {% for line in content %} .. grid-item:: - .. figure:: /_assets/aw/bflv-001.webp + .. artwork+embed:: {{ line }} - :artwork:`bflv-001` - - .. grid-item:: - .. figure:: /_assets/aw/bflv-008.webp + .. figure:: /_assets/aw/{{ '{{ id }}' }}.webp - :artwork:`珍视` + {{ '{{ name }}' }} + {% endfor %} - .. grid-item:: - .. figure:: /_assets/aw/bflv-012.webp - - :artwork:`销烟` - - .. grid-item:: - .. figure:: /_assets/aw/bflv-013.webp +.. data:schema:: - :artwork:`bflv-013` - - .. grid-item:: - .. figure:: /_assets/aw/bflv-016.webp - - :artwork:`bflv-016` - - .. grid-item:: - .. figure:: /_assets/aw/bflv-021.webp - - :artwork:`平安夜(一)` - - .. grid-item:: - .. figure:: /_assets/aw/bflv-022.webp + words of str - :artwork:`平安夜(二)` - - .. grid-item:: - .. figure:: /_assets/aw/bflv-023.webp - - :artwork:`轻微的纯度游戏` - - .. grid-item:: - .. figure:: /_assets/aw/bflv-025.webp - - :artwork:`失去的前一瞬间` +.. grid:: 1 2 5 5 - .. grid-item:: - .. figure:: /_assets/aw/bflv-028.webp + .. data:def:: - :artwork:`生命的线索` + bflv-001 bflv-008 bflv-012 bflv-013 bflv-016 bflv-021 bflv-022 bflv-023 bflv-025 bflv-028 可以明显看到来燕郊后的画更稳定地有意思一点儿,一方面上班挤占了我大部分的精力,另一方面在燕郊的生活有了些插曲,为我带来了多样的情绪。嗯,我\ :del:`又`\ 谈恋爱了。 @@ -339,12 +304,7 @@ The day after last day 于是 A 张开了双手 `3` … 抱住了从天而降的少女 `4` 。 -.. figure:: /_assets/aw/xfczk2-041.webp - :width: 60% - - :artwork:`有星星和微风的夜晚` - - 阅读顺序:从左到右,从上到下分别是 1、2、3、4。 +.. artwork+embed:: xfczk2-041 两年后,这个故事真实发生了,这个少女是 :people:`Swan`。 @@ -366,10 +326,7 @@ The day after last day Swan 是我的前同事。22 年我还保留着画小创作的惯性,在画画方面也尚且留有最后一点自信。偶尔会大胆地拿自信去换取虚荣,具体方式就是在内网发自己的画并且等待一些赞扬,也因此认识了不少朋友。Swan 是其中的一位,她告诉我她特别喜欢我在西溪北苑画的《蓝色失眠》: -.. figure:: /_assets/aw/abraxas-003.webp - :width: 60% - - :artwork:`蓝色失眠,draft` +.. artwork+embed:: abraxas-003 从飞书里有限的沟通我知道她 base 北京,是一个干练的产品经理,很手巧会钩针编织,热爱旅游会在世界各地潜水,符合我对光鲜亮丽的大厂人的美好生活的想象。八月的时候我在内网发离职文档,彼此交换了微信,并约好在北京有空吃个饭,算是建立了联系。 @@ -390,23 +347,24 @@ Swan 是我的前同事。22 年我还保留着画小创作的惯性,在画画 我开始变得柔软,全身的肌肉失去力气,视线开始模糊,脑袋也得昏昏沉沉。颤抖的双手不敢撕下面前的问号,双腿依然在往那边迈去。每天画素描的时候完全不在状态,我回忆起一些恐惧: -.. figure:: /_assets/aw/xfczk-010.webp - :width: 60% +.. artwork+embed:: xfczk-010 - :artwork:`下雪的 768` + .. figure:: /_assets/aw/{{ id }}.webp + :width: 60% + :align: center - 那时我的脑子里还没有辞职的念头,工作日的脑子装着代码和工单,只有周末才能假扮艺术家。每天夜里都有孤独的时候,醒来又是健全的一个人。 + {{ name }}, {{ id }}, {{ date }} - 现在的燕郊也下雪,脑子里是光和影子,看不懂的形体的和模糊的人影。我好像可以自诩艺术家,但无法称之为人了。每天要吃一大把的药,醒来和不醒来没有区别。 + {% for line in (content or '').split('\n') -%} + {{ line }} + {% endfor %} -恐惧让我心生犹豫,但我的预感又告诉我,这一天还是会到来: -.. figure:: /_assets/aw/bflv-013.webp - :width: 80% +恐惧让我心生犹豫,但我的预感又告诉我,这一天还是会到来: - :artwork:`bflv-013` +.. artwork+embed:: bflv-013 - 我想她不是海鸥也不是我,她是一头孤零零的小熊吧。 +我想她不是海鸥也不是我,她是一头孤零零的小熊吧。 Swan 说,*这张画作为小创作过于直白,作为表白又过于含蓄*,我深以为然。 diff --git a/src/notes/zxsys/way-to-artist/find-yourself.rst b/src/notes/zxsys/way-to-artist/find-yourself.rst index 05cd10503..1d10b5cf3 100644 --- a/src/notes/zxsys/way-to-artist/find-yourself.rst +++ b/src/notes/zxsys/way-to-artist/find-yourself.rst @@ -207,18 +207,18 @@ I Should :medium: 炭精粉 色粉笔 :album: album-32k-1 -这应该是第一张用碳粉画的完整夜景。 + 这应该是第一张用碳粉画的完整夜景。 -2019 年 11 月 29 日,我还在 768 上班,那天应该是周五下班,和同事准备出门吃饭。 -天上扬着小雪,只有灯照到的地方才能看到它们簌簌地落下。 + 2019 年 11 月 29 日,我还在 768 上班,那天应该是周五下班,和同事准备出门吃饭。 + 天上扬着小雪,只有灯照到的地方才能看到它们簌簌地落下。 -那时我的脑子里还没有辞职的念头,工作日的脑子装着代码和工单,只有周末才能假扮艺术家。 -每天夜里都有孤独的时候,醒来又是健全的一个人。 + 那时我的脑子里还没有辞职的念头,工作日的脑子装着代码和工单,只有周末才能假扮艺术家。 + 每天夜里都有孤独的时候,醒来又是健全的一个人。 -现在的燕郊也下雪,脑子里是光和影子,看不懂的形体的和可爱的人儿。我好像可以自诩 -艺术家,但无法称之为人了。每天要吃一大把的药,醒来和不醒来没有区别。 + 现在的燕郊也下雪,脑子里是光和影子,看不懂的形体的和可爱的人儿。我好像可以自诩 + 艺术家,但无法称之为人了。每天要吃一大把的药,醒来和不醒来没有区别。 -可爱的人儿将要离开。被她驱走的孤独像黑暗一样蔓延回来,而此刻的我还一无所知。 + 可爱的人儿将要离开。被她驱走的孤独像黑暗一样蔓延回来,而此刻的我还一无所知。 一种玫瑰标本及其制备工艺 ------------------------ From 6d7f5dcafdbe92dd60ce977b69aca9276758b7e8 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Fri, 6 Feb 2026 22:32:10 +0800 Subject: [PATCH 08/13] [conf] A lot of schemas fixes --- blobs | 2 +- confs/schemas.py | 13 ++++++++----- confs/templates/gallery.rst | 2 +- confs/templates/leetcode.rst | 2 +- confs/templates/okr.rst | 2 +- src/about/me.rst | 2 +- src/blog/2024-changelog.rst | 2 +- src/collections/art-works/index.rst | 2 +- src/collections/devices/instruments.rst | 2 +- src/index.rst | 1 - src/jour/2022/05.rst | 4 ++-- src/jour/2022/06.rst | 4 ++-- src/jour/2022/07.rst | 4 ++-- src/jour/2024/03.rst | 4 ++-- src/jour/2024/04.rst | 2 +- src/notes/man/linux-ops.rst | 2 +- 16 files changed, 26 insertions(+), 24 deletions(-) diff --git a/blobs b/blobs index 101021423..3334b9fe6 160000 --- a/blobs +++ b/blobs @@ -1 +1 @@ -Subproject commit 10102142369cdd5739066c4df74e08a64cc6ac0f +Subproject commit 3334b9fe6f31f4e93ec65b4feef71097358c4d4e diff --git a/confs/schemas.py b/confs/schemas.py index 859e6cc66..08f478a1f 100644 --- a/confs/schemas.py +++ b/confs/schemas.py @@ -28,8 +28,8 @@ 'attrs': { 'isbn': 'str, uniq, ref', 'status': 'str, ref', - 'startat': 'words of str, ref', - 'endat': 'words of str, ref', + 'startat': 'words of date, ref, index by year', + 'endat': 'words of date, ref, index by year', }, }, 'templates': { @@ -68,6 +68,7 @@ 'templates': { 'obj': open('confs/templates/artist.rst', 'r').read(), 'ref': '🧑‍🎨{{ name[0] }}', + 'header': '{{ name[0] }}', }, }, 'gallery': { @@ -79,7 +80,8 @@ }, 'templates': { 'obj': open('confs/templates/gallery.rst', 'r').read(), - 'ref': '🖼️{{ name }}', + 'ref': '🖼️{{ name[0] }}', + 'header': '{{ name[0] }}', }, }, 'event': { @@ -125,6 +127,7 @@ 'templates': { 'obj': open('confs/templates/term.rst', 'r').read(), 'ref': '#️⃣{{ name[0] }}', + 'ref': '#️⃣{{ name[0] }}', }, }, 'jour': { @@ -198,8 +201,8 @@ 'web': 'str', 'man': 'str', 'price': 'str', - 'startat': 'str, ref', - 'endat': 'str, ref', + 'startat': 'date, ref, index by year', + 'endat': 'date, ref, index by year', }, }, 'templates': { diff --git a/confs/templates/gallery.rst b/confs/templates/gallery.rst index b4995b1e6..0d4eb695f 100644 --- a/confs/templates/gallery.rst +++ b/confs/templates/gallery.rst @@ -1,4 +1,4 @@ :网站: {{ website }} -:艺术家: :artist.gallery:`{{ title }}` +:艺术家: :artist.gallery:`{{ name[0] }}` {{ content }} diff --git a/confs/templates/leetcode.rst b/confs/templates/leetcode.rst index 760675fcc..789822772 100644 --- a/confs/templates/leetcode.rst +++ b/confs/templates/leetcode.rst @@ -2,7 +2,7 @@ :难度: :leetcode.diffculty:`{{ diffculty }} <{{ diffculty }}>` :语言: {% for l in language %}:leetcode.language:`{{ l }} <{{ l }}>` {% endfor %} {% if key %}:思路: {% for k in key %}:leetcode.key:`{{ k }} <{{ k }}>` {% endfor %}{% endif %} -{% if date %}:日期: {% for d in date %}:leetcode.date+by-month:`{{ d }} <{{ d }}>` {% endfor %}{% endif %} +{% if date %}:日期: {% for d in date %}:leetcode.date+by-year:`{{ d }} <{{ d }}>` {% endfor %}{% endif %} {% if reference %}:参考: {{ reference }}{% endif %} .. dropdown:: 题解 diff --git a/confs/templates/okr.rst b/confs/templates/okr.rst index f01bfdea5..880b351c7 100644 --- a/confs/templates/okr.rst +++ b/confs/templates/okr.rst @@ -1,4 +1,4 @@ -:编号: :okr.id+by-path:`{{ id.split('-') | first }} <{{ id }}>`\ ``-{{ id.split('-', maxsplit=1) | first }}`` +:编号: :okr.id+by-hyphen2:`{{ id.split('-') | first }} <{{ id }}>`\ ``-{{ id.split('-', maxsplit=1) | first }}`` :优先级: {% if p0 is defined %}|p0|{% elif p1 is defined %}|p1|{% else %}|p2|{% endif %} {% if id.count('-') == 2 %}:对齐: :okr:`{{ id.rsplit('-', maxsplit=1)[0] }}`{% endif %} diff --git a/src/about/me.rst b/src/about/me.rst index 66c7b5fa6..06b33e5c0 100644 --- a/src/about/me.rst +++ b/src/about/me.rst @@ -19,7 +19,7 @@ SilverRainZ I am... :a programmer: I am SilverRainZ__ on GitHub, checkout my resume__ if you are interested -:an artist on the road: my :ref:`works ` are listed here, todo: portfolio +:an artist on the road: my :ref:`works ` are listed here, todo: portfolio :a |linux| user: also a member of `Arch Linux CN Community`__ :an |oss| author: I created `Srain IRC Client`__, `Sphinx Notes`__ and `more...`__ diff --git a/src/blog/2024-changelog.rst b/src/blog/2024-changelog.rst index 831d056a6..142be9d63 100644 --- a/src/blog/2024-changelog.rst +++ b/src/blog/2024-changelog.rst @@ -514,7 +514,7 @@ Sphinx Notes 过家家 今年加强了索引功能,在支持了日期索引和路径索引,现在可以: - 按时间顺序来浏览我的画::ref:`any-artwork.date+by-year` - - 按系列来浏览我的画::ref:`any-artwork.id+by-path` + - 按系列来浏览我的画::ref:`any-artwork.id+by-hyphen` :pypi:`sphinxnotes-snippet`:从命令行快速访问 Sphinx 文档 因为 1. 文档写的很糟糕 + 2. 只对中文文档有优势 + 3. 配置麻烦,所以完全没有其他用户在用。 diff --git a/src/collections/art-works/index.rst b/src/collections/art-works/index.rst index eec1330a3..04bbd6255 100644 --- a/src/collections/art-works/index.rst +++ b/src/collections/art-works/index.rst @@ -15,7 +15,7 @@ Art Works ======== ================================ 索引类型 索引页面 -------- -------------------------------- -编号 :ref:`any-artwork.id+by-path` +编号 :ref:`any-artwork.id+by-hyphen` 媒介 :ref:`any-artwork.medium` 尺幅 :ref:`any-artwork.size` 时间 :ref:`any-artwork.date+by-year` diff --git a/src/collections/devices/instruments.rst b/src/collections/devices/instruments.rst index 0b396c2dd..d2c811ad9 100644 --- a/src/collections/devices/instruments.rst +++ b/src/collections/devices/instruments.rst @@ -109,7 +109,7 @@ Tha Editor Linux 声卡驱动 :del:`可喜可贺,在我的 Arch Linux 上开箱即用`。 - 似乎要安装 :pacman:`alsa-firmware`。 + 似乎要安装 :archpkg:`alsa-firmware`。 USB 输出不经过效果器链 在 Ardour 听录制的内容时,感觉输出信号大小不受 ``GAIN`` 和 ``MASTER`` 影响, diff --git a/src/index.rst b/src/index.rst index 0ba7e0458..6d69703e8 100644 --- a/src/index.rst +++ b/src/index.rst @@ -46,7 +46,6 @@ in/inbox/index in/gtd/okr/index in/ops/index - in/loveletters/index .. grid:: :gutter: 2 diff --git a/src/jour/2022/05.rst b/src/jour/2022/05.rst index ede5c2a21..aae73e94a 100644 --- a/src/jour/2022/05.rst +++ b/src/jour/2022/05.rst @@ -8,7 +8,7 @@ 分布式系统的两大难题 ==================== -.. jour:: _ +.. jour: _ :date: 2022-05-18 :category: joke @@ -21,7 +21,7 @@ Vim 中比较两个 buffer ===================== -.. jour:: _ +.. jour: _ :date: 2022-05-18 在待比较的 buffer 中分别执行 `:diffthis` 即可,对于未命名的 buffer 也同样有效。 diff --git a/src/jour/2022/06.rst b/src/jour/2022/06.rst index e31a3d3f3..64caba209 100644 --- a/src/jour/2022/06.rst +++ b/src/jour/2022/06.rst @@ -8,7 +8,7 @@ 好吃的番茄炒蛋 ============== -.. jour:: _ +.. jour: _ :date: 2022-06-07 上周(5.29)和 YY 做了一顿饭,两个菜,一个是番茄炒蛋,一个是生菜牛丸汤,后者因为牛丸牛杂都是现成的,所以煮一起就好了。 @@ -40,7 +40,7 @@ __ https://item.jd.com/100000666658.html Srain 的域名迁移到 srian.silverrainz.me ======================================== -.. jour:: _ +.. jour: _ :date: 2022-06-18 17 年的时候我在 phoenixlzx__ 的 Cat Networks 买下 srain.im 这个域名,用于 :ghrepo:`SrainApp/srain` 的各个站点。 diff --git a/src/jour/2022/07.rst b/src/jour/2022/07.rst index 5840ec8e9..bbd786535 100644 --- a/src/jour/2022/07.rst +++ b/src/jour/2022/07.rst @@ -34,7 +34,7 @@ __ https://zhuanlan.zhihu.com/p/436454953 Linux 5.18+ 因声卡驱动问题无法休眠 ================================== -.. jour:: _ +.. jour: _ :date: 2022-07-08 `dmesg` 输出: @@ -69,7 +69,7 @@ __ https://bbs.archlinux.org/viewtopic.php?pid=2042801#p2042801 中年人的第一台 NAS ================== -.. jour:: _ +.. jour: _ :date: 2022-07-08 .. figure:: /_images/火狐截图_2022-07-12T16-26-32.235Z.png diff --git a/src/jour/2024/03.rst b/src/jour/2024/03.rst index a38cb6995..1a4f94f00 100644 --- a/src/jour/2024/03.rst +++ b/src/jour/2024/03.rst @@ -5,7 +5,7 @@ Switch Pro ========== -.. jour:: _ +.. jour: _ :date: 2024-03-24 5.16 以上的内核已默认支持 [#]_ ,长按 USB 口旁边的小按键,手柄的四个指示灯依次 @@ -24,7 +24,7 @@ Steam 的 :menuselection:`设置 --> 控制器` 里可对其进行测试、配 Yamaha THR5a ============ -.. jour:: _ +.. jour: _ :date: 2024-03-24 .. note:: moved to :dev:`Yamaha THR5a`. diff --git a/src/jour/2024/04.rst b/src/jour/2024/04.rst index c17d378d8..dabd5d4f2 100644 --- a/src/jour/2024/04.rst +++ b/src/jour/2024/04.rst @@ -5,7 +5,7 @@ 《夜晚的水母不会游泳》第一集 ============================ -.. jour:: _ +.. jour: _ :date: 2024-04-09 4 月,据说是原创番。很文艺的标题于是点开看。短视频、网红、带货、画手、偶像, diff --git a/src/notes/man/linux-ops.rst b/src/notes/man/linux-ops.rst index 250e02b63..966378ac8 100644 --- a/src/notes/man/linux-ops.rst +++ b/src/notes/man/linux-ops.rst @@ -2,7 +2,7 @@ Linux 运维 Cheat Sheet ====================== -.. seealso:: 特定机器上的运维手册参见 :doc:`/in/ops/` +.. seealso:: 特定机器上的运维手册参见 :doc:`/in/homelab` 磁盘管理 ======== From 78ead7b7dd26012ff8db6ca64226d0ca7e2a513e Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Sat, 7 Feb 2026 12:22:09 +0800 Subject: [PATCH 09/13] [confs] Fix book schema --- confs/schemas.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/confs/schemas.py b/confs/schemas.py index 08f478a1f..a069236e7 100644 --- a/confs/schemas.py +++ b/confs/schemas.py @@ -25,6 +25,7 @@ }, 'book': { 'schema': { + 'name': 'lines of str, required, uniq, ref', 'attrs': { 'isbn': 'str, uniq, ref', 'status': 'str, ref', @@ -34,7 +35,8 @@ }, 'templates': { 'obj': open('confs/templates/book.rst', 'r').read(), - 'ref': '《{{ name }}》', + 'ref': '《{{ name[0] }}》', + 'header': '{{ name[0] }}', }, }, 'artwork': { From 3f5aef2d25bfc496ec6f67db9219b22c1a379ec4 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Sat, 7 Feb 2026 12:24:59 +0800 Subject: [PATCH 10/13] [skip-recentupdate] 2026-02-07 12:24 --- src/index.rst | 2 +- src/notes/man/linux-ops.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.rst b/src/index.rst index 6d69703e8..5f575f94e 100644 --- a/src/index.rst +++ b/src/index.rst @@ -45,7 +45,7 @@ in/inbox/index in/gtd/okr/index - in/ops/index + in/homelab/index .. grid:: :gutter: 2 diff --git a/src/notes/man/linux-ops.rst b/src/notes/man/linux-ops.rst index 966378ac8..c5f913e69 100644 --- a/src/notes/man/linux-ops.rst +++ b/src/notes/man/linux-ops.rst @@ -27,5 +27,5 @@ https://wiki.archlinux.org/title/S.M.A.R.T 透明计算 ======== -.. seealso:: :doc:`/in/ops/` +.. seealso:: :doc:`/in/homelab/` From 313893a0f3d51f11786fe6b996d676e9a51d2ab5 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Sat, 7 Feb 2026 14:24:55 +0800 Subject: [PATCH 11/13] [conf] Improve fetch_artwork filter error report --- confs/fetch_artwork.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/confs/fetch_artwork.py b/confs/fetch_artwork.py index 90914fc4f..97dc103ec 100644 --- a/confs/fetch_artwork.py +++ b/confs/fetch_artwork.py @@ -24,9 +24,17 @@ def _filter(id_: str) -> str | None: imgdir = env.srcdir.joinpath(imgdir) if Deployment.current() == Deployment.Local: try: - subprocess.run(['/home/la/sync/latree/bin/artworks', 'fetch', id_, imgdir]) + result = subprocess.run(['/home/la/sync/latree/bin/artworks', 'fetch', id_, imgdir]) except Exception as e: - logger.warning('failed to fetch artwork: %s', e) + errmsg = str(e) + else: + if result.returncode == 0: + errmsg = None + else: + errmsg = f'error code: {result.returncode}' + if errmsg: + logger.warning(f'failed to fetch arwork by ID {id_}: {errmsg}') + f = f'/{imgdir}/{id_}.webp' return f if path.exists(f) else None From 1822c297c794c3669824544ebc48adb784f70e18 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Sat, 7 Feb 2026 14:28:11 +0800 Subject: [PATCH 12/13] [skip-recentupdate] 2026-02-07 14:28 --- src/notes/artstory/index.rst | 2 +- src/notes/man/sphinx/index.rst | 1 + src/notes/zxsys/way-to-artist/index.rst | 1 - src/p/index.rst | 1 + 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/notes/artstory/index.rst b/src/notes/artstory/index.rst index 9fbec5293..422ab160d 100644 --- a/src/notes/artstory/index.rst +++ b/src/notes/artstory/index.rst @@ -4,6 +4,6 @@ .. toctree:: - artistory + artistory/index gallery gossip diff --git a/src/notes/man/sphinx/index.rst b/src/notes/man/sphinx/index.rst index ce928d825..f680cf2d8 100644 --- a/src/notes/man/sphinx/index.rst +++ b/src/notes/man/sphinx/index.rst @@ -7,6 +7,7 @@ Sphinx docutils how-sphinx-builder-works + how-sphinx-index-works .. highlight:: console diff --git a/src/notes/zxsys/way-to-artist/index.rst b/src/notes/zxsys/way-to-artist/index.rst index 66d21b06c..3a207a18f 100644 --- a/src/notes/zxsys/way-to-artist/index.rst +++ b/src/notes/zxsys/way-to-artist/index.rst @@ -16,7 +16,6 @@ find-language stealing exhibition - find-yourself2 1. 找自己 diff --git a/src/p/index.rst b/src/p/index.rst index 3e0f22c4d..bd2503326 100644 --- a/src/p/index.rst +++ b/src/p/index.rst @@ -49,3 +49,4 @@ __ http://www.winsornewton.com.cn/artisist-oil-forever-rose.htm :glob: * + ly/index From 5963b0b78c163246b6de97881ae5aef6609b7b77 Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Sat, 7 Feb 2026 15:01:46 +0800 Subject: [PATCH 13/13] [conf] term index by slash --- confs/schemas.py | 3 ++- confs/templates/term.rst | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/confs/schemas.py b/confs/schemas.py index a069236e7..df50c5a6d 100644 --- a/confs/schemas.py +++ b/confs/schemas.py @@ -6,6 +6,7 @@ INDEXER_REGSITRY['hyphen'] = PathIndexer('-', 1) INDEXER_REGSITRY['hyphen2'] = PathIndexer('-', 2) +INDEXER_REGSITRY['slash'] = PathIndexer('/', 1) OBJECT_TYPES = { 'friend': { @@ -120,7 +121,7 @@ 'schema': { 'name': 'lines of str, required, ref', 'attrs': { - 'field': 'str, ref, index by slash', # TODO: index by slash + 'field': 'str, ref, index by slash', 'enwiki': 'str', 'zhwiki': 'str', 'hide': 'bool', diff --git a/confs/templates/term.rst b/confs/templates/term.rst index 5704c5b0c..0da09f3a9 100644 --- a/confs/templates/term.rst +++ b/confs/templates/term.rst @@ -1,5 +1,5 @@ {% if hide -%} -{% if field %}:领域: :term.field+by-path:`{{ field }} <{{ field }}>`{% endif %} +{% if field %}:领域: :term.field+by-slash:`{{ field }} <{{ field }}>`{% endif %} {% if enwiki %}:维基: :enwiki:`{{ enwiki }}`{% endif %} {% if zhwiki %}:维基: :zhwiki:`{{ zhwiki }}`{% endif %} {%- endif %}