Skip to content

Commit

Permalink
Docs0 v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleperilli committed Apr 20, 2024
1 parent e0442e5 commit dc3993f
Show file tree
Hide file tree
Showing 10 changed files with 269 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Docs0 Changelog

## 1.0.5 (2024-04-20)
- Add Prism for syntax highlighting

## 1.0.4 (2024-03-26)
- Remove unlisted pages from search index
- Make file modified date action manually only
Expand Down
3 changes: 2 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
<script src="/assets/scripts/fuse-index.js"></script>
<script src="/assets/scripts/fuse.min.js"></script>
<script src="/assets/scripts/search.min.js"></script>

<script src="/assets/scripts/prism.js"></script>
<script src="/assets/scripts/split.min.js"></script>
<script src="/assets/scripts/main.min.js"></script>
<script src="/assets/scripts/my.js"></script>
</body>
</html>
32 changes: 32 additions & 0 deletions _myassets/scripts/my.js

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

5 changes: 3 additions & 2 deletions assets/_sass/_markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@
word-break: normal;
white-space: pre;
background: transparent;
border: 0
border: 0;

}

pre {
Expand All @@ -359,7 +360,7 @@
font-size: 85%;
line-height: 1.45;
background-color: var(--window-alt-back-color);
border-radius: 3px
border-radius: 3px;
}

pre code,
Expand Down
10 changes: 8 additions & 2 deletions assets/_sass/_page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@
width: 100%;
}

&:has(.toc) {
.markdown-body pre {
max-width: 690px;
}
}

footer {
margin: 60px 0 0 0;
color: var(--notice-color);
Expand Down Expand Up @@ -127,8 +133,8 @@
@include icon-info;

&:before {
font-size: 1.7em;
margin: 0px 8px 0 0;
font-size: 1.5em;
margin: 0px 5px 0 0;
display: block;
float: left;
}
Expand Down
180 changes: 180 additions & 0 deletions assets/_sass/_prism.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/* PrismJS 1.29.0
https://prismjs.com/download.html#themes=prism&languages=markup+clike+javascript+bash+json+sql+typescript+xml-doc&plugins=line-numbers */
code[class*="language-"],
pre[class*="language-"] {
color: var(--code-color);
background: none;
//text-shadow: 0 1px var(--back-color);
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: var(--code-selection-color);
}

pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: var(--code-selection-color);
}

@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: var(--code-back-color);
}

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

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: var(--code-comment-color); //slategray;
}

.token.punctuation {
color: var(--code-parenthesis-color); // #999;
}

.token.namespace {
opacity: .7;
}

.token.property {
color: var(--code-property-color); // #905;
}

.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: var(--code-number-color); //#905;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: var(--code-string-color); // #690;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: var(--code-operator-color); //#9a6e3a;
/* This background color was intended by the author of this theme. */
//background: hsla(0, 0%, 100%, .5);
}

.token.atrule,
.token.attr-value,
.token.keyword {
color: var(--code-keyword-color); // #07a;
}

.token.function,
.token.class-name {
color: var(--code-function-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;
}

pre[class*="language-"].line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}

pre[class*="language-"].line-numbers > code {
position: relative;
white-space: inherit;
}

.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid var(--code-line-number-color); // #999;

-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

}

.line-numbers-rows > span {
display: block;
counter-increment: linenumber;
}

.line-numbers-rows > span:before {
content: counter(linenumber);
color: var(--code-line-number-color); // #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
28 changes: 26 additions & 2 deletions assets/_sass/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,27 @@
--img-back-color: var(--back-color);

// Code Editor
--code-back-color: #f6f8fa;
--code-back-color: #f5f2f0; //#f6f8fa;
--code-color: #333;
--code-line-number-color: #999;
--code-selection-color: #A2D7FF;
--code-selection-color: #b3d4fc; //#A2D7FF;
--code-inactive-selection-color: #E4EBF2;
--code-fold-marker-color: #999;
--code-matching-brackets-back-color: #E7EFE6;
--code-matching-brackets-border-color: #999;

// Code Syntax
--code-property-color: #0551A5;
--code-comment-color: #39A03B;
--code-string-color: #D93124;
--code-column-color: #333;
--code-function-color: #035ACA;
--code-keyword-color: #035ACA;
--code-measure-color: #333;
--code-operator-color: #333;
--code-number-color: #EE7F18;
--code-parenthesis-color: #808080;

// Nav
--nav-back-color: #f6f8fa;
--nav-sel-color: var(--link-color);
Expand Down Expand Up @@ -241,6 +253,18 @@
--code-matching-brackets-back-color: #444;
--code-matching-brackets-border-color: #e1e1e1;

// Code Syntax
--code-property-color: #9DDCFE;
--code-comment-color: #86C573;
--code-string-color: #E44;
--code-column-color: #fff;
--code-function-color: #0095ff;
--code-keyword-color: #0095ff;
--code-measure-color: #fff;
--code-operator-color: #fff;
--code-number-color: #EE7F18;
--code-parenthesis-color: #636363;

// Nav
--nav-back-color: #262626;
--nav-sel-color: var(--link-color);
Expand Down
1 change: 1 addition & 0 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
@import "error";
@import "search";
@import "markdown";
@import "prism";
@import "../../_myassets/_sass/style"; // User style
Loading

0 comments on commit dc3993f

Please sign in to comment.