https://github.com/holmofy/hexo-tabbed-code-block
An enhanced version of the Fenced code blocks plugin can support tabbed code block
https://github.com/holmofy/hexo-tabbed-code-block
Last synced: 6 months ago
JSON representation
An enhanced version of the Fenced code blocks plugin can support tabbed code block
- Host: GitHub
- URL: https://github.com/holmofy/hexo-tabbed-code-block
- Owner: holmofy
- License: mit
- Created: 2021-06-12T06:15:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-01T16:24:31.000Z (almost 4 years ago)
- Last Synced: 2025-02-07T20:33:32.757Z (8 months ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hexo-tabbed-code-blocks


## Install
```sh
npm install holmofy/hexo-tabbed-code-block
```## config
`_config.yml` add :
```yaml
# hexo highlight config
highlight:
enable: true
# ref: https://github.com/hexojs/hexo-util#highlightstr-options
line_number: true
tab_replace: ' '
auto_detect: false
# tabbed code
tabbedCodeBlock:
enable: true
merge: true
```**note:** tabbedCodeBlock enable means to open globally. Support to enable on a single page, this is more recommended.
````markdown
---
title: hello-world
date: 2021-11-01
categories: demo
tabbedCodeBlock: true
---```java
System.out.println("Hello World");
```
````## How to user it?
### multi language code block
````markdown
```c
printf("Hello World");
``````java
System.out.println("Hello World");
```
````Multi adjacent code blocks will be automatically merged into one tabbed code block. like this

### multi code block with title
````markdown
```bash Debein
apt install pcre2-utils
``````bash MacOS
brew install pcre
``````bash CentOS
yum install pcre
```
````