mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-09 19:39:57 +00:00
a4b24670f6
* update highlight.js to latest release v9.13.1 * update to v9.13.1 default.css does the current default.css include adjustments for the different languages? * Update highlight.pack.js * Update readme.tid * update highlight.pack to 9.15.6 * update version number + included languages
72 lines
1.5 KiB
Plaintext
72 lines
1.5 KiB
Plaintext
title: $:/plugins/tiddlywiki/highlight/readme
|
|
|
|
This plugin provides syntax highlighting of code blocks using v9.15.6 of [[highlight.js|https://github.com/isagalaev/highlight.js]] from Ivan Sagalaev.
|
|
|
|
! Usage
|
|
|
|
When the plugin is installed it automatically applies highlighting to all codeblocks defined with triple backticks or with the CodeBlockWidget.
|
|
|
|
The language can optionally be specified after the opening triple braces:
|
|
|
|
<$codeblock code="""```css
|
|
* { margin: 0; padding: 0; } /* micro reset */
|
|
|
|
html { font-size: 62.5%; }
|
|
body { font-size: 14px; font-size: 1.4rem; } /* =14px */
|
|
h1 { font-size: 24px; font-size: 2.4rem; } /* =24px */
|
|
```"""/>
|
|
|
|
If no language is specified highlight.js will attempt to automatically detect the language.
|
|
|
|
! Built-in Language Brushes
|
|
|
|
The plugin includes support for the following languages (referred to as "brushes" by highlight.js):
|
|
|
|
* apache
|
|
* arduino
|
|
* arm assembly
|
|
* asciidoc
|
|
* autohotkey
|
|
* awk
|
|
* bash
|
|
* cmake
|
|
* coffeescript
|
|
* cpp
|
|
* cs
|
|
* css
|
|
* diff
|
|
* dockerfile
|
|
* erlang
|
|
* fortran
|
|
* go
|
|
* gradle
|
|
* haskell
|
|
* html
|
|
* http
|
|
* ini
|
|
* intel x86 assembly
|
|
* java
|
|
* javascript
|
|
* json
|
|
* kotlin
|
|
* makefile
|
|
* markdown
|
|
* mathematica
|
|
* matlab
|
|
* nginx
|
|
* objectivec
|
|
* perl
|
|
* php
|
|
* powershell
|
|
* python
|
|
* R
|
|
* ruby
|
|
* rust
|
|
* sql
|
|
* typescript
|
|
* vim script
|
|
* xml
|
|
* yaml
|
|
|
|
You can also specify the language as a MIME content type (eg `text/html` or `text/css`). The mapping is accomplished via mapping tiddlers whose titles start with `$:/config/HighlightPlugin/TypeMappings/`.
|