WireViz icon indicating copy to clipboard operation
WireViz copied to clipboard

[feature] Hyperlinks to URLs

Open kvid opened this issue 4 years ago • 0 comments

@martonmiklos has created PR #164 to remove HTML links from the input attributes. I like his idea, but I also want to discuss hyperlinks to URLs in general.

The user might want to add hyperlinks to several kinds of external references when documenting a harness:

  • Other documents in the same project.
  • Entries in a part number system.
  • Product pages or main page of manufacturer, supplier, etc.

The different output formats can support hyperlinks in different ways:

  • svg: Each node, edge and cluster can be attached to different URLs: https://www.graphviz.org/doc/info/attrs.html#d:URL
  • png: Does not support hyperlinks directly, but together with a cmapx output it is possible: https://www.graphviz.org/doc/info/output.html#d:cmapx
  • html: Support multiple hyperlinks anywhere, e.g. in BOM entries as in PR #164 and with any new harness attributes for HTML contents as in https://github.com/formatc1702/WireViz/issues/158#issuecomment-687924335.
  • tsv: A new optional URL column can contain the literal URLs.

It might be possible to specify URLs in at least two ways in the YAML input:

  • As HTML <a href="URL">-tags in text attributes, as in PR #164.
  • As a new URL or href attribute to connectors, cables, additional_bom_items, and any new entries like subgraphs (#31), components (#142), and glands (#155).

I see no major conflicts between the two alternatives above. The first one supports more than one hyperlink per BOM entry and custom link texts, The second one supports more output formats, and both can be allowed for full flexibility. I therefore suggest accepting PR #164 when it is ready (supporting hyperlinks in the HTML BOM). A new PR can be created to add attributes and supporting more output formats, like #168.

kvid avatar Sep 10 '20 00:09 kvid