custom
is any word you like to useplugin:codeprism
Table of Contents
codeprism Plugin
Compatible with DokuWiki
- 2024-02-06 "Kaos" yes
- 2023-04-04 "Jack Jackrum" yes
- 2022-07-31 "Igor" unknown
- 2020-07-29 "Hogfather" unknown
Installation
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Examples / Usage
Syntax highlight
Command line
CSS preview
You can also watch demos at here.
Syntax
Codeprismsupports two syntax:
- <codeprism attributes>Your code…</codeprism>
- <fileprism attributes />
Table 1 and Table 2 list the attributes supported by the above syntax.
Table 1. Attributes supported by <codeprism> | |||
---|---|---|---|
Key | Description | Value | Example |
title | Specify code title | A string without spaces. | title=codeprism.css |
el | Enable line numbers | true , false . | el=true |
sl | Start line number | One number. | sl=10 |
hl | Highlight line numbers | One number or multiple numbers with , or - (- indicates range). | hl=1,3,4-9 |
lang | Language | See this page. | lang=php |
cmd | Command line style | true . (If cmdout is set, cmd is set to true by default.) | cmd=true |
cmdout | Command output line numbers | One number or multiple numbers with , or - (- indicates range). | cmdout=2,4,6-9 |
css | Assign a custom CSS to the code block | Default is dft . You can create a CSS named pre.dokuwiki-plugin-codeprism-custom 1) in conf/userstyle.css and use it by css=custom . | css=custom |
user | Specify the user name at the command shell prompt | A string without spaces. (If the user is not specified, the default user name configured in the Configuration Settings is used. You can also use user to re-specify a new user name.) | user=Source |
host | Specify the host name at the command shell prompt | A string without spaces. (If the host is not specified, the default host name configured in the Configuration Settings is used. You can also use host to re-specify a new host name.) | host=Debian |
Table 2. Attributes supported by <fileprism> | |||
---|---|---|---|
Key | Description | Value | Example |
src | Specifies file path | File path. | src=:media:code:test.py |
range | Specifies the lines to be displayed in the file | n for display line n.n, for display all lines start at n.m,n for display line m to line n. | range=4 range=4, range=4,20 |
hl | See hl in codeprism | ||
el | See el in codeprism | ||
css | See css in codeprism | ||
title | See title in codeprism |
Configuration and Settings
Setting | Description |
---|---|
theme | Specify Codeprism theme. |
cdn | Specify a CDN which provide PrismJS. |
custom-cdn | Specify the CDN yourself if the CDNs listed in the setting cdn does not meet your needs. |
override-code | True to override code syntax. |
show-invis | True to show hidden characters such as tabs and line breaks. |
hl-brace | True to highlight brace pairs when the cursor hovers over one of the braces. |
previewer | True to enable preview angle, color, gradient, easing, and time. |
user | Specify the default user name at the command shell prompt when using command line style2). |
host | Specify the default host name at the command shell prompt when using command line style3). |
Development
The source code of the plugin is available at GitHub: https://github.com/siyuanl96/dokuwiki-plugin-codeprism.
Changelog
- Update LICENSE (2023-12-18 18:07)
- Create LICENSE (2023-12-03 08:44)
- Add `custom cdn` option (2023-12-03 08:32)
- Add option (2023-11-27 16:18)
- Fix CSS previewer issue (2023-11-25 17:24)
- Add more options (2023-11-24 16:05)
- Refine code (2023-10-18 16:36)
- Refine coding style (2023-07-16 16:27)
Known Bugs and Issues
N/A
ToDo/Wish List
N/A
FAQ
N/A
plugin/codeprism.txt · Last modified: by 2407:b9c0:f001:50:5054:ff:fe0e:f15d