Stream: helpdesk (published)

Topic: example doc string with `printstyled`


view this post on Zulip Leandro Martínez (Jul 03 2024 at 18:12):

Is there a way to incorporate a styled string as generated by printstyled in a an example doc string?

view this post on Zulip Timothy (Jul 04 2024 at 02:58):

In Julia main, you can use StyledStrings formatting in styled-lang markdown code blocks, e.g.

blah blah main text
```styled
{inverse:this is some {emphasis:inverse} text}
```

view this post on Zulip Leandro Martínez (Jul 04 2024 at 15:19):

Nice, but that's not exactly what I mean. I mean, for example, if I have a custom show method that prints styled strings. Is there a way to:

  1. Reproduce that in the docs without having to style everything again.
  2. Use jldoctests in which the output of a function is printed with styles? (This one will be probably important as styled strings get more common in all printing and show functions)

Last updated: Nov 22 2024 at 04:41 UTC