Style rules matching custom attributes?

At the risk of asking an “XY” question (about an attempted solution rather than the actual problem), can style rules match on the presence or value of custom data- attributes ?

Context:

I use definition lists (essentially a list of Term rows, each with some Definition children) and I wondered whether I could make definition list terms visually distinct in the editor with a style that matched the presence of something like a data-term="true" attribute value ?

Broader context:

I’m drafting a custom a Lua reader-writer pair for Bike ⇄ Pandoc traffic, and I’m writing Pandoc DefinitionList blocks out to Bike with term rows flagged by an attribute. (In the Bike editor I can add and view custom attributes with an extension or script, but I can’t yet detect their presence in styling – I may have missed a trick or two)


FWIW other custom attributes that might help me with fuller Bike ⇄ Pandoc round-tripping would include things in the region of:

  • data-table="true"
  • data-figure="true" (for captioned links to images)

Ah … outline paths ? Perhaps I was looking in wrong place.

( was looking for attributes in the extension kit’s API for styles)

Yes, this would be specified in the outline path in the editor style. Then open the outline you want to style in Bike, and the Bike > Outline Path Explorer to see the exact attribute names to query against. Then type a relative path to try to match. I think for the cases you mention these might be your paths:

.@figure = "true"
.@table = "true"
1 Like