uEdition 2.0.0__tar.gz → 2.0.0b2__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 (90) hide show
  1. {uedition-2.0.0 → uedition-2.0.0b2}/PKG-INFO +1 -1
  2. {uedition-2.0.0 → uedition-2.0.0b2}/docs/pyproject.toml +1 -1
  3. {uedition-2.0.0 → uedition-2.0.0b2}/docs/static/pyproject.toml +1 -1
  4. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/__about__.py +1 -1
  5. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/settings.py +1 -12
  6. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/tei/parser.py +17 -30
  7. {uedition-2.0.0 → uedition-2.0.0b2}/.github/dependabot.yml +0 -0
  8. {uedition-2.0.0 → uedition-2.0.0b2}/.github/workflows/codestyle.yml +0 -0
  9. {uedition-2.0.0 → uedition-2.0.0b2}/.github/workflows/coverage.yml +0 -0
  10. {uedition-2.0.0 → uedition-2.0.0b2}/.github/workflows/release.yml +0 -0
  11. {uedition-2.0.0 → uedition-2.0.0b2}/.github/workflows/tests.yml +0 -0
  12. {uedition-2.0.0 → uedition-2.0.0b2}/.gitignore +0 -0
  13. {uedition-2.0.0 → uedition-2.0.0b2}/.pre-commit-config.yaml +0 -0
  14. {uedition-2.0.0 → uedition-2.0.0b2}/.readthedocs.yml +0 -0
  15. {uedition-2.0.0 → uedition-2.0.0b2}/LICENSE.txt +0 -0
  16. {uedition-2.0.0 → uedition-2.0.0b2}/README.md +0 -0
  17. {uedition-2.0.0 → uedition-2.0.0b2}/docs/.gitignore +0 -0
  18. {uedition-2.0.0 → uedition-2.0.0b2}/docs/.readthedocs.yml +0 -0
  19. {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/changelog.md +0 -0
  20. {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/configuration.md +0 -0
  21. {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/content.md +0 -0
  22. {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/create.md +0 -0
  23. {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/index.md +0 -0
  24. {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/installation.md +0 -0
  25. {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/language-add.md +0 -0
  26. {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/publish.md +0 -0
  27. {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/update.md +0 -0
  28. {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/index.md +0 -0
  29. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/changelog.md +0 -0
  30. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/configuration.md +0 -0
  31. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/content.md +0 -0
  32. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/create.md +0 -0
  33. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/index.md +0 -0
  34. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/installation.md +0 -0
  35. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/language-add.md +0 -0
  36. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/publish.md +0 -0
  37. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/update.md +0 -0
  38. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/working-with-tei.tei +0 -0
  39. {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/index.md +0 -0
  40. {uedition-2.0.0 → uedition-2.0.0b2}/docs/static/overrides.css +0 -0
  41. {uedition-2.0.0 → uedition-2.0.0b2}/docs/toc.yml +0 -0
  42. {uedition-2.0.0 → uedition-2.0.0b2}/docs/uEdition.yml +0 -0
  43. {uedition-2.0.0 → uedition-2.0.0b2}/pyproject.toml +0 -0
  44. {uedition-2.0.0 → uedition-2.0.0b2}/tests/__init__.py +0 -0
  45. {uedition-2.0.0 → uedition-2.0.0b2}/tests/conftest.py +0 -0
  46. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/basic/uEdition.yml +0 -0
  47. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/empty/.gitkeep +0 -0
  48. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/.gitignore +0 -0
  49. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/de/a-1-page.md +0 -0
  50. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/de/a-2-page.md +0 -0
  51. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/de/a-page.md +0 -0
  52. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/de/b-page.md +0 -0
  53. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/de/intro.md +0 -0
  54. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/en/a-1-page.md +0 -0
  55. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/en/a-2-page.md +0 -0
  56. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/en/a-page.md +0 -0
  57. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/en/b-page.md +0 -0
  58. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/en/intro.md +0 -0
  59. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/references.bib +0 -0
  60. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/toc.yml +0 -0
  61. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/uEdition.yaml +0 -0
  62. {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/yaml/uEdition.yaml +0 -0
  63. {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_about.py +0 -0
  64. {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_build.py +0 -0
  65. {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_ext/test_tei/__init__.py +0 -0
  66. {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_ext/test_tei/test_parser.py +0 -0
  67. {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_language.py +0 -0
  68. {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_serve.py +0 -0
  69. {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_settings.py +0 -0
  70. {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_update.py +0 -0
  71. {uedition-2.0.0 → uedition-2.0.0b2}/tox.ini +0 -0
  72. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/__init__.py +0 -0
  73. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/__main__.py +0 -0
  74. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/__init__.py +0 -0
  75. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/base.py +0 -0
  76. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/build.py +0 -0
  77. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/init.py +0 -0
  78. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/language.py +0 -0
  79. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/migrate.py +0 -0
  80. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/serve.py +0 -0
  81. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/update.py +0 -0
  82. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/__init__.py +0 -0
  83. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/config.py +0 -0
  84. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/language_switcher.css +0 -0
  85. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/language_switcher.js +0 -0
  86. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/language_switcher.py +0 -0
  87. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/tei/__init__.py +0 -0
  88. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/tei/builder.py +0 -0
  89. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/tei/tei_download.js +0 -0
  90. {uedition-2.0.0 → uedition-2.0.0b2}/uedition/settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uEdition
3
- Version: 2.0.0
3
+ Version: 2.0.0b2
4
4
  Project-URL: Documentation, https://github.com/uEdition/uEdition#readme
5
5
  Project-URL: Issues, https://github.com/uEdition/uEdition/issues
6
6
  Project-URL: Source, https://github.com/uEdition/uEdition
@@ -18,7 +18,7 @@ Issues = "https://github.com/uEdition/uEdition/-/issues"
18
18
  Source = "https://github.com/uEdition/uEdition/-"
19
19
 
20
20
  [tool.hatch.envs.default]
21
- dependencies = ["uedition<3,>=2.0.0", "uedition_editor>=2.0.0b5,<2.1"]
21
+ dependencies = ["uedition<2.1,>=2.0.0b1", "uedition_editor>=2.0.0b5,<2.1"]
22
22
  skip-install = true
23
23
 
24
24
  [tool.hatch.envs.default.scripts]
@@ -18,7 +18,7 @@ Issues = "http://edition.com"
18
18
  Source = "http://edition.com"
19
19
 
20
20
  [tool.hatch.envs.default]
21
- dependencies = ["uEdition<3,>=2.0.0b5", "uEdition-Editor<3,>=2.0.0b6"]
21
+ dependencies = ["uEdition<3,>=2.0.0b1", "uEdition-Editor<3,>=2.0.0b6"]
22
22
  skip-install = true
23
23
 
24
24
  [tool.hatch.envs.default.scripts]
@@ -3,4 +3,4 @@
3
3
  # SPDX-License-Identifier: MIT
4
4
  """About this package."""
5
5
 
6
- __version__ = "2.0.0"
6
+ __version__ = "2.0.0b2"
@@ -49,8 +49,6 @@ class TEINode(BaseModel):
49
49
  """Where to get the text from."""
50
50
  content: str | None = None
51
51
  """Allowed child nodes. Only relevant for block nodes."""
52
- weight: int | None = None
53
- """Weight of the node to determine nesting. Only used for mark nodes."""
54
52
 
55
53
 
56
54
  class TEIMetadataSectionSingleFieldRule(BaseModel):
@@ -108,15 +106,6 @@ class TEITextSection(BaseModel):
108
106
  """The XPath selector to retrieve this section."""
109
107
 
110
108
 
111
- class TEITextListSectionSort(BaseModel):
112
- """Configuration for sorting a multiple text section."""
113
-
114
- selector: str
115
- """The XPath selector for the element to use for sorting."""
116
- order: Literal["alpha"] | Literal["numeric"] | Literal["page,line"] = "alpha"
117
- """The sorting algorithm to use"""
118
-
119
-
120
109
  class TEITextListSection(BaseModel):
121
110
  """A section in the TEI document containing multiple texts."""
122
111
 
@@ -128,7 +117,7 @@ class TEITextListSection(BaseModel):
128
117
  """The type must be set to textlist."""
129
118
  selector: str
130
119
  """The XPath selector to retrieve the texts in this section."""
131
- sort: TEITextListSectionSort | None = None
120
+ sort: str | None = None
132
121
 
133
122
 
134
123
  class TEISettings(BaseModel):
@@ -100,8 +100,8 @@ class TEIParser(SphinxParser):
100
100
  # Process a text section
101
101
  sources = root.xpath(conf_section["selector"], namespaces=namespaces)
102
102
  if len(sources) > 0:
103
- if conf_section["sort"] is not None:
104
- sources.sort(key=self._sort_key(conf_section["sort"]))
103
+ if conf_section["sort"]:
104
+ source.sort(key=self._sort_key(conf_section["sort"]))
105
105
  doc_section.append(section)
106
106
  for source in sources:
107
107
  tmp = None
@@ -130,40 +130,27 @@ class TEIParser(SphinxParser):
130
130
  self._parse_download_field(fields, field, sources[0])
131
131
  document.append(doc_section)
132
132
 
133
- def _sort_key(self: "TEIParser", sort: dict) -> Callable[[etree.Element], tuple]:
134
- """Create a sortkey that understands about various sorting patterns."""
133
+ def _sort_key(self: "TEIParser", xpath: str) -> Callable[[etree.Element], tuple[tuple[int, ...], ...]]:
134
+ """Create a sortkey that understands about `page,line` patterns for sorting."""
135
135
 
136
- def sorter(node: etree.Element) -> tuple:
137
- value = node.xpath(sort["selector"], namespaces=namespaces)
136
+ def sorter(node: etree.Element) -> tuple[tuple[int, ...], ...]:
137
+ value = node.xpath(xpath, namespaces=namespaces)
138
138
  if value is not None and len(value) > 0:
139
139
  if isinstance(value, list):
140
140
  value = value[0]
141
141
  else:
142
142
  value = str(value)
143
- if sort["order"] == "page,line":
144
- match = re.match("([0-9-,]+).*", value)
145
- if match is not None:
146
- order = []
147
- for value in match.group(1).split(","):
148
- for value2 in value.split("-"):
149
- order.append(int(value2))
150
- return tuple(order)
151
- else:
152
- return (0,)
153
- elif sort["order"] == "numeric":
154
- match = re.match("([0-9]+).*", value)
155
- if match is not None:
156
- return (int(match.group(1)),)
157
- else:
158
- return (0,)
159
- else:
160
- return (value, "")
161
- if sort["order"] == "page,line":
162
- return (0,)
163
- elif sort["order"] == "numeric":
164
- return (0,)
165
- else:
166
- return ("",)
143
+ match = re.match("[0-9-,]+", value)
144
+ if match is not None:
145
+ order = []
146
+ for part in value.split("-"):
147
+ tpl = tuple([int(v) for v in part.split(",")])
148
+ if len(order) > 0 and len(order[-1]) > len(tpl):
149
+ order.append(tuple(list(order[-1][: -len(tpl)]) + list(tpl)))
150
+ else:
151
+ order.append(tpl)
152
+ return tuple(order)
153
+ return ((0,),)
167
154
 
168
155
  return sorter
169
156
 
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