Skip to content

Commit 89dd8d9

Browse files
davidbenBoringssl LUCI CQ
authored andcommitted
Give WARNING paragraphs a splash of color
I'm not sure if this is necessary. I was playing around and this didn't look terrible. Though it will probably turn x509.h into a sea of yellow when it's ready to be rendered. Change-Id: I34b26aad8a779a3fde761558d15b64c79159892a Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/64931 Reviewed-by: Bob Beck <[email protected]> Commit-Queue: David Benjamin <[email protected]>
1 parent a942d57 commit 89dd8d9

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

util/doc.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ pre.code {
5656
border-radius: 5px;
5757
}
5858

59+
p.warning {
60+
background-color: #fef5d3;
61+
padding: 5px;
62+
border-radius: 5px;
63+
}
64+
65+
p.warning .first-word {
66+
font-weight: bold;
67+
}
68+
5969
.comment pre {
6070
margin-left: 2em;
6171
}

util/doc.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,11 @@ func markupComment(allDecls map[string]string, comment []CommentBlock) template.
641641

642642
switch block.Type {
643643
case CommentParagraph:
644-
b.WriteString("<p>")
644+
if strings.HasPrefix(block.Paragraph, "WARNING:") {
645+
b.WriteString("<p class=\"warning\">")
646+
} else {
647+
b.WriteString("<p>")
648+
}
645649
b.WriteString(string(markupParagraph(allDecls, block.Paragraph)))
646650
b.WriteString("</p>")
647651
case CommentOrderedListItem, CommentBulletListItem:

0 commit comments

Comments
 (0)