|
PmWiki /
CommentMarkupThis page discusses various forms of comments and how to achieve them for wiki pages. Types and kinds of commentThe word comment can mean many things. Here are some possible interpretations:
Examples of source commentsA source comment is typically only intended to show up when an author edits a page. Conditional markup is one method of writing such a comment that is easy to create. Here is an example:
In this case the source comment will not be exported to the HTML. If you want the comment to appear in the html source of the page, you should instead make the comment invisible. You could use the predefined wiki style
or
Note that someone who looks at the HTML output of this page will see the above comments. An alternative to using
As a final alternative, it is also possible to use the special directive
Example of a visible comment in a page using wiki stylesHere is an example of using a wiki style to mark text as being a comment that appears with a special style.
The commentary wiki style used in the previous example was defined through the following markup
%define=commentary apply=block \
background-color=#f8dce1 \
margin=1em \
border="1px dotted #ea97a4"%%%
As an alternative, it could have been defined by adding the following to the local configuration file:$WikiStyle['commentary']['apply'] = 'block'; $WikiStyle['commentary']['background-color'] = '#f8dce1'; $WikiStyle['commentary']['margin'] = '1em'; $WikiStyle['commentary']['border'] = '1px dotted #ea97a4'; Information found here Kale Stutzman? - Coming from a C background (but really this could apply to anyone) I have found the above methods unfamilar, hard to read, as well just too much extra code to type. By adding the following line to config.php and editing it accordingly, any sequence of charactors can be used for comments.
Special characters need to have two backslashes -
HTML commentYou can use the directive described below in case you would like to use
markup to create a comment that appears as an HTML comment (i.e. it is
embedded in You can create the directive
## (:HTML-comment:)
Markup('HTML-comment', 'directives',
'/\\(:HTML-comment (.*?):\\)/i', '<!-- $1 -->');
Then simply use the directive as follows: (:HTML-comment This text will become an HTML comment:) Note: This information was modified from Cookbook:GeneratePDF and has not been tested. ccox - I use it and depend upon it.. I wrote that little blurb of a recipe. It works. However, I override the (:comment:) directive. It simply makes your wiki comments show up as HTML comments. I did this to allow the htmldoc processor used by the Cookbook:GeneratePDF to use the comments to control the PDF output (e.g. page breaks). Links and related information
Contributors |