DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:codeprism

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
plugin:codeprism [2023-12-03 09:55] – created siyuanliuplugin:codeprism [2023-12-08 07:18] (current) – [codeprism Plugin] siyuanliu
Line 2: Line 2:
  
 ---- plugin ---- ---- plugin ----
-description: +description: Provide nice syntax highlighting using Prism.js
 author     : siyuanliu  author     : siyuanliu 
 email      : siyuanl96@gmail.com  email      : siyuanl96@gmail.com 
 type       : syntax, action type       : syntax, action
 lastupdate : 2023-12-03 lastupdate : 2023-12-03
-compatible : "Jack Jackrum"+compatible : Jack Jackrum
 depends    :  depends    : 
 conflicts  conflicts 
-similar    : dokuprism +similar    : dokuprism, codify 
-tags       : code, prismhighlight+tags       : code, prismjssyntaxhighlight
  
 downloadurl: https://github.com/siyuanl96/dokuwiki-plugin-codeprism/archive/refs/tags/v1.0.tar.gz downloadurl: https://github.com/siyuanl96/dokuwiki-plugin-codeprism/archive/refs/tags/v1.0.tar.gz
Line 25: Line 25:
 Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
-===== Examples/Usage =====+===== Examples / Usage =====
  
-{{https://raw.githubusercontent.com/siyuanl96/dokuwiki-issue/main/codeprism/codeprism-demo.png}}+=== Syntax highlight ===
  
-You can also watch more demos at [[https://wiki.pushmindstack.com/tools/dokuwiki/codeprism|here]].+{{https://raw.githubusercontent.com/siyuanl96/dokuwiki-issue/main/codeprism/codeprism-demo.png?400x200&recache}} 
 + 
 +=== Command line === 
 + 
 +{{https://raw.githubusercontent.com/siyuanl96/dokuwiki-issue/main/codeprism/codeprism-cmdline.png?400x200&recache}} 
 + 
 +=== CSS preview === 
 + 
 +{{https://raw.githubusercontent.com/siyuanl96/dokuwiki-issue/main/codeprism/codeprism-previewer.png?400x200&recache}} 
 + 
 +You can also watch demos at [[https://wiki.pushmindstack.com/tools/dokuwiki/codeprism|here]].
  
 ===== Syntax ===== ===== Syntax =====
Line 40: Line 50:
  
  
-^ Key                         ^ Description                                        ^ Value                                                                                                                                                                                                                                                                 ^ Example                  ^ +^  Table 1. Attributes supported by %%<%%codeprism%%>%%                                                                                                                                                                                                                                                                                                                                |||| 
-| ''title''    | Specify code title                                 | A string without spaces.                                                                                                                                                                                                                                              | ''title=codeprism.css'' +^ Key                                                    ^ Description                                        ^ Value                                                                                                                                                                                                                                          ^ Example                  ^ 
-| ''el''          | Enable line numbers                                | ''true'', ''false''                                                                                                                                                                                                                                                 | ''el=true''              | +| ''title''                                              | Specify code title                                 | A string without spaces.                                                                                                                                                                                                                       | ''title=codeprism.css'' 
-| ''sl''                      | Start line number                                  | One number.                                                                                                                                                                                                                                                           | ''sl=10''                | +| ''el''                                                 | Enable line numbers                                | ''true'', ''false''                                                                                                                                                                                                                          | ''el=true''              | 
-| ''hl''          | Highlight line numbers                             | One number or multiple numbers with '','' or ''-'' (''-'' indicates range).                                                                                                                                                                                           | ''hl=1,3,4-9''           | +| ''sl''                                                 | Start line number                                  | One number.                                                                                                                                                                                                                                    | ''sl=10''                | 
-| ''lang''                    | Language                                           | See [[https://prismjs.com/index.html#supported-languages|this page]].                                                                                                                                                                                                 | ''lang=php''             | +| ''hl''                                                 | Highlight line numbers                             | One number or multiple numbers with '','' or ''-'' (''-'' indicates range).                                                                                                                                                                    | ''hl=1,3,4-9''           | 
-| ''cmd''        | Command line style                                 | ''true''. (If '''' is set, ''cmd'' is set to ''true'' by default.)                                                                                                                                                                                  | ''cmd=true''             | +| ''lang''                                               | Language                                           | See [[https://prismjs.com/index.html#supported-languages|this page]].                                                                                                                                                                          | ''lang=php''             | 
-| ''cmdout''  | Command output line numbers                        | One number or multiple numbers with '','' or ''-'' (''-'' indicates range).                                                                                                                                                                                           | ''cmdout=2,4,6-9''       | +| ''cmd''                                                | Command line style                                 | ''true''. (If ''cmdout'' is set, ''cmd'' is set to ''true'' by default.)                                                                                                                                                                       | ''cmd=true''             | 
-| ''css''        | Assign a custom CSS to the code block              | Default is ''dft''. You can create a CSS named ''pre.dokuwiki-plugin-codeprism-**custom**'' ((''custom'' is any word you like to use)) in [[https://www.dokuwiki.org/devel:css#user_styles|conf/userstyle.css]] and use it by ''css=custom'' | ''css=custom''           | +| ''cmdout''                                             | Command output line numbers                        | One number or multiple numbers with '','' or ''-'' (''-'' indicates range).                                                                                                                                                                    | ''cmdout=2,4,6-9''       | 
-| ''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''          | +| ''css''                                                | Assign a custom CSS to the code block              | Default is ''dft''. You can create a CSS named ''pre.dokuwiki-plugin-codeprism-**custom**'' ((''custom'' is any word you like to use)) in [[devel:css#user_styles|conf/userstyle.css]] and use it by ''css=custom'' | ''css=custom''           | 
-| ''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''          |+| ''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''          |
  
  
-^ Key        ^ Description                                      ^ Value                                                                                                         ^ Example                                      ^ +^  Table 2. Attributes supported by %%<%%fileprism%%>%%                                                                                                                                                                                                                 |||| 
-| ''src''    | Specifies file path                              | File path.                                                                                                    | ''src=:media:code:test.py''                  | +^ Key                                                    ^ Description                                      ^ Value                                                                                                         ^ Example                                      ^ 
-| ''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'' +| ''src''                                                | Specifies file path                              | File path.                                                                                                    | ''src=:media:code:test.py''                  | 
-| ''hl''     | See ''hl'' in ''codeprism''              |                                                                                                                                                            | +| ''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'' 
-| ''el''     | See ''el'' in ''codeprism''              |                                                                                                                                                            | +| ''hl''                                                 | See ''hl'' in ''codeprism''                      |                                                                                                                                                            | 
-| ''css''    | See ''css'' in ''codeprism''            |                                                                                                                                                            | +| ''el''                                                 | See ''el'' in ''codeprism''                      |                                                                                                                                                            | 
-| ''title''  | See ''title'' in ''codeprism''        |                                                                                                                                                            |+| ''css''                                                | See ''css'' in ''codeprism''                     |                                                                                                                                                            | 
 +| ''title''                                              | See ''title'' in ''codeprism''                   |                                                                                                                                                            |
  
 ===== Configuration and Settings ===== ===== Configuration and Settings =====
  
-^ Setting        ^ Description                                                                                         +^ Setting        ^ Description                                                                                                                         
-Theme          | Specify Codeprism theme.                                                                            +theme          | Specify Codeprism theme.                                                                                                            
-| cdn            | Specify a CDN which provide PrismJS.                                                                +| cdn            | Specify a CDN which provide PrismJS.                                                                                                
-| custom-cdn     | Specify the CDN yourself if the CDNs listed in the <wrap menu>cdn</wrap> does not meet your needs.  +| 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.                                                               +| override-code  | **True** to override ''code'' syntax.                                                                                               
-| show-invis     | **True** to show hidden characters such as tabs and line breaks.                                    +| 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.                    +| 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.                                +| previewer      | **True** to enable preview angle, color, gradient, easing, and time.                                                                
-| user           | Specify the default user name at the command shell prompt when using [[#cmd|command line style]]  +| user           | Specify the default user name at the command shell prompt when using command line style((Using ''cmd'' or ''cmdout'' attribute.)).  
-| host           | Specify the default host name at the command shell prompt when using [[#cmd|command line style]]  |+| host           | Specify the default host name at the command shell prompt when using command line style((Using ''cmd'' or ''cmdout'' attribute.)).  |
  
 ===== Development ===== ===== Development =====
plugin/codeprism.1701593752.txt.gz · Last modified: 2023-12-03 09:55 by siyuanliu

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki