|
Cookbook /
MarkupTricksSummary: Markup tricks
Version:
Prerequisites: Should work on any v 2.0 PmWiki
Status:
Maintainer:
Categories: Markup
This page provides "markup tricks". Some workarounds to get to certain display results using existing markup. Do not confuse this page with MarkupExtensions, which adds new markup to PmWiki. Commenting out long blocks on a pageAlso known as: multiline comments If you want to put many lines of comments on a page that are only visible in edit view and that can include directives that you don't want processed, use the "if false" trick:
Spaceless block preformatHow can I do spaceless block preformat - that is, preformat multiple lines without prefixing each line with a single space? For instance, I want to display a code block in the wiki. The answer is our old friend, [=...=], but with a space on the line before the opening bracket. Here is an example:
[=
int main(int argc, char** argv)
{
time_t epoch;
char sdate[MAXS];
struct tm* tmP;
if (argc<2) {
USAGE(NULL);
}
}
In newer releases (~beta52) this is a good markup for code [@ a=b; c=b; @] If you are marking up a lot of code samples, you should check out SourceBlock. Indenting blocks of text with line breaksBlocks of text to which
Displaying directivesI tried to post a note to my authors saying: If you enter 3 tildes (~~~) in a row, PmWiki will automatically insert your name. My markup was: ... 3 tildes [=(~~~)=] in a row ... which renders exactly the way I want in preview, but renders when saved as: ... 3 tildes (NeilHerber) in a row ... The problem is that the 3 tildes are a "replace on save" markup -- the tildes are replaced with the
The workarounds are anything that causes the three tildes to not directly appear together, such as: [=~~=]~
~~~
This trick can be generalized to display any markup that you don't want rendered. The rule of thumb is to break up the markup with the [=...=] construct. WARNING: Reading the markup on this page in edit mode makes my head hurt! Insert spacing within a text lineTo insert additional spacing in a textline you can use space characters from the SpecialCharactersList like       .
Notes and CommentsI put these items here just to keep them from getting lost. Feel free to move them elsewhere if it makes more sense. -- NeilHerber March 16, 2005, at 12:24 PM See AlsoContributorsNeilHerber March 16, 2005, at 12:24 PM |