Skip to content

Commit eaa2247

Browse files
committed
update readme
1 parent 354a7af commit eaa2247

File tree

4 files changed

+97
-0
lines changed

4 files changed

+97
-0
lines changed

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,88 @@ Below is an example with line numbers, a custom header, and line highlighting.
88

99
![exampleImage](https://raw.githubusercontent.com/mProjectsCode/obsidian-shiki-plugin/master/exampleImage.png)
1010

11+
## Comparison
12+
13+
Default Obsidian syntax highlighting:
14+
15+
![exampleImageObsidian](https://raw.githubusercontent.com/mProjectsCode/obsidian-shiki-plugin/master/exampleImageObsidian.png)
16+
17+
Shiki Plugin syntax highlighting:
18+
19+
![exampleImagePlain](https://raw.githubusercontent.com/mProjectsCode/obsidian-shiki-plugin/master/exampleImagePlain.png)
20+
21+
## Usage
22+
23+
The plugin will automatically highlight code blocks in your notes.
24+
25+
To configure the code block you add the configuration options on the same line as the opening triple backticks.
26+
27+
````md
28+
```language configurationHere
29+
...
30+
```
31+
````
32+
33+
More info on the configuration options can be found on the [Expressive Code homepage](https://expressive-code.com/).
34+
35+
### Line Numbers
36+
37+
Line numbers can be enabled with `showLineNumbers`.
38+
39+
````md
40+
```language showLineNumbers
41+
...
42+
```
43+
````
44+
45+
### Title
46+
47+
A title can be added with `title="Title Here"`.
48+
49+
````md
50+
```language title="Title Here"
51+
...
52+
```
53+
````
54+
55+
### Line Highlighting
56+
57+
Line highlighting can be enabled with `{1, 5-10}`.
58+
Lines can either be single lines or ranges.
59+
60+
````md
61+
```language {1, 5-10}
62+
...
63+
```
64+
````
65+
66+
#### Diff Highlighting
67+
68+
Diff highlighting can be enabled with `ins={1}` and `del={5-10}`.
69+
Lines specified in `ins` will be highlighted green, and lines specified in `del` will be highlighted red.
70+
Lines can once again either be single lines or ranges.
71+
72+
````md
73+
```language ins={1} del={5-10}
74+
...
75+
```
76+
````
77+
78+
When the language is set to `diff`, the plugin will automatically enable diff highlighting for lines either prefixed by `+` or `-`.
79+
1180
## License
1281

1382
[MIT](https://github.com/mProjectsCode/obsidian-shiki-plugin/blob/master/LICENSE)
1483

1584
## Installation
1685

86+
### Obsidian Marketplace (Recommended)
87+
88+
1. Open `Settings -> Community Plugins` in your vault
89+
2. Click on the `Browse` button in the `Community plugins` section
90+
3. Search for `Shiki Highlighter`
91+
4. Select `Shiki Highlighter` and click first `Install`, then `Enable`
92+
1793
### BRAT
1894

1995
1. Install and enable the `BRAT` plugin

exampleImageObsidian.png

43.6 KB
Loading

exampleImagePlain.png

46.7 KB
Loading

exampleVault/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,27 @@ input:is([data-task="字"], [data-task="字"] > *):checked::after {
6060
}
6161
```
6262

63+
```css
64+
input:is([data-task=""], [data-task=""] > *):checked::after {
65+
content: "";
66+
color: transparent;
67+
font-weight: 600;
68+
text-align: center;
69+
-webkit-mask-image: linear-gradient(black, white);
70+
-webkit-mask-size: 100%;
71+
-webkit-mask-clip: text;
72+
}
73+
input:is([data-task=""], [data-task=""] > *):checked::after {
74+
content: "";
75+
color: transparent;
76+
font-weight: 600;
77+
text-align: center;
78+
-webkit-mask-image: linear-gradient(black, white);
79+
-webkit-mask-size: 100%;
80+
-webkit-mask-clip: text;
81+
}
82+
```
83+
6384
Bash
6485

6586
```bash title="Other Title"

0 commit comments

Comments
 (0)