diff --git a/InteractiveHtmlBom/core/config.py b/InteractiveHtmlBom/core/config.py index 605a40b..781a074 100644 --- a/InteractiveHtmlBom/core/config.py +++ b/InteractiveHtmlBom/core/config.py @@ -73,6 +73,7 @@ class Config: kicad_text_formatting = True # Extra fields section + header_lines = [] extra_data_file = None netlist_initial_directory = '' # This is relative to pcb file directory show_fields = default_show_group_fields @@ -457,6 +458,10 @@ def add_options(cls, parser, version): help='Do not blacklist components with empty value.') # Fields section + parser.add_argument('--header-line', dest='header_lines', + action='append', default=[], metavar='TEXT', + help='Additional line shown in the BOM header. ' + 'Can be given multiple times.') parser.add_argument('--netlist-file', help='(Deprecated) Path to netlist or xml file.') parser.add_argument('--extra-data-file', @@ -632,6 +637,7 @@ def set_from_args(self, args): self.include_nets = args.include_nets # Fields + self.header_lines = args.header_lines self.extra_data_file = args.extra_data_file or args.netlist_file if args.extra_fields is not None: self.show_fields = self.default_show_group_fields + \ diff --git a/InteractiveHtmlBom/core/ibom.py b/InteractiveHtmlBom/core/ibom.py index 0fb4667..f0bd297 100644 --- a/InteractiveHtmlBom/core/ibom.py +++ b/InteractiveHtmlBom/core/ibom.py @@ -337,6 +337,7 @@ def main(parser, config, logger): pcbdata["bom"] = generate_bom(components, config) pcbdata["ibom_version"] = config.version + pcbdata["metadata"]["header_lines"] = list(config.header_lines) # build BOM bom_file = generate_file(pcb_file_dir, pcb_file_name, pcbdata, config) diff --git a/InteractiveHtmlBom/web/ibom.html b/InteractiveHtmlBom/web/ibom.html index a6e5a6d..7ddbaa8 100644 --- a/InteractiveHtmlBom/web/ibom.html +++ b/InteractiveHtmlBom/web/ibom.html @@ -63,6 +63,7 @@
Title
Company
+
Revision
diff --git a/InteractiveHtmlBom/web/ibom.js b/InteractiveHtmlBom/web/ibom.js index d88a6f8..fa9fc65 100644 --- a/InteractiveHtmlBom/web/ibom.js +++ b/InteractiveHtmlBom/web/ibom.js @@ -895,6 +895,13 @@ function populateMetadata() { document.getElementById("title").innerHTML = pcbdata.metadata.title; document.getElementById("revision").innerHTML = "Rev: " + pcbdata.metadata.revision; document.getElementById("company").innerHTML = pcbdata.metadata.company; + var container = document.getElementById("header-lines"); + (pcbdata.metadata.header_lines || []).forEach(function (line) { + var div = document.createElement("div"); + div.textContent = line; + container.appendChild(div); + }); + document.getElementById("filedate").innerHTML = pcbdata.metadata.date; ["title", "revision", "company", "date"].forEach(function(field) { var element = document.getElementById(field === "date" ? "filedate" : field);