speced / bikeshed

:bike: A preprocessor for anyone writing specifications that converts source files into actual specs.
https://speced.github.io/bikeshed
Creative Commons Zero v1.0 Universal
1.08k stars 199 forks source link

Highlighting for RFC2119 Keywords #2559

Open CxRes opened 1 year ago

CxRes commented 1 year ago

I wonder if you have syntax highlighting for RFC2119 keywords, as recommended by the W3C style guide. It is not just wrapping in <em> or * but adding a class="rfc2119" to the keywords.

If not, please consider this a feature request. This is extremely specific to spec work that an exception for these words can be made.

tabatkins commented 1 year ago

Oh, I need to file an issue against the style guide, that's terrible. We haven't specially formatted the 2119 keywords ever in CSS, and it always looks incredibly clumsy when that's done elsewhere.

For now I recommend ignoring that section of the style guide.

CxRes commented 1 year ago

Please do! I don't like the formatting either, especially, since we (unlike you) mandate ALL CAPS use only, which is plenty clear. But that is the recommendation as it stands.

However, my request still stands but for a different reason. Wrapping the keywords in a span is an opportunity to add linked-data. So, if there is a way to support it (even with no styling), that would be very much appreciated!

tabatkins commented 1 year ago

Wrapping the keywords in a span is an opportunity to add linked-data.

What do you mean?

CxRes commented 1 year ago

This is what I would like to eventually achieve:

<body prefix="spec: https://w3c.org/ns/spec">
  <span rel="spec:requirementLevel" resource="spec:MUST">MUST</span>
</body>
tabatkins commented 1 year ago

I'm not sure why you'd want that, but ok.

Anyway, would https://github.com/speced/bikeshed/issues/2564 help?

CxRes commented 1 year ago

I'm not sure why you'd want that, but ok.

It's what they are doing in the Solid project where I am contributing, they are very big on Linked-Data. But I see your point, I would have to markup other things in my document as well with RDF, so I end with something more html than md ie less readable while writing/editing.

Anyway, would https://github.com/speced/bikeshed/issues/2564 help?

I am not fully able to follow what you are suggesting, so ideally I'd like to see an example. But wrapping in a shorthand, ideally markdown-ish sound reasonable.

tabatkins commented 1 year ago

Like you could write

When X, implementations 2119must do Y

and this would get recognized as a markup shorthand, turning into

When X, implementations <span class=rfc-2119>must</span> do Y

or similar.