Compare commits
No commits in common. "2961a61aa64957014149aca50101145cef361117" and "9bbb60c460911db021b53edd5ed6b388d039e67d" have entirely different histories.
2961a61aa6
...
9bbb60c460
5 changed files with 23 additions and 41 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
|
@ -1,14 +1,3 @@
|
||||||
## 0.2.0a35 (2025-10-27)
|
|
||||||
|
|
||||||
### Feat
|
|
||||||
|
|
||||||
- tags documentation
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
|
|
||||||
- add changelog support for github/gitlab format
|
|
||||||
- tests
|
|
||||||
|
|
||||||
## 0.2.0a34 (2025-10-22)
|
## 0.2.0a34 (2025-10-22)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail.output_doc"
|
name = "rougail.output_doc"
|
||||||
version = "0.2.0a35"
|
version = "0.2.0a34"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
description = "Rougail output doc"
|
description = "Rougail output doc"
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
__version__ = "0.2.0a35"
|
__version__ = "0.2.0a34"
|
||||||
|
|
|
||||||
|
|
@ -65,20 +65,6 @@ class Formater(CommonFormater):
|
||||||
"""Set a text to italic"""
|
"""Set a text to italic"""
|
||||||
return f"*{msg}*"
|
return f"*{msg}*"
|
||||||
|
|
||||||
def delete(
|
|
||||||
self,
|
|
||||||
msg: str,
|
|
||||||
) -> str:
|
|
||||||
"""Set a text to deleted"""
|
|
||||||
return f"~~{msg}~~"
|
|
||||||
|
|
||||||
def underline(
|
|
||||||
self,
|
|
||||||
msg: str,
|
|
||||||
) -> str:
|
|
||||||
"""Set a text to underline"""
|
|
||||||
return f"<ins>{msg}</ins>"
|
|
||||||
|
|
||||||
def stripped(
|
def stripped(
|
||||||
self,
|
self,
|
||||||
text: str,
|
text: str,
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@ os.environ['COLUMNS'] = '80'
|
||||||
test_ok = sorted(list((Path(__file__).parent / 'changelog').iterdir()))
|
test_ok = sorted(list((Path(__file__).parent / 'changelog').iterdir()))
|
||||||
# test_ok = [Path(__file__).parent / 'changelog' / '40_dynamic_mod_default1']
|
# test_ok = [Path(__file__).parent / 'changelog' / '40_dynamic_mod_default1']
|
||||||
|
|
||||||
EXT = {'github': 'md', 'asciidoc': 'adoc', 'json': 'json', 'console': 'sh', 'gitlab': 'gitlab.md', "html": "html"}
|
|
||||||
|
|
||||||
def idfn(fixture_value):
|
def idfn(fixture_value):
|
||||||
return fixture_value.name
|
return fixture_value.name
|
||||||
|
|
||||||
|
|
@ -36,21 +34,30 @@ def test_changelog(test_dir):
|
||||||
rougailconfig['main_namespace'] = None
|
rougailconfig['main_namespace'] = None
|
||||||
rougailconfig["step.output"] = "doc"
|
rougailconfig["step.output"] = "doc"
|
||||||
rougailconfig['main_structural_directories'] = [str(test_dir / "after" / "rougail" / "00-base.yml")]
|
rougailconfig['main_structural_directories'] = [str(test_dir / "after" / "rougail" / "00-base.yml")]
|
||||||
|
rougailconfig["doc.output_format"] = "asciidoc"
|
||||||
rougailconfig["doc.contents"] = ["changelog"]
|
rougailconfig["doc.contents"] = ["changelog"]
|
||||||
rougailconfig["doc.previous_json_file"] = str(destfile)
|
rougailconfig["doc.previous_json_file"] = str(destfile)
|
||||||
eolobj = Rougail(rougailconfig=rougailconfig)
|
eolobj = Rougail(rougailconfig=rougailconfig)
|
||||||
config = eolobj.run()
|
config = eolobj.run()
|
||||||
for output_format, ext in EXT.items():
|
result = RougailOutputDoc(config, rougailconfig=rougailconfig).run()[1]
|
||||||
if output_format == 'json':
|
output_file = test_dir / 'result.adoc'
|
||||||
continue
|
if not output_file.is_file():
|
||||||
rougailconfig["doc.output_format"] = output_format
|
with output_file.open('w') as outfh:
|
||||||
result = RougailOutputDoc(config, rougailconfig=rougailconfig).run()[1]
|
outfh.write(result)
|
||||||
output_file = test_dir / f'result.{ext}'
|
with output_file.open() as outfh:
|
||||||
if not output_file.is_file():
|
attented_output = outfh.read()
|
||||||
with output_file.open('w') as outfh:
|
assert result == attented_output, f'filename {output_file}'
|
||||||
outfh.write(result)
|
#
|
||||||
with output_file.open() as outfh:
|
rougailconfig["doc.output_format"] = "console"
|
||||||
attented_output = outfh.read()
|
# eolobj = Rougail(rougailconfig=rougailconfig)
|
||||||
assert result == attented_output, f'filename {output_file}'
|
# config = eolobj.run()
|
||||||
|
result = RougailOutputDoc(config, rougailconfig=rougailconfig).run()[1]
|
||||||
|
output_file = test_dir / 'result.sh'
|
||||||
|
if not output_file.is_file():
|
||||||
|
with output_file.open('w') as outfh:
|
||||||
|
outfh.write(result)
|
||||||
|
with output_file.open() as outfh:
|
||||||
|
attented_output = outfh.read()
|
||||||
|
assert result == attented_output, f'filename {output_file}'
|
||||||
#
|
#
|
||||||
destfile.unlink()
|
destfile.unlink()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue