specitems 1.2.0__tar.gz → 1.2.2__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.
- {specitems-1.2.0 → specitems-1.2.2}/PKG-INFO +1 -1
- {specitems-1.2.0 → specitems-1.2.2}/pyproject.toml +1 -1
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/cite.py +6 -3
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/spec.pickle +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/README.md +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/__init__.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/clihash.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/clipickle.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/clispecdoc.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/cliutil.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/cliyamlquery.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/content.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/contentmarkdown.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/contentsphinx.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/contenttext.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/getvaluesubprocess.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/glossary.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/hashutil.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/itemmapper.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/items.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/py.typed +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/specdoc.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/specverify.py +0 -0
- {specitems-1.2.0 → specitems-1.2.2}/src/specitems/subprocessaction.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: specitems
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Summary: Provides interfaces to work with specification items.
|
|
5
5
|
Keywords: certification,documentation,markdown,qualification,requirements-management,traceability
|
|
6
6
|
Author: The specitems Authors
|
|
@@ -103,6 +103,10 @@ class BibTeXCitationProvider(ItemValueProvider):
|
|
|
103
103
|
else:
|
|
104
104
|
self._get_fields[type_path] = get_fields
|
|
105
105
|
|
|
106
|
+
def get_fields(self, item: Item) -> tuple[str, _Fields]:
|
|
107
|
+
""" Get the BibTeX type and fields of the item. """
|
|
108
|
+
return self._get_fields.get(item.type, _get_fields)(item)
|
|
109
|
+
|
|
106
110
|
def add_get_fields(self, item_type: str, get_fields: _GetFields) -> None:
|
|
107
111
|
""" Add the get fields method for the item type. """
|
|
108
112
|
self.mapper.add_get_value(f"{item_type}:/cite", self._get_cite)
|
|
@@ -116,8 +120,7 @@ class BibTeXCitationProvider(ItemValueProvider):
|
|
|
116
120
|
def add_bibtex_entries(self, content: TextContent) -> None:
|
|
117
121
|
""" Add BibTeX entries for the collected citations to the content. """
|
|
118
122
|
for item in sorted(self._citations):
|
|
119
|
-
publication_type, fields = self.
|
|
120
|
-
item.type, _get_fields)(item)
|
|
123
|
+
publication_type, fields = self.get_fields(item)
|
|
121
124
|
for key in _PERSONS.intersection(fields.keys()):
|
|
122
125
|
if isinstance(fields[key], list):
|
|
123
126
|
fields[key] = " and ".join(fields[key])
|
|
@@ -140,7 +143,7 @@ class BibTeXCitationProvider(ItemValueProvider):
|
|
|
140
143
|
|
|
141
144
|
def _get_cite_long(self, ctx: ItemGetValueContext) -> str:
|
|
142
145
|
self._citations.add(ctx.item)
|
|
143
|
-
_, fields = self.
|
|
146
|
+
_, fields = self.get_fields(ctx.item)
|
|
144
147
|
assert isinstance(self.mapper, TextMapper)
|
|
145
148
|
content = self.mapper.create_content()
|
|
146
149
|
title = fields["title"]
|
|
index fcb9985..bd2f0e9 100644
|
|
|
Binary file
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|