specitems 1.7.2__tar.gz → 1.7.4__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.
Files changed (33) hide show
  1. {specitems-1.7.2 → specitems-1.7.4}/PKG-INFO +1 -1
  2. {specitems-1.7.2 → specitems-1.7.4}/pyproject.toml +1 -1
  3. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/cite.py +18 -4
  4. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/contentcommonmark.py +3 -0
  5. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/spec.pickle +0 -0
  6. {specitems-1.7.2 → specitems-1.7.4}/README.md +0 -0
  7. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/__init__.py +0 -0
  8. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/clangformat.py +0 -0
  9. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/clihash.py +0 -0
  10. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/clipickle.py +0 -0
  11. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/clispecdoc.py +0 -0
  12. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/clitypeview.py +0 -0
  13. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/cliutil.py +0 -0
  14. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/cliverify.py +0 -0
  15. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/cliyamlquery.py +0 -0
  16. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/content.py +0 -0
  17. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/contentmarkdown.py +0 -0
  18. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/contentsphinx.py +0 -0
  19. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/contenttext.py +0 -0
  20. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/copyrights.py +0 -0
  21. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/getvaluesubprocess.py +0 -0
  22. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/glossary.py +0 -0
  23. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/hashutil.py +0 -0
  24. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/itemmapper.py +0 -0
  25. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/items.py +0 -0
  26. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/licenseinfo.py +0 -0
  27. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/py.typed +0 -0
  28. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/spdx.py +0 -0
  29. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/specconfig.py +0 -0
  30. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/specdoc.py +0 -0
  31. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/specformatter.py +0 -0
  32. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/specverify.py +0 -0
  33. {specitems-1.7.2 → specitems-1.7.4}/src/specitems/subprocessaction.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: specitems
3
- Version: 1.7.2
3
+ Version: 1.7.4
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
@@ -4,7 +4,7 @@
4
4
 
5
5
  [project]
6
6
  name = "specitems"
7
- version = "1.7.2"
7
+ version = "1.7.4"
8
8
  description = "Provides interfaces to work with specification items."
9
9
  authors = [
10
10
  {name = "The specitems Authors", email = "specthings@embedded-brains.de"}
@@ -84,6 +84,9 @@ class ReferenceTarget:
84
84
  #: The path of the area relative to the base URL of the work.
85
85
  path: str
86
86
 
87
+ #: The anchor of the area within the page of the work.
88
+ anchor: Optional[str]
89
+
87
90
  #: The URL of the area. The caller substitutes it in the context of the
88
91
  #: work.
89
92
  url: Optional[str]
@@ -109,7 +112,10 @@ def get_reference_target(item: Item,
109
112
 
110
113
  The attributes of the optional reference link take precedence over the
111
114
  attributes of the reference location. The paths of the reference location
112
- and the reference link are concatenated.
115
+ and the reference link are concatenated. The anchor comes from the first
116
+ of the reference link and the reference location which has an anchor or a
117
+ label. An anchor attribute gives the anchor, otherwise the label yields
118
+ it.
113
119
  """
114
120
  work = get_reference_work(item)
115
121
  link_data = {} if link is None else link.data
@@ -118,12 +124,20 @@ def get_reference_target(item: Item,
118
124
  label = link_data.get("label", area.get("label"))
119
125
  location = link_data.get("location", area.get("location"))
120
126
  path = f"{area.get('path', '')}{link_data.get('path', '')}"
127
+ anchor: Optional[str] = None
128
+ for data in (link_data, area):
129
+ if "anchor" in data:
130
+ anchor = data["anchor"]
131
+ break
132
+ if "label" in data:
133
+ anchor = make_anchor(data["label"])
134
+ break
121
135
  base = work.get("work-base-url")
122
136
  url: Optional[str] = None
123
137
  if base is not None:
124
- anchor = "" if label is None else f"#{make_anchor(label)}"
125
- url = f"{base}{path}{anchor}"
126
- return ReferenceTarget(work, name, label, location, path, url)
138
+ fragment = "" if anchor is None else f"#{anchor}"
139
+ url = f"{base}{path}{fragment}"
140
+ return ReferenceTarget(work, name, label, location, path, anchor, url)
127
141
 
128
142
 
129
143
  def _get_fields(item: Item) -> tuple[str, _Fields]:
@@ -108,6 +108,9 @@ class CommonMarkContent(MarkdownContent):
108
108
  elif cell == COL_SPAN:
109
109
  col_span += 1
110
110
  else:
111
+ # The cell is the first column of a covered cell. It ends
112
+ # the column span.
113
+ col_span = 1
111
114
  row_span[col_index] += 1
112
115
  lines.appendleft(f" <tr>{line}")
113
116
  lines.appendleft("<table>")
index b435472..2313266 100644
Binary file
File without changes