MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

Is it possible to make {glue:text} not bold?

Open NatalieZelenka opened this issue 3 years ago • 7 comments

Is your feature request related to a problem? Please describe. Hi, I am really enjoying MyST-NB, thank you for all your work on it!

I understand that this issue will probably not be too urgent for you, but I have a paragraph that is very dense with {glue:text} directives, and the bold type is a bit overwhelming (I am gluing from file descriptions that are quite long and have a lot going on).

Describe the solution you'd like The bold makes sense a lot of the time, so I guess I'd like the option to turn it off for an individual directive, as an additional argument. A separate {glue:regular} would also be fine for me.

Describe alternatives you've considered I guess there is probably some css somewhere that can define how these look: do you know how I could do that? In that case, I could change that to make it not bold, then bold any that I want bold using **{glue:text}**

NatalieZelenka avatar Mar 15 '21 14:03 NatalieZelenka

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Mar 15 '21 14:03 welcome[bot]

Ah interesting - so you'd like to make some glue:text bold, and other glue:text not-bold. Is that right?

Right now the simplest solution I can think of is to wrap your "bold" glue:text in some kind of CSS wrapper that would let you write a custom CSS rule for it, so that you can de-bold that way. Maybe that'd work?

choldgraf avatar Mar 15 '21 19:03 choldgraf

I will try that, thank you!

NatalieZelenka avatar Mar 22 '21 09:03 NatalieZelenka

I was curious why text is formatted bold by default when glueing, in contrast to the Rmarkdown equivalent, which matches the surrounding formatting?

From an accessibility point of view, bold or italics are useful when the emphasis is informative but I think they can be misleading if there's no purpose for the emphasis. This could be confusing both visually or if being read by a screen-reader, for example.

I'm not strongly advocating a change but wondered if it was worth considering whether the emphasis is functional in the majority of use cases. I.e. does the reader need to know that the text was dynamically inserted?

foster999 avatar Aug 21 '21 17:08 foster999

I think we originally did this in order to make it clear what was programmatically inserted vs. what was written manually. That said, I can see how a more "opinionated" style is perhaps not the best by default, and if people want things to be bold they (I think?) could always just wrap in **.

Is anybody opposed to removing extra CSS formatting for glued text/numbers and having it just inherit from its context?

choldgraf avatar Aug 21 '21 19:08 choldgraf

An alternative approach: allow for arbitrary 'glue:<your_value>' here that generates an equivalent CSS selector so you can define your own formatting options. I.e.: using {glue:text}'some_var' generates a span with the class 'pasted-text' assigned to it and span.pasted-text { font-weight: bold;} in mystnb.css. If you could specify {glue:my_format_text}'some_var' and have it assign the class 'my_format_text' to the resulting span, authors could craft customized CSS for arbitrary glued output.

flukeymcswagger avatar Nov 29 '21 16:11 flukeymcswagger

Hi, What is the status of this? Our use case is figure captions. The caption title and descriptive is generated and then "glued" right after the {numref} call for the actual figure. It comes out nice except for the bold.

hammerdirt-analyst avatar Feb 09 '23 22:02 hammerdirt-analyst