Skip to content

Commit

Permalink
Add generate_source_links to cfg_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Gr4phix authored and amykyta3 committed Oct 28, 2023
1 parent c8bd4ff commit 4308034
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ additional things can be configured via the TOML configuration file.
user_template_dir = "path/to/dir/"
user_static_dir = "path/to/dir/"
extra_doc_properties = ["list", "of", "properties"]
generate_source_links = false
```
6 changes: 6 additions & 0 deletions src/peakrdl_html/__peakrdl__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Exporter(ExporterSubcommandPlugin):
"user_template_dir": schema.DirectoryPath(),
"user_static_dir": schema.DirectoryPath(),
"extra_doc_properties": [schema.String()],
"generate_source_links": schema.Boolean(),
}


Expand Down Expand Up @@ -47,11 +48,16 @@ def add_exporter_arguments(self, arg_group: 'argparse.ArgumentParser') -> None:


def do_export(self, top_node: 'AddrmapNode', options: 'argparse.Namespace') -> None:
generate_source_links = self.cfg['generate_source_links']
if generate_source_links is None:
generate_source_links = True

html = HTMLExporter(
show_signals=options.show_signals,
user_template_dir=self.cfg['user_template_dir'],
user_static_dir=self.cfg['user_static_dir'],
extra_doc_properties=self.cfg['extra_doc_properties'],
generate_source_links=generate_source_links,
)
html.export(
top_node,
Expand Down

0 comments on commit 4308034

Please sign in to comment.