feat: can reload formatter
This commit is contained in:
parent
8afb61c5ad
commit
d8a0e22de9
1 changed files with 6 additions and 2 deletions
|
|
@ -85,15 +85,15 @@ class RougailOutputDoc(Examples, Changelog):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.support_namespace = False
|
self.support_namespace = False
|
||||||
self.property_to_string = get_properties_to_string()
|
self.property_to_string = get_properties_to_string()
|
||||||
|
self.formatter = None
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def run(self) -> str:
|
def run(self) -> str:
|
||||||
"""Print documentation in stdout"""
|
"""Print documentation in stdout"""
|
||||||
self.load()
|
self.load()
|
||||||
|
self.load_formatter()
|
||||||
return_string = ""
|
return_string = ""
|
||||||
contents = self.rougailconfig["doc.contents"]
|
contents = self.rougailconfig["doc.contents"]
|
||||||
output_format = self.rougailconfig["doc.output_format"]
|
|
||||||
self.formatter = self.outputs[output_format](self.rougailconfig)
|
|
||||||
if "variables" in contents:
|
if "variables" in contents:
|
||||||
# print(self.informations)
|
# print(self.informations)
|
||||||
return_string += self.formatter.run(self.informations)
|
return_string += self.formatter.run(self.informations)
|
||||||
|
|
@ -103,6 +103,10 @@ class RougailOutputDoc(Examples, Changelog):
|
||||||
return_string += self.gen_doc_changelog()
|
return_string += self.gen_doc_changelog()
|
||||||
return True, return_string
|
return True, return_string
|
||||||
|
|
||||||
|
def load_formatter(self) -> str:
|
||||||
|
output_format = self.rougailconfig["doc.output_format"]
|
||||||
|
self.formatter = self.outputs[output_format](self.rougailconfig)
|
||||||
|
|
||||||
def print(self) -> None:
|
def print(self) -> None:
|
||||||
ret, data = self.run()
|
ret, data = self.run()
|
||||||
print(data)
|
print(data)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue