bikeshed icon indicating copy to clipboard operation
bikeshed copied to clipboard

Override custom metadata from CLI

Open tpluscode opened this issue 3 years ago • 4 comments

4.3.1. Known Issues

  • You can’t supply custom metadata keys (ones with a ! prefix). If you want to do this, let me know, and I’ll work on it.

I found that this is documented as a known limitation. I would like to see this feature happen. My use case is to document a piece of software with bikeshed and have the version from package.json injected during build

tpluscode avatar Mar 26 '23 08:03 tpluscode

Bottom line, why is there even a distinction between default and custom metadata and the necessity to prefix with !

Would it be possible to treat all keys the same

tpluscode avatar Mar 26 '23 08:03 tpluscode

The limitation is because ! acts weird in Bash (and other shells?) so I have to do something special.

tabatkins avatar Mar 27 '23 15:03 tabatkins

I am a little confused by this answer. Where does shell play a part?

I would've expect it to be possible like

<!-- custom metadata come without bang -->
<pre class=metadata>
Foo: bar
</pre>

And overrides are uniform

bikeshed --md-status=ED --md-foo=baz

No exclamation mark, no problem for shell. I'm sure I'm missing something here

tpluscode avatar Mar 27 '23 16:03 tpluscode

Oh, sorry, I misread your question!

The reason I have a distinction between "custom" metadata and "normal" metadata is simply to separate the namespaces. If you could write !Foo: bar as just Foo: bar, then I would be unable to ever introduce a Foo metadata with specific handling. Worse, I'd have no idea that introducing a Foo metadata would break things until people give me a bug report saying they were using that word! It's all the bad parts of web compat. It would also mean that if you wanted to write something like, say, !Metadata Order: foo (for some reason), that would be impossible, since Metadata Order is already a defined metadata type.

tabatkins avatar Mar 27 '23 22:03 tabatkins