fix: setup prettyprint

This commit is contained in:
mostafaei2002 2024-05-16 10:38:09 +03:30
parent e1f1c9e3ac
commit a10a198aae
3 changed files with 76 additions and 1 deletions

View File

@ -193,6 +193,7 @@
</script> </script>
<script src="{{ 'dist/main.js'|url }}"></script> <script src="{{ 'dist/main.js'|url }}"></script>
<script src="{{ 'dist/prettify-1.0.js'|url }}"></script>
{% for path in config.extra_javascript %} {% for path in config.extra_javascript %}
<script src="{{ path|url }}" defer></script> <script src="{{ path|url }}" defer></script>

View File

@ -12,3 +12,8 @@ import "../../node_modules/bootstrap/js/dist/toast";
import "../../node_modules/bootstrap/js/dist/tooltip"; import "../../node_modules/bootstrap/js/dist/tooltip";
import "../scss/styles.scss"; import "../scss/styles.scss";
const codeBlocks = document.querySelectorAll("pre code");
codeBlocks.forEach((block) => {
block.parentElement.classList.add(["prettyprint", "well"]);
});

View File

@ -66,6 +66,12 @@ $code-color: #d14;
a { a {
color: #a30000; color: #a30000;
text-decoration: none; text-decoration: none;
&:hover,
&:active {
color: #c20000;
text-decoration: underline;
}
} }
pre.prettyprint { pre.prettyprint {
@ -86,6 +92,18 @@ code {
padding: 2px 4px; padding: 2px 4px;
} }
pre {
background-color: #f7f7f9;
}
pre code {
border: none;
}
.nav-link {
padding: 2px 15px 3px;
}
.body-content { .body-content {
padding-top: 120px; padding-top: 120px;
padding-bottom: 70px; padding-bottom: 70px;
@ -101,4 +119,55 @@ code {
color: #333; color: #333;
} }
// Code Blocks // Prettify Code
.com {
color: #93a1a1;
}
.lit {
color: #195f91;
}
.pun,
.opn,
.clo {
color: #93a1a1;
}
.fun {
color: #dc322f;
}
.str,
.atv {
color: #d14;
}
.kwd,
.prettyprint .tag {
color: #1e347b;
}
.typ,
.atn,
.dec,
.var {
color: teal;
}
.pln {
color: #48484c;
}
.prettyprint {
padding: 8px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
}
.prettyprint.linenums {
box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin: 0 0 0 33px; /* IE indents via margin-left */
}
ol.linenums li {
padding-left: 12px;
color: #bebec5;
line-height: 20px;
text-shadow: 0 1px 0 #fff;
}