Skip to content

Commit

Permalink
Add prism code highlight for the micro-website.
Browse files Browse the repository at this point in the history
  • Loading branch information
h3xstream committed Mar 25, 2019
1 parent 84abb24 commit 0a01a7c
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 1 deletion.
142 changes: 142 additions & 0 deletions website/out_web/css/prism.css
@@ -0,0 +1,142 @@
/* PrismJS 1.16.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+java */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/

code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-size: 1em;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;

-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;

-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}

pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}

pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}

@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}

/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}

.token.punctuation {
color: #999;
}

.namespace {
opacity: .7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}

.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}

.token.function,
.token.class-name {
color: #DD4A68;
}

.token.regex,
.token.important,
.token.variable {
color: #e90;
}

.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}

.token.entity {
cursor: help;
}

8 changes: 8 additions & 0 deletions website/out_web/js/prism.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion website/templates/bugs.htm
Expand Up @@ -44,6 +44,11 @@ <h2>Table of Contents</h2>


bugPatterns.each {b->

new_description = b.description
new_description = new_description.replace("<pre>\n","<pre>");
new_description = new_description.replace("<pre>","<pre class='keep-initial-line-feed'><code class='code.language-java keep-initial-line-feed'>")
new_description = new_description.replace("</pre>","</code></pre>")
print """
<section>
<a class="anchor" name="${b.type}"></a>
Expand All @@ -53,7 +58,7 @@ <h2 class="page-header">
</h2>
<p class="text-muted"><em><small>Bug Pattern: <tt>${b.type}</tt></small></em></p>

${b.description}
${new_description}

<hr/>
<br/>
Expand Down
1 change: 1 addition & 0 deletions website/templates/common_footer.htm
Expand Up @@ -20,6 +20,7 @@
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/fsb-custom.js"></script>
<script src="js/prism.js"></script>

<!-- Google Analytics -->
<script type="text/javascript">
Expand Down
1 change: 1 addition & 0 deletions website/templates/common_header.htm
Expand Up @@ -14,6 +14,7 @@
<link href="css/font-awesome.css" rel="stylesheet" media="screen">
<link href="css/fsb-custom-theme.css" rel="stylesheet" media="screen">
<link href="css/agency.css" rel="stylesheet" media="screen">
<link href="css/prism.css" rel="stylesheet" media="screen">

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
Expand Down

0 comments on commit 0a01a7c

Please sign in to comment.