Open erikerlandson opened 2 years ago
cc @armanbilge
@erikerlandson do you have a branch I can look at? We can support this at the rendering level by adding a custom CSS style.
Basically something like this:
pre {
max-height: 100px;
overflow: scroll;
}
@armanbilge latest is merged into scala3
branch:
https://github.com/erikerlandson/coulomb/blob/scala3/docs/index.md
@armanbilge thanks!
For reference, what I ultimately ended up doing was this:
/* when mdoc renders "long" comments, clip them and provide a scrollbar */
.comment {
/* set display as block or the other settings don't work */
display: block;
/* most comments are short, and display normally */
max-height: 100px;
/* add a scrollbar only when necessary */
overflow: auto;
}
Which adds a scrollbar only for "long" comments, like this:
Might be useful to have a special class for "multi-line-comment" or "mdoc-output-comment" to distinguish between comments the programmer wrote and comments generated by mdoc itself.
Or some new mdoc tag. ```scala mdoc:maxoutputlines=3:overflow=scroll:fail
Possibly not related but now seeing this strange behavior: https://github.com/erikerlandson/coulomb/issues/309
I have a code block that creates an error, but the long length of the error is a bit distracting. Is there a way to tell
mdoc
to clip the error message to the firstn
lines, or just tell it to have a maximum code block height, with a scroll bar? Setting something likemdoc:height=10
doesn't fix this particular problem.Screen-shot of my long error: