bikeshed icon indicating copy to clipboard operation
bikeshed copied to clipboard

Some inconsistencies in specially recognized paragraphs (notes, examples etc.)

Open woutermont opened this issue 2 years ago • 1 comments

When using the short hands provided by bikeshed to create (boxed) asides, I stumble upon some weird behaviour.

The generall rule seems to aim to recognize all keywords, in whatever case, followed by a colon, a comma (notes-only), or a single newline, followed by text.

  • Notes seem to follow this, and by default add a numbered label.
  • Issues seem to behave similar to notes (excepts the comma syntax does not work).
  • Advisements, on the other hand, are merely stylized, without rendering a (counted) label.
  • Examples do not seem to be recognized at all in shorthand. Only when explicitly constructing an element with the class exmple, does bikeshed provide the expected box with label and counter.
  • Assertions, lastly, are impossible to create. neither the shorthand nor adding the expxlicit class makes any change in styling.

Note: I used the plain bikespec template of v3.14.3.

I end up writing custon CSS like

    /* Reset base counters and additional ones */
    body { counter-reset: example note issue assertion advisement figure !important; }

    /* Configure increments for additional counters */
    .note { counter-increment: note; }
    .assertion { counter-increment: assertion; }
    .advisement { counter-increment: advisement; }

    /* Configure display of additional counters */
    .note:not(.no-marker)::before { content: "Note " counter(note); }
    .assertion:not(.no-marker)::before { content: "Assertion" counter(assertion); }
    .advisement:not(.no-marker)::before { content: "Advisement" counter(advisement); }

    /* Hide generated markers */
    .note,
    .issue,
    .example,
    .assertion,
    .advisement { 
      .marker { 
        display: none; 
      }
    }

woutermont avatar Jul 30 '23 12:07 woutermont

Yeah, as these were introduced over time to the syntax, they're not completely consistent. There's no good reason for that, tho, and I know I've written Assert: foo lines expecting them to turn into assertions in my own specs. ^_^

Happy to align these.

tabatkins avatar Aug 02 '23 21:08 tabatkins