README file from
GithubObsidian Code Previews Plugin
Example
Specific examples can be use Open folder as vault open example.zip.
Path
Code language is extname by path
The root path is Vault folder
CodeBlock language
Code language is extname by path
Language key: language、lang
Select display line range
custom start or end
end: "+1", config " is required.
/dd\d{2}/
If you don't know RegExp, just use text directly. like:
start: body: match body inside the line
end: dd00dd: match dd00dd inside the line
Highlight
Separator ,.
YAML list
CodeBlock YAML config
| Config | Description | Type | Default |
|---|---|---|---|
| path | file path | string | Required |
| start | preview start line. Start with 1 | number or string or RegExp | - |
| end | preview end line. | number or string or RegExp | - |
| highlight | highlight lines | number or string or RegExp | - |
| linenumber | display line Numbers, priority is greater than the plugin configuration | true or false | plugin config |
Plugin configuration
| Config | Description | Type | Default |
|---|---|---|---|
| watchAlias | Listening Alias folder changes, update input suggest. May affect performance | boolean | false |
| watchCode | Listen to the previewed code file and update the render when the file changes. May affect performance | boolean | false |
| highLightColor | highlight background | css color | #2d82cc20 |
| include | include path, Empty is All | Array<string or RegExp> |
[] |
| exclude | exclude path | Array<string or RegExp> |
["node_modules", ".obsidian"] |
| includeFile | include file, Required | Array<string or RegExp> |
["/\.js$/", "/\.css$/"] |
| excludeFile | exclude file | Array<string or RegExp> |
[] |
| alias | alias path | string | Alias | code |
| linenumber | display linenumber | true or false | true |
Thank
linenumber, highlight Based on obsidian-better-codeblock his implementation