https://github.com/bubkoo/hexo-filter-fenced-code
🎨 Extend syntax for the native fenced code block.
https://github.com/bubkoo/hexo-filter-fenced-code
Last synced: about 1 year ago
JSON representation
🎨 Extend syntax for the native fenced code block.
- Host: GitHub
- URL: https://github.com/bubkoo/hexo-filter-fenced-code
- Owner: bubkoo
- License: mit
- Created: 2015-04-21T09:14:43.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-02-22T18:54:48.000Z (over 4 years ago)
- Last Synced: 2025-05-06T02:07:02.391Z (about 1 year ago)
- Language: JavaScript
- Homepage: http://bubkoo.com/demo/markdown-extra-syntax-for-hexo/
- Size: 18.6 KB
- Stars: 17
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hexo-filter-fenced-code
[](https://github.com/bubkoo/hexo-filter-fenced-code/blob/master/LICENSE)
[](https://www.npmjs.com/packages/hexo-filter-fenced-code)
[](http://packagequality.com/#?package=hexo-filter-fenced-code)
> Extend syntax for the native fenced code block.
Feature:
- Extend syntax for the native fenced code block.
- Use tag-plugins as fenced code block.
## Markdown Extra Syntax
### The Native Fenced Code Block
```javascript
var foo = "bar";
```
### Highlight and Insert Code
```javascript+
var foo = "bar";
```
or
````javascript
var foo = "bar";
````
The code will be inserted as a `script` block:
```html
var foo = "bar";
```
### Just Insert Code
```javascript-
var foo = "bar";
```
or
`````javascript
var foo = "bar";
`````
**Note: Only JavaScript, CSS and HTML code can be inserted into a post. This feature is handily for building a quick demo.**
## Tag Plugins' Syntax Sugar
The native tag plugin looks like this:
- block
```swig
{% tagname [option1] [option2] ... %}
content
{% endblockquote %}
```
- inline
```swig
{% tagname [option1] [option2] ... %}
```
Use the syntax sugar as follow:
- block
```tagname [option1] [option2] ...
content
```
- inline
```tagname [option1] [option2] ...
```
## Related
- [hexo-toc](https://github.com/bubkoo/hexo-toc) Insert a markdown TOC before posts be rendered.
- [hexo-filter-flowchart](https://github.com/bubkoo/hexo-filter-flowchart) Generate flowchart diagrams for Hexo.
- [hexo-filter-sequence](https://github.com/bubkoo/hexo-filter-sequence) Generate UML sequence diagrams for Hexo.
- [hexo-filter-sub](https://github.com/bubkoo/hexo-filter-sub) Generate subscript (``) tag for Hexo.
- [hexo-filter-sup](https://github.com/bubkoo/hexo-filter-sup) Generate superscript (``) tag for Hexo.
- [hexo-theme-formula](https://github.com/bubkoo/hexo-theme-formula) Hexo theme base on jade and less.
## Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please [create an issue](https://github.com/bubkoo/hexo-filter-fenced-code/issues/new).