version=pmwiki-2.2.4 ordered=1 urlencoded=1 agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.37 Safari/530.5 author=Simon charset=ISO-8859-1 csum=warning about the use of HTML comments host=202.37.32.2 name=PmWiki.CommentMarkup rev=69 targets=PmWiki.ConditionalMarkup,PmWiki.WikiStyles,PmWiki.MarkupMasterIndex,Profiles.Chr text=(:Summary:various forms of comments and how to achieve them for wiki pages:)%0aThis page discusses various forms of ''comments'' and how to achieve them for wiki pages.%0a%0a!!! Types and kinds of comment%0a%0aThe word ''comment'' can mean many things. Here are some possible interpretations:%0a%0a:[[#source comment | Source comment]] or markup comment: This kind of comment is only \%0a supposed to show up in the source of a wiki page. They are useful \%0a for giving instructions to an author who edits a page. See below for an example.%0a%0a:[[#readercomment | Page comments]] or reader comments: These kind of comments are readers' notes on the contents \%0a of a page and take various forms. They might be embedded in the page \%0a or kept separate. See below for an example using wiki styles.%0a%0a:[[#htmlcomment | HTML comment]]: A piece of text that is output as a HTML comment, i.e. \%0a marked as a comment according to the HTML syntax in the resulting output.%0a%0a[[#sourcecomment]]%0a!!! Source comments%0a%0aA source comment is typically only intended to show up when an author edits a page. %0aSource comments are not included in the generated page output.%0a[[PmWiki/Conditional markup]] is one method of writing such a comment that is easy to create. Here is an example:%0a(:markup:)%0aBla...%0a(:if false:)%0a This text is a comment. It won't be shown,%0a nor appear in the generated HTML output%0a(:ifend:)%0abla.%0a(:markupend:)%0a%0aIn this case the source comment will not be exported to the HTML. %0a%0aThe other method is to to use the special directive [@(:comment:)@] for comments that produces no output. %0aHere is an example:%0a(:markup:)%0aBla...%0a(:comment Here is a comment that produces no output:)%0abla.%0a(:markupend:)%0a%0a%0a[[#htmlcomment]]%0a!!! HTML comments%0aIf you want the comment to appear in the html source of the page, you should instead make the comment ''invisible''. %0aYou could use the predefined [[PmWiki/wiki style(s)]] [@%25comment%25@] for this purpose. Here%0aare examples.%0a%0a(:markup:)%0aBla...%0a%25comment%25 This will be present, but hidden or invisible in the resulting output.%0a>>comment%3c%3c%0aThis text will be hidden or invisible in the resulting output.%0aYou can have several lines of comments when writing like this.%0a>>%3c%3c%0abla.%0a(:markupend:)%0aor%0a(:markup:)%0a# Bla...%0a# This will be present, but hidden as well %25item comment%25%0a# bla.%0a(:markupend:)%0a%0a:Note: someone who looks at the HTML output of this page ''will'' see the above comments.%0a: : technically this is achieved by the use of [@style='display:none'@]%0a:%25red%25''Warning''%25%25: This actually isn't a comment at all, PmWiki markupup, directives, etc are all active and functional, the results are simply not shown (as opposed to being embedded in an [[http://htmlhelp.com/reference/wilbur/misc/comment.html | HTML comment tag]]).%0a%0a%0a[[#readercomment]]%0a!!! Visible reader comments%0aAn example of a visible reader comment in a page using a [[PmWiki/wiki style(s)]] to mark text as being%0aa comment that appears with a special format.%0a(:markup:)%0a%25define=commentary apply=block background-color=#f8dce1 margin=1em border="1px dotted #ea97a4"%25%25%25%0aBla...%0a%0a%25commentary%25 This is a comment created using a wiki style %25%25%0a>>commentary%3c%3c%0aso is this%0a>>%3c%3c%0a%0abla.%0a(:markupend:)%0a%0aAs an alternative to the commenty style defined above, it could have been defined by adding the following to the%0alocal configuration file: %0a-> [@%0a$WikiStyle['commentary']['apply'] = 'block';%0a$WikiStyle['commentary']['background-color'] = '#f8dce1';%0a$WikiStyle['commentary']['margin'] = '1em';%0a$WikiStyle['commentary']['border'] = '1px dotted #ea97a4';%0a@]%0a%0aInformation found [[http://pmichaud.com/pipermail/pmwiki-users/2005-January/009345.html|here]]%0a%0a!!! Links and related information%0a%0a* [[PmWiki/WikiStyles]] %0a* [[PmWiki/ConditionalMarkup]]%0a* Cookbook recipes (mostly for page comments)%0a** [[Cookbook:CommentBox]]%0a** [[Cookbook:CommentPageLink]]%0a** [[Cookbook:Comments]] — uses separate file to store (page) comments%0a** [[Cookbook:GeneratePDF]] — origin of the HTML comment%0a* [[PmWiki/MarkupMasterIndex]]%0a%0a%0a!!! Contributors%0a* [[~chr]]%0a time=1249005379