|
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:
Source commentsA source comment is typically only intended to show up when an author edits a page. Source comments are not included in the generated page output. 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. The other method is to to use the special directive
HTML commentsIf 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
Visible reader commentsAn example of a visible reader comment in a page using a wiki style to mark text as being a comment that appears with a special format.
As an alternative to the commenty style defined above, 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 Other typesKale 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. Markup("user-comment", "directives", "/front bracket code(.*?)end bracket code/", "");
Special characters need to have two backslashes - Markup("user-comment", "directives", "/\\/\\*(.*?)\\*\\//", "");
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). QuestionsWhy doesn't the following work?
or
Links and related information
Contributors |
Bla... Another form of block comment.