plugin:codedoc
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:codedoc [2018-04-19 17:58] – [Installation] turnermm | plugin:codedoc [2022-08-13 04:40] (current) – [codedoc Plugin] turnermm | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
- | author | + | author |
- | email : turnermm02@shaw.ca | + | email : turnermm02@shaw.ca |
type : syntax | type : syntax | ||
- | lastupdate : 2016-07-31 | + | lastupdate : 2018-04-20 |
- | compatible : lemming,anteater,rincewind,angua,adora belle,weatherwax,binky," | + | compatible : Lemming, Anteater, Rincewind, Angua, Adora belle, |
depends | depends | ||
conflicts | conflicts | ||
Line 21: | Line 21: | ||
===== Installation ===== | ===== Installation ===== | ||
- | Install | + | Search and install |
===== Examples/ | ===== Examples/ | ||
Line 30: | Line 29: | ||
- codedoc creates code blocks, either of file or code types, into which you can embed comments that support HTML markup, including both internal and external links. | - codedoc creates code blocks, either of file or code types, into which you can embed comments that support HTML markup, including both internal and external links. | ||
- it supports nested code blocks that can be toggled for display and hiding. | - it supports nested code blocks that can be toggled for display and hiding. | ||
+ | |||
===== Syntax ===== | ===== Syntax ===== | ||
+ | |||
==== Basic Models ==== | ==== Basic Models ==== | ||
Line 71: | Line 72: | ||
This nesting of the codedoc containers is limited to one level, that is you can't include a toggle inside another toggle. | This nesting of the codedoc containers is limited to one level, that is you can't include a toggle inside another toggle. | ||
+ | |||
==== Geshi ==== | ==== Geshi ==== | ||
- | Support for geshi highighting: | + | |
+ | Support for geshi highighting: | ||
< | < | ||
<codedoc code: | <codedoc code: | ||
Line 78: | Line 81: | ||
</ | </ | ||
</ | </ | ||
+ | |||
==== No Numbers ==== | ==== No Numbers ==== | ||
Line 89: | Line 93: | ||
==== Support for Comments ==== | ==== Support for Comments ==== | ||
- | With codedoc you can add HTML formatted commentary to your code; these comments can contain links and therefore allow for cross-referencing. | + | |
+ | With codedoc you can add HTML formatted commentary to your code; these comments can contain links and therefore allow for cross-referencing. | ||
=== 1. Timestamp === | === 1. Timestamp === | ||
Line 95: | Line 100: | ||
The first simply creates a timestamp for the file which contains the documented code: | The first simply creates a timestamp for the file which contains the documented code: | ||
- | ~~codedoc: | + | |
=== 2. User Name === | === 2. User Name === | ||
This outputs the current user's name. | This outputs the current user's name. | ||
- | | + | |
+ | | ||
The timestamp and the user name are independent of the codedoc container and can be placed anywhere in a document. | The timestamp and the user name are independent of the codedoc container and can be placed anywhere in a document. | ||
Line 109: | Line 115: | ||
~~codedoc: | ~~codedoc: | ||
- | The comment can contain | + | The comment can contain |
| | ||
- | ~~codedoc:Dokuwiki | + | |
- | As the above demonstrates, | + | As the above demonstrates, |
- | One of the benefits of codedoc is that its comments support HTML markup. Comments will appear on more than one line if you insert HTML line-breaks into the comment or if the comment contains an internal newline. | + | One of the benefits of codedoc is that its comments support HTML markup. Comments will appear on more than one line if you insert HTML line-breaks into the comment or if the comment contains an internal newline. |
< | < | ||
- | | + | /* |
- | | + | comment |
- | | + | **/ |
</ | </ | ||
Otherwise the comment will have the single line format: | Otherwise the comment will have the single line format: | ||
- | | + | |
In actual fact, the plugin looks only for the opening side of the markup, '< | In actual fact, the plugin looks only for the opening side of the markup, '< | ||
Line 131: | Line 137: | ||
An " | An " | ||
- | | + | |
- | and so would be formatted as a | + | and so would be formatted as a |
- | multi-line comment~~ | + | multi-line comment~~ |
The result would be: | The result would be: | ||
- | /* | ||
- | This comment appears on more than one line | ||
- | and would be formatted as a | ||
- | multi-line comment | ||
- | **/ | ||
- | | ||
- | === 4. Named Anchor === | ||
- | | + | /* |
- | + | This comment appears on more than one line | |
- | This will create a named anchor in your page, enabling you to link to places in your code, on the same or other pages, which are not marked by the anchors which Dokuwiki | + | and would be formatted as a |
+ | multi-line comment | ||
+ | **/ | ||
+ | |||
+ | === 4. Selective Highlighting === | ||
+ | |||
+ | ~~codedoc: <em>. . . </ | ||
+ | ~~codedoc: <b>. . . </ | ||
+ | |||
+ | If the enclosed text contains either an ''< | ||
+ | the plugin' | ||
+ | italic. | ||
+ | file also has the option to treat either the '' | ||
+ | the relevant css. This is useful for emphasizing single words or phrases. | ||
+ | |||
+ | === 5. Named Anchor === | ||
+ | |||
+ | | ||
+ | |||
+ | This will create a named anchor in your page, enabling you to link to places in your code, on the same or other pages, which are not marked by the anchors which DokuWiki | ||
==== Literals ==== | ==== Literals ==== | ||
+ | |||
~~codedoc: | ~~codedoc: | ||
- | In order to support links in codedoc comments, the codedoc plugin must accept | + | In order to support links in codedoc comments, the codedoc plugin must accept |
- | are included in a codedoc code block, | + | |
being substituted for | being substituted for | ||
- | 8-) | + | |
+ | | ||
you would enter the following: | you would enter the following: | ||
- | ~~codedoc: | + | |
- | This is the equivalent of Dokuwiki's double percent sign syntax: | + | |
- | %%8-)%% | + | |
+ | This is the equivalent of DokuWiki's double percent sign syntax: | ||
+ | |||
+ | | ||
==== CSS Styles ==== | ==== CSS Styles ==== | ||
+ | |||
codedoc higlights its comments in blue and outputs its literals in black. | codedoc higlights its comments in blue and outputs its literals in black. | ||
- | .codedoc_hilite { color: blue; } | + | |
- | | + | .codedoc_clean { color: black; } |
- | + | ||
- | + | ||
==== Illustrations Showing toggled blocks both in closed and open states==== | ==== Illustrations Showing toggled blocks both in closed and open states==== | ||
+ | |||
== Closed == | == Closed == | ||
- | {{ http:// | + | {{ http:// |
== Open == | == Open == | ||
- | {{ http:// | + | {{ http:// |
== Two line comment == | == Two line comment == | ||
- | {{ http:// | + | {{ http:// |
===== Development ===== | ===== Development ===== | ||
=== Change Log === | === Change Log === | ||
+ | |||
{{rss> | {{rss> | ||
plugin/codedoc.1524153510.txt.gz · Last modified: 2018-04-19 17:58 by turnermm