fixed the header / structural elements export syntax
This commit is contained in:
parent
e3f41eee43
commit
77475d3414
|
|
@ -335,7 +335,7 @@ class SeContainer(BaseContainer):
|
||||||
type = "structural_elements"
|
type = "structural_elements"
|
||||||
|
|
||||||
def export(self, exm):
|
def export(self, exm):
|
||||||
self.subtype = self[0].content[0]
|
self.subtype = "se_"+self[0].content[0]
|
||||||
return super().export(exm)
|
return super().export(exm)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
structural_elements:
|
structural_elements:
|
||||||
div: ["<div{optionals}>", "</div>"]
|
se_div: ["<div{optionals}>", "</div>"]
|
||||||
article: ["<article{optionals}>", "</article>"]
|
se_article: ["<article{optionals}>", "</article>"]
|
||||||
aside: ["<aside{optionals}>", "</aside>"]
|
se_aside: ["<aside{optionals}>", "</aside>"]
|
||||||
section: ["<section{optionals}>", "</section>"]
|
se_section: ["<section{optionals}>", "</section>"]
|
||||||
|
se_nav: ["<nav{optionals}>", "</nav>"]
|
||||||
|
se_header: ["<header{optionals}>", "</header>"]
|
||||||
|
se_body: ["<body{optionals}>", "</body>"]
|
||||||
header: ["<h{header_level}{optionals}>", "</h{header_level}>"]
|
header: ["<h{header_level}{optionals}>", "</h{header_level}>"]
|
||||||
display: ["<p class=\"display-{display_level}\"{optionals}>", "</p>"]
|
display: ["<p class=\"display-{display_level}\"{optionals}>", "</p>"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,14 @@ __templates = config.ConfigLoader(pathresolver.b_path("templates/"))
|
||||||
__XF = pytest.mark.xfail
|
__XF = pytest.mark.xfail
|
||||||
_all_templates = {
|
_all_templates = {
|
||||||
"structural_elements": [
|
"structural_elements": [
|
||||||
["div", __GLk(1)],
|
["se_div", __GLk(1)],
|
||||||
["article", __GLk(1)],
|
["se_article", __GLk(1)],
|
||||||
["aside", __GLk(1)],
|
["se_aside", __GLk(1)],
|
||||||
["section", __GLk(1)],
|
["se_section", __GLk(1)],
|
||||||
["header", __GLk(1)],
|
["header", __GLk(1)],
|
||||||
["display", __GLk(1)],
|
["display", __GLk(1)],
|
||||||
|
["se_body", __GLk(1)],
|
||||||
|
["se_nav", __GLk(1)],
|
||||||
],
|
],
|
||||||
"inline_elements": [
|
"inline_elements": [
|
||||||
["link", __GLk(1)],
|
["link", __GLk(1)],
|
||||||
|
|
@ -86,7 +88,7 @@ def test_export_response():
|
||||||
("table", "t_head"),
|
("table", "t_head"),
|
||||||
("table", "t_row"),
|
("table", "t_row"),
|
||||||
("table", "t_cell"),
|
("table", "t_cell"),
|
||||||
("structural_elements", "div"),
|
("structural_elements", "se_div"),
|
||||||
])
|
])
|
||||||
def test_transform(export_type, export_subtype):
|
def test_transform(export_type, export_subtype):
|
||||||
"""
|
"""
|
||||||
|
|
@ -118,7 +120,7 @@ def test_get_template_error():
|
||||||
|
|
||||||
def test_with_optionnals():
|
def test_with_optionnals():
|
||||||
em = export.ExportManager(__config, __templates)
|
em = export.ExportManager(__config, __templates)
|
||||||
em(export.ExportRequest("structural_elements", "div", _opts)) # noqa E741
|
em(export.ExportRequest("structural_elements", "se_div", _opts)) # noqa E741
|
||||||
|
|
||||||
|
|
||||||
def test_format_optionnals():
|
def test_format_optionnals():
|
||||||
|
|
@ -147,6 +149,7 @@ def test_bad_header():
|
||||||
|
|
||||||
@pytest.mark.parametrize("export_type, export_subtype, line", zipped_templates)
|
@pytest.mark.parametrize("export_type, export_subtype, line", zipped_templates)
|
||||||
def test_get_templates(export_type, export_subtype, line):
|
def test_get_templates(export_type, export_subtype, line):
|
||||||
|
print(line)
|
||||||
em = export.ExportManager(__config, __templates)
|
em = export.ExportManager(__config, __templates)
|
||||||
# assert type(em.get_templates()) is dict
|
# assert type(em.get_templates()) is dict
|
||||||
print(export_type, export_subtype)
|
print(export_type, export_subtype)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue