Skip to content

Commit

Permalink
Add "Example" label to example code blocks
Browse files Browse the repository at this point in the history
The label should help users distinguish example code blocks from other
code blocks, such as method source code.

It's only applied to Ruby code examples.
  • Loading branch information
st0012 committed Sep 27, 2024
1 parent ac7409b commit 69fc9ce
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/rdoc/generator/template/darkfish/css/rdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,24 @@ main .method-source-code.active-menu {
max-height: 100vh;
}

main pre.ruby::before {
content: "Example";
color: var(--secondary-color);
border-bottom: 1px solid var(--border-color);
display: block;
padding: 10px 0;
font-size: 0.9em;
margin-bottom: 10px;
}

main pre.ruby {
margin: 0;
padding: 0px 16px 16px 16px;
overflow-x: auto;
border-radius: 4px;
border-color: var(--border-color);
}

main .method-description .method-calls-super {
color: var(--text-color);
font-weight: bold;
Expand Down

0 comments on commit 69fc9ce

Please sign in to comment.