diff --git a/README.md b/README.md index 013ca603..e4bce3f5 100644 --- a/README.md +++ b/README.md @@ -2300,6 +2300,7 @@ Notes: - `regex`: [string=''] Regular expression to match. - *regexp*: Alias for regex. - `merge_blank_fields`: [boolean=true] Component groups with blank fields will be merged into the most compatible group, where possible. + - `mouser_link`: [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page (HTML only). - `ref_separator`: [string=' '] Separator used for the list of references. - `test_regex`: [boolean=true] Each component group will be tested against a number of regular-expressions (see ``).. - `use_alt`: [boolean=false] Print grouped references in the alternate compressed style eg: R1-R7,R18. diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index df2a6c01..b7aae368 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -1081,6 +1081,8 @@ outputs: # `regexp` is an alias for `regex` # [boolean=true] Component groups with blank fields will be merged into the most compatible group, where possible merge_blank_fields: true + # [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page (HTML only) + mouser_link: '' # [boolean=true] First column is the row number number_rows: true # [string=' '] Separator used for the list of references diff --git a/kibot/out_kibom.py b/kibot/out_kibom.py index 70bfb589..24349b41 100644 --- a/kibot/out_kibom.py +++ b/kibot/out_kibom.py @@ -124,6 +124,8 @@ class KiBoMConfig(Optionable): """ Separator used for the list of references """ self.digikey_link = Optionable """ [string|list(string)=''] Column/s containing Digi-Key part numbers, will be linked to web page (HTML only) """ + self.mouser_link = Optionable + """ [string|list(string)=''] Column/s containing Mouser part numbers, will be linked to web page (HTML only) """ self.group_fields = GroupFields """ *[list(string)] List of fields used for sorting individual components into groups. Components which match (comparing *all* fields) will be grouped together. @@ -222,6 +224,11 @@ class KiBoMConfig(Optionable): self.digikey_link = None elif isinstance(self.digikey_link, list): self.digikey_link = '\t'.join(self.digikey_link) + # mouser_link + if isinstance(self.mouser_link, type): + self.mouser_link = None + elif isinstance(self.mouser_link, list): + self.mouser_link = '\t'.join(self.mouser_link) # group_fields if isinstance(self.group_fields, type): self.group_fields = None @@ -318,6 +325,7 @@ class KiBoMConfig(Optionable): self.write_bool('hide_pcb_info') self.write_str('ref_separator') self.write_str('digikey_link') + self.write_str('mouser_link') # Ask to keep the output name f.write('output_file_name = %O\n') self.write_vector(self.group_fields, 'GROUP_FIELDS') diff --git a/tests/yaml_samples/bom_cfg2.kibot.yaml b/tests/yaml_samples/bom_cfg2.kibot.yaml index 9b55fbf1..d240ed43 100644 --- a/tests/yaml_samples/bom_cfg2.kibot.yaml +++ b/tests/yaml_samples/bom_cfg2.kibot.yaml @@ -14,6 +14,9 @@ outputs: digikey_link: - digikey# - digikey_alt# + mouser_link: + - mouser# + - mouser_alt# component_aliases: - ['r', 'r_small', 'res', 'resistor'] - - 'l'