Skip to content

An enhanced version of the Fenced code blocks plugin can support tabbed code block

License

Notifications You must be signed in to change notification settings

holmofy/hexo-tabbed-code-block

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexo-tabbed-code-blocks

demo

demo

Install

npm install holmofy/hexo-tabbed-code-block

config

_config.yml add :

# 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.

---
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

```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

demo

multi code block with title

```bash Debein
apt install pcre2-utils
```

```bash MacOS
brew install pcre
```

```bash CentOS
yum install pcre
```

demo

About

An enhanced version of the Fenced code blocks plugin can support tabbed code block

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published