feat: add button to copy code blocks (#228)
BREAKING CHANGE: The `--code-max-height` formatting is applied only to code blocks that use syntax highlighting, see [documentation](https://geekdocs.de/features/code-blocks/).
This commit is contained in:
parent
d1267ac587
commit
75f56d8fad
13 changed files with 138 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
|||
title: Code Blocks
|
||||
---
|
||||
|
||||
There are multiple ways to add code blocks. Most of them works out of the box only the Hugo shortcode `<highlight>` need some configuration to work properly.
|
||||
There are several ways to add code blocks. Most of them work out of the box, only the Hugo short code `<highlight>` needs to be configured to work properly. The theme also provides some additional features like a copy button and an option to set the maximum length of code blocks. Both of these functions and the dependent formatting rely on the `.highlight` CSS class. You must ensure that you always assign a language to your code blocks if you want to use these functions. If you do not want to apply syntax highlighting, you can also specify `plain` or `text` as the language.
|
||||
|
||||
{{< toc >}}
|
||||
|
||||
|
@ -21,14 +21,14 @@ To display an inline shortcode use single quotes:
|
|||
Code blocks can be uses without language specification:
|
||||
|
||||
````markdown
|
||||
```
|
||||
```Plain
|
||||
some code
|
||||
```
|
||||
````
|
||||
|
||||
**Example:**
|
||||
|
||||
```plain
|
||||
```Plain
|
||||
some code
|
||||
```
|
||||
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
--code-accent-color: #e3e7eb;
|
||||
--code-accent-color-lite: #eff1f3;
|
||||
|
||||
--code-copy-font-color: #6b7784;
|
||||
--code-copy-border-color: #adb4bc;
|
||||
--code-copy-success-color: #00c853;
|
||||
|
||||
--accent-color: #e9ecef;
|
||||
--accent-color-lite: #f8f9fa;
|
||||
|
||||
|
@ -51,6 +55,10 @@
|
|||
--code-accent-color: #e3e7eb;
|
||||
--code-accent-color-lite: #eff1f3;
|
||||
|
||||
--code-copy-font-color: #6b7784;
|
||||
--code-copy-border-color: #adb4bc;
|
||||
--code-copy-success-color: #00c853;
|
||||
|
||||
--accent-color: #e9ecef;
|
||||
--accent-color-lite: #f8f9fa;
|
||||
|
||||
|
@ -81,6 +89,10 @@
|
|||
--code-accent-color: #262b2f;
|
||||
--code-accent-color-lite: #2b3035;
|
||||
|
||||
--code-copy-font-color: #adb4bc;
|
||||
--code-copy-border-color: #808c98;
|
||||
--code-copy-success-color: #00c853;
|
||||
|
||||
--accent-color: #2b3035;
|
||||
--accent-color-lite: #2f353a;
|
||||
|
||||
|
@ -109,6 +121,10 @@
|
|||
--code-accent-color: #262b2f;
|
||||
--code-accent-color-lite: #2b3035;
|
||||
|
||||
--code-copy-font-color: #adb4bc;
|
||||
--code-copy-border-color: #808c98;
|
||||
--code-copy-success-color: #00c853;
|
||||
|
||||
--accent-color: #2b3035;
|
||||
--accent-color-lite: #2f353a;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue