docs(manual): add spoiler to mdbook #821

Open
opened 2025-05-06 22:20:12 +00:00 by kfearsoff · 2 comments
Member

This came up while working on CL#3088. That CL includes some pretty big, 100+ LOC examples. Omitting some lines is not ideal, because it makes the example less clear. Using the mdbook's "hide lines" feature also isn't the best, because it doesn't quite make it clear that there are hidden lines.

I think what I want there is to have a spoiler: a clickable HTML element that would expand or collapse. This is a common ask for documentation solutions.

As far as I can tell, mdbook doesn't do spoilers natively.

This came up while working on [CL#3088](https://gerrit.lix.systems/c/lix/+/3088). That CL includes some pretty big, 100+ LOC examples. Omitting some lines is not ideal, because it makes the example less clear. Using the mdbook's "hide lines" feature also isn't the best, because it doesn't quite make it clear that there are hidden lines. I think what I want there is to have a spoiler: a clickable HTML element that would expand or collapse. This is a common ask for documentation solutions. As far as I can tell, mdbook doesn't do spoilers natively.
Owner

that should be the html details tag. it works in most markdown engines i have seen, but I'm not sure if it works in mdbook, needs testing.

that should be the html details tag. it works in most markdown engines i have seen, but I'm not sure if it works in mdbook, needs testing.
Author
Member

Haha, don't love inlining HTML, but I don't think Markdown really has an extensible syntax construct to do it.

It would need some CSS styling too, right?

Haha, don't love inlining HTML, but I don't think Markdown really has an extensible syntax construct to do it. It would need some CSS styling too, right?
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#821
No description provided.