Skip to content

Commit

Permalink
Merge pull request #41 from FernandoCelmer/35-feature
Browse files Browse the repository at this point in the history
 [Feature Request] Simple code syntax highlighting
  • Loading branch information
FernandoCelmer authored Jan 13, 2025
2 parents c3a0964 + 63ac15d commit c0b48a1
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Jan 15, 2024
Jan 1, 2025

---

Expand Down
5 changes: 4 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
site_name: MkDocs Simple Blog
repo_name: FernandoCelmer/mkdocs-simple-blog
repo_url: https://github.com/FernandoCelmer/mkdocs-simple-blog
site_url: https://www.fernandocelmer.com/
site_url: https://www.fernandocelmer.com
copyright: Fernando Celmer

nav:
Expand All @@ -24,6 +24,9 @@ theme:
theme_style: light
site_name_style: normal
title_style: bold
highlightjs: true
- yaml
- python
colors:
text: black
title: black
Expand Down
3 changes: 1 addition & 2 deletions mkdocs_simple_blog/assets/css/bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mkdocs_simple_blog/assets/css/main.min.css

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions mkdocs_simple_blog/base.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html>
<html data-bs-theme="{{ config.theme.theme_style }}">
<head>
{%- block site_meta %}
{%- block htmltitle %}
Expand All @@ -22,12 +22,13 @@

{%- block libs %}
{%- if config.theme.highlightjs %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>

<link rel="stylesheet" href="https://unpkg.com/@highlightjs/[email protected]/styles/base16/grayscale-dark.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>

{%- for lang in config.theme.hljs_languages %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/languages/{{lang}}.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/{{lang}}.min.js"></script>
{%- endfor %}
<script>hljs.initHighlightingOnLoad();</script>
<script>hljs.highlightAll();</script>
{%- endif %}
{%- endblock %}

Expand Down
2 changes: 1 addition & 1 deletion scripts/install_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def install_package() -> None:
version = open(file='LAST_VERSION').read().replace('-', '.')

main(['uninstall', 'mkdocs-simple-blog', '-y'])
main(['install', f'dist/mkdocs-simple-blog-{version}.tar.gz', '--no-cache-dir'])
main(['install', f'dist/mkdocs_simple_blog-{version}.tar.gz', '--no-cache-dir'])


def build_package() -> None:
Expand Down
4 changes: 2 additions & 2 deletions template/assets/css/bootstrap.css

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

3 changes: 1 addition & 2 deletions template/assets/css/bootstrap.min.css

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions template/assets/css/grayscale-dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*!
Theme: Grayscale Dark
Author: Alexandre Gavioli (https://github.com/Alexx2/)
License: ~ MIT (or more permissive) [via base16-schemes-source]
Maintainer: @highlightjs/core-team
Version: 2021.09.0css
*/
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}
code.hljs {
padding: 3px 5px;
}
.hljs {
color: #b9b9b9;
background: #101010;
}
.hljs ::selection,
.hljs::selection {
background-color: #464646;
color: #b9b9b9;
}
.hljs-comment {
color: #525252;
}
.hljs-tag {
color: #ababab;
}
.hljs-operator,
.hljs-punctuation,
.hljs-subst {
color: #b9b9b9;
}
.hljs-operator {
opacity: 0.7;
}
.hljs-bullet,
.hljs-deletion,
.hljs-name,
.hljs-selector-tag,
.hljs-template-variable,
.hljs-variable {
color: #7c7c7c;
}
.hljs-attr,
.hljs-link,
.hljs-literal,
.hljs-number,
.hljs-symbol,
.hljs-variable.constant_ {
color: #999;
}
.hljs-class .hljs-title,
.hljs-title,
.hljs-title.class_ {
color: #a0a0a0;
}
.hljs-strong {
font-weight: 700;
color: #a0a0a0;
}
.hljs-addition,
.hljs-code,
.hljs-string,
.hljs-title.class_.inherited__ {
color: #8e8e8e;
}
.hljs-built_in,
.hljs-doctag,
.hljs-keyword.hljs-atrule,
.hljs-quote,
.hljs-regexp {
color: #868686;
}
.hljs-attribute,
.hljs-function .hljs-title,
.hljs-section,
.hljs-title.function_,
.ruby .hljs-property {
color: #686868;
}
.diff .hljs-meta,
.hljs-keyword,
.hljs-template-tag,
.hljs-type {
color: #747474;
}
.hljs-emphasis {
color: #747474;
font-style: italic;
}
.hljs-meta,
.hljs-meta .hljs-keyword,
.hljs-meta .hljs-string {
color: #5e5e5e;
}
.hljs-meta .hljs-keyword,
.hljs-meta-keyword {
font-weight: 700;
}
7 changes: 7 additions & 0 deletions template/assets/css/grayscale-dark.min.css

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

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ figcaption {

code {
background-color: var(--primary);
color: var(--background)!important;
/* color: var(--background) !important; */
padding: 0.4rem 0.8rem;
}

Expand All @@ -57,7 +57,7 @@ pre {
padding: 1.6rem;
overflow-x: auto;
color: #e5e5e5;
background-color: var(--primary);
/* background-color: var(--primary); */
tab-size: 2;
font-size: 0.775em;
line-height: 30px;
Expand Down
1 change: 1 addition & 0 deletions template/assets/css/main.min.css

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

File renamed without changes.
1 change: 1 addition & 0 deletions template/assets/js/main.min.js

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

0 comments on commit c0b48a1

Please sign in to comment.