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.
- {uedition-2.0.0 → uedition-2.0.0b2}/PKG-INFO +1 -1
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/pyproject.toml +1 -1
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/static/pyproject.toml +1 -1
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/__about__.py +1 -1
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/settings.py +1 -12
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/tei/parser.py +17 -30
- {uedition-2.0.0 → uedition-2.0.0b2}/.github/dependabot.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/.github/workflows/codestyle.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/.github/workflows/coverage.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/.github/workflows/release.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/.github/workflows/tests.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/.gitignore +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/.pre-commit-config.yaml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/.readthedocs.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/LICENSE.txt +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/README.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/.gitignore +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/.readthedocs.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/changelog.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/configuration.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/content.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/create.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/index.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/installation.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/language-add.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/publish.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/getting-started/update.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/de/index.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/changelog.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/configuration.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/content.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/create.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/index.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/installation.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/language-add.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/publish.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/update.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/getting-started/working-with-tei.tei +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/en/index.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/static/overrides.css +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/toc.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/docs/uEdition.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/pyproject.toml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/__init__.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/conftest.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/basic/uEdition.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/empty/.gitkeep +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/.gitignore +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/de/a-1-page.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/de/a-2-page.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/de/a-page.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/de/b-page.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/de/intro.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/en/a-1-page.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/en/a-2-page.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/en/a-page.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/en/b-page.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/en/intro.md +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/references.bib +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/toc.yml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/multilang/uEdition.yaml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/fixtures/yaml/uEdition.yaml +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_about.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_build.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_ext/test_tei/__init__.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_ext/test_tei/test_parser.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_language.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_serve.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_settings.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tests/test_update.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/tox.ini +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/__init__.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/__main__.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/__init__.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/base.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/build.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/init.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/language.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/migrate.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/serve.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/cli/update.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/__init__.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/config.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/language_switcher.css +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/language_switcher.js +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/language_switcher.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/tei/__init__.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/tei/builder.py +0 -0
- {uedition-2.0.0 → uedition-2.0.0b2}/uedition/ext/tei/tei_download.js +0 -0
- {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.
|
|
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<
|
|
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.
|
|
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]
|
|
@@ -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:
|
|
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"]
|
|
104
|
-
|
|
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",
|
|
134
|
-
"""Create a sortkey that understands about
|
|
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(
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
for
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|