PZZ(NoCache( $GLOBALS['HTMLStylesFmt'][] = PSS($m[1]) )) This page summariezes many wiki style rules and tells you how and/or when they should be used. Thus, this is good point to start when you want to create nice uniform pages.
How can you create a new page? Well, there a two possibilities to archive this:
more infos about creating new pages.
The first step to create a new page is to edit an existing page and add a link to the page you want to create.
[[my new page]]
will create a link to my new page?. There's a lot you can do with double bracket links.
You can see that the links to my new page? all have question marks after them. That's because my new page? hasn't been written yet. Clicking the link as second step will take you to an edit form where you could write and finally save the new page.
Another way to create a page: in your browser's address bar (where the page URL is), replace the name of the current page with the name of the page you wish to create, and hit Enter or do whatever you would normally do to go to a new location. PmWiki will then dutifully tell you that the page you entered doesn't exist, but you can click on the "Edit" link in order to create, edit, and save the new page.
The drawback to this method is that there are no links to your new page, so you're the only person who knows it exists. It will be an orphan, unread, unlinked, unloved. That's why adding a link to an existing page or to the SideBar is a better way to create a page.
Learn more:
How do I create a new page?
Typing [[my new page]] will create a link to the new page. There's a lot you can do with double bracket links.
Why do some new pages have a title with spaces like "Creating New Pages" and others end up with a WikiWord-like title like "CreatingNewPages"?
The default page title is simply the name of page, which is normally stored as "CreatingNewPages." However, you can override a page's title by using the (:title Creating New Pages:)
directive. This is especially useful when there are special characters or capitalization that you want in the title that cannot be used in the page name.
A key feature of wiki-based systems is the ease of creating hyperlinks (or short links) in the text of a document. PmWiki provides multiple mechanisms for creating such links.
To create an internal link to another page, simply enclose the name of the page inside double square brackets, as in [[wiki sandbox]]
or [[installation]]
. This results in links to wiki sandbox and installation, respectively.
PmWiki creates a link by using the text inside the double brackets. It does this by removing spaces between the words, and automatically capitalizing the first letter of each word following spaces or other punctuation (like ~). Thus [[Wiki Sandbox]]
, [[wiki sandbox]]
, and [[WikiSandbox]]
all display differently but create the same link to the page titled WikiSandbox
.
Or in other words, PmWiki will automatically create the "link path name" using the page name in CamelCase, but the "link text" will display in the format you have entered it.
Some PmWiki sites (default not) will recognize words written in CamelCase, called a WikiWord, automatically as a link to a page of the same name.
There are three ways to get a different link text:
[[(wiki) sandbox]]
links to WikiSandbox but displays as sandbox. For addresses actually containing parentheses, use %28 and %29 http://www.example.com/linkwith%28parenthese%29.
[[WikiSandbox | a play area]]
, or you can use an arrow (->
) to reverse the order of the link text and the target, as in [[a play area -> WikiSandbox]]
. Both links displays as a play area.
[[PageName|+]]
link markup, e.g. page BasicEditing
contains the directive (:title Basic PmWiki editing rules:) with the result that a link written as [[BasicEditing|+]]
will display as Basic PmWiki editing rules. FontSize('0.846', $m[1])On top of above ways, a suffix can be added to the end of a link, which becomes part of the link text but not of the target page name.
Note: This feature works with the [[PageName|+]]
markup only since Version 2.2.90.
FontSize('0.846', $m[1]) |
FontSize('0.846', $m[1]) |
* [[PmWiki/(wiki) sandbox]] * [[PmWiki/(wiki) sandbox]]es * [[PmWiki/WikiSandbox | wiki sandbox]], * [[PmWiki/WikiSandbox | wiki sandbox]]es * [[PmWiki/BasicEditing | +]] |
From version 2.2.14 PmWiki can show tooltip titles with the following format:
[[http://pmwiki.org"external tool tip title" | external link ]]
, eg external link or http://pmwiki.org
[[Links"internal tool tip title" | internal link ]]
, eg internal link? or Links?
[[#name"anchor tool tip title"|anchor link text]]
(since Version 2.2.48), eg anchor link text or #name
[[Wikipedia:Wiki"tool tip title"| InterMap link ]]
, eg InterMap link or Wikipedia:Wiki
Links to nonexistent pages? are displayed specially, to invite others to create the page. See Creating new pages to learn more.
Links as written above are links between pages of the same group. To create a link to a page in another group, add the name of that other group together with a dot or slash as prefix to the page name. For example, links to Main/WikiSandbox
could be written as:
FontSize('0.846', $m[1]) |
FontSize('0.846', $m[1]) |
* [[Main.WikiSandbox]] * [[Main/WikiSandbox]] * [[(Main.Wiki)Sandbox]] * [[Main.WikiSandbox | link text]] * [[Main.WikiSandbox | +]] |
To link to the "default home page" of a group, the name of the page can be omitted:
* [[Main.]] * [[Main/]] |
See Wiki Group to learn more about PmWiki groups.
Categories are a way to organize and find related pages. The idea is that every page that falls into a particular subject area should have a link to a shared page containing links to other pages on that subject. These shared pages are created in the special group Category
, and thus these subject areas are called "categories".
Adding a page to the category Subject
is simple by adding the [[!Subject]]
markup somewhere on that page. This will create a link to the page Category.Subject
. So [[!Subject]]
is a kind of link shortcut to the page Category.Subject
. See Categories to learn more.
Similar is [[~Author]]
a link shortcut to the page Author
in the special group Profiles
. PmWiki automatically creates this type of link for the current author, when it encounters three tilde characters (~
) in a row (~
~
~
) in the page text. The current author is the name found in the "Author" field, when you create or modify a page. The current date and time is appended when four tilde characters in a row are encountered (~
~
~
~
).
So, when the Author field contains "Author":~
~
~
markup will be replaced by: Author?~
~
~
~
markup will be replaced by: Author? October 10, 2010, at 04:50 PM
[[PageName|#]]
creates a reference link as shown below[1].
To define a location, or bookmark, within a page to which you may jump directly, use the markup [[#name]]
. This creates an "anchor" that uniquely identifies that location in the page. Then to have a link jump directly to that anchor, use one of
[[#name|link text]]
within the same page, or
[[PageName#name]]
or [[PageName#name|link text]]
for a location on another page
[[PageName(#name)]]
may be useful for hiding the anchor text in a link.
For example, here's a link to the Intermaps section, below.
[[#my anchor]]
" won't work, "[[#myanchor]]
" will.
While in HTML the purpose of anchors is mostly for jumping to a position in the text, in PmWiki they serve an internal purpose, too: Each anchor also creates a section, because sections are defined as the part of the page between their start anchor and the next anchor. For more details, see Page Sections.
To link to a specific action for the current page use [[{$FullName}?action=actionname|linkname]]
.
[[{$FullName}?action=edit|Edit]]
for editing
[[{$FullName}?action=diff|differences]]
for differences.
Links to external sites simply begin with a prefix such as 'http:', 'ftp:', etc. Thus http://google.com/
and [[http://google.com/]]
both link to Google. As with the above, an author can specify the link text by using the vertical brace or arrow syntax, as in [[http://google.com/ | Google]]
and [[Google -> http://google.com]]
.
If the external link includes (parentheses), escape these using %28 for "(" and %29 for ")" :
[[http://en.wikipedia.org/wiki/Wiki_%28disambiguation%29 | link to "Wiki (disambiguation)" ]] |
The recipe Cookbook:FixURL makes it easy to encode parentheses and other special characters in link addresses.
To have any special characters, including quotes, spaces, parentheses and pipes in link addresses escape them using [=link address=]
.
You can use the Path:
prefix to add links outside of the wiki but on the same website.
Use Path:/path/to/resource
with a leading slash for links relative to the website document root as in www.example.com/path/to/resource
.
You can also define a custom InterMap prefix to a specific path on your website and use it as a shortcut, for example:
Pictures: /assets/pictures/$1
Then in a wiki page, use Pictures:photo.jpg
instead of Path:/assets/pictures/photo.jpg
or http://www.example.com/assets/pictures/photo.jpg
See InterMap for more information.
Not all browsers will follow such links (some Internet Explorer versions reportedly follow them). You can link to a file system by including the prefix 'file:///'
. So file:///S:\ProjPlan.mpp
and [[Shared S drive->file:///S:\]]
are both valid links. On a Windows file system you may want to use network locations (eg file:///\\server1\rootdirectory\subdirectory
) rather than drive letters which may not be consistent across all users. Not all browsers will follow such links, Internet Explorer does allow them.
See also Cookbook:DirList.
Links may also be specified as References, so the target appears as an anonymous numeric reference rather than a textual reference. The following markup is provided to produce sequential reference numbering within a PmWiki page:
Formatting the link as: [[http://google.com |#]]
produces: [2] as the link.
Subsequent occurrence of the reference link format on the same page will be incremented automatically as per the following example: Entering [[http://pmwiki.com |#]]
produces [3], [[#intermaps |#]]
produces [4], and so on for further reference links.
Inter Map links are also supported (see Inter Map). In particular, the Path:
InterMap entry can be used to create links using relative or absolute paths on the current site (e.g., Path:../../somedir/foo.html
or Path:/dir/something.gif
).
To have a link open in another window, use %newwin%...%%
:
%newwin% http://pmichaud.com %%
produces http://pmichaud.com
%newwin% [[http://google.com/ | Google]] %%
produces Google
%newwin% [[Main.WikiSandbox]] %%
produces Main.WikiSandbox
You can also specify that links should open in a new window via the %target=_blank%...%%
attribute:
The following link %target=_blank% http://pmichaud.com %% will open in a new window. | The following link http://pmichaud.com will open in a new window. |
Prefix a link with %rel=nofollow% to advise robots and link checkers not to follow it.
PmWiki automatically gives classes to several types of links. Among other things, this enables you to format each type differently.
Note: The default behavior of "+" above can be overridden to display the spaced title, rather than simply the title by adding the following to config.php:
## [[target |+]] title links Markup('[[|+', '<[[|', "/(?>\\[\\[([^|\\]]+))\\|\\s*\\+\\s*]]/e", "Keep(MakeLink(\$pagename, PSS('$1'), PageVar(MakePageName(\$pagename,PSS('$1')), '\$Titlespaced') ),'L')");
How do I create a link that will open as a new window?
Use the %newwin%
wikistyle, as in:
%newwin% http://example.com/ %% |
How do I create a link that will open a new window, and configure that new window?
This requires javascript. See Cookbook:PopupWindow.
How do I place a mailing address in a page?
Use the mailto:
markup, as in one of the following:
* mailto:myaddress@example.com * [[mailto:myaddress@example.com]] * [[mailto:myaddress@example.com | email me]] * [[mailto:myaddress@example.com?subject=Some subject | email me]] |
The markup [[mailto:me@example.com?cc=someoneelse@example.com&bcc=else@example.com&subject=Pre-set Subject&body=Pre-set body | display text]] =]
lets you specify more parameters like the message body and more recipients (may not work in all browsers and e-mail clients).
See also Cookbook:DeObMail for information on protecting email addresses from spammers.
How can I enable links to other protocols, such as nntp:, ssh:, xmpp:, etc?
How do I make a WikiWord link to an external page instead of a WikiPage?
Use link markup. There are two formats:
[[http://example.com/ | WikiWord]] [[WikiWord -> http://example.com/]]
How do I find all of the pages that link to another page (i.e., backlinks)?
In the wiki search form, use link=Group.Page
to find all pages linking to Group.Page.
Use the link=
option of the (:pagelist:)
directive, as in
(:pagelist link=SomePage list=all:) -- show all links to SomePage (:pagelist link={$FullName} list=all:) -- show all links to the current page
Note that (with a few exceptions) includes, conditionals, pagelists, searchresults, wikitrails, and redirects are not evaluated for Wikilinks, and so any links they put on the page will not be found as backlinks. All other directives and markup, for example links brought to the page by (:pmform:), will be found.
What link schemes does PmWiki support?
How do I open external links in a new window or mark them with an icon?
How can I use an image as a link?
Use [[Page| Attach:image.jpg ]] or [[ http://site | http://site/image.jpg ]] See Images#links
Why my browser does not follow local file:// links?
For security reasons, most browsers will only enable file:// links if the page containing the link is itself on the local drive. In other words, most browsers do not allow links to file:// from pages that were fetched using http:// such as in a PmWiki site. See also Cookbook:DirList for a workaround.
How links to the first existed page ? for example [[Group1.Page Group2.Page|Page]]
(:if exists Group1.Page:) [[Group1.Page|Page]] (:elseif exists Group2.Page:) [[Group2.Page|Page]] (:ifend:)
PmWiki pages are organized into groups of related pages. This feature was added to PmWiki to allow authors to create their own wiki spaces of specialized content on their own, without having to become, or rely on, wiki administrators. See Pm's post to the pmwiki-users mailing list.
By default, page links are between pages of the same group; to create a link to a page in another group, add the name of the other group and a dot or slash to the page name. For example, links to Main/WikiSandbox could be written as:
* [[Main.WikiSandbox]] * [[Main/WikiSandbox]] * [[(Main.Wiki)Sandbox]] * [[Main.WikiSandbox | link text]] * [[Main.WikiSandbox | +]] |
To link to the default home page of a group, the name of the page can be omitted, like this:
* [[Main.]] * [[Main/]] |
Creating a new group is as easy as creating new pages; simply edit an existing page to include a link to the new group's default home page (or any page in the new group) then click on the '?' to edit the page. As a rule, group names must start with a letter (but this can be changed by the wiki administrator by adding
$GroupPattern = '[[:upper:]\\d][\\w]*(?:-\\w+)*';
in config.php).
For example, to make a default page in the group Foo, create a link to [[Foo/]] (or [[Foo.]]). To make a page called Bar in the group Foo, create a link to [[Foo/Bar]] and follow the link to edit that page.
By default, the Recent Changes page of each group shows only the pages that have changed within that group; the Site.All Recent Changes page shows all pages that have changed in all groups.
Each group can also have Group Header or Group Footer pages that contain text to be automatically prepended or appended to every page in the group. A group can also have a Group Attributes page that defines attributes (read and edit passwords) shared by all pages within the group.
Each page can also have its own individual read/edit password that overrides the group passwords (see Passwords).
Finally, wiki administrators can set local customizations on a per-group basis--see Group Customizations.
The default "start page" for a group is a page whose name can be:
Note, on this site, the value of {$DefaultName} is HomePage and, thus, the default home page would be Foo/HomePage.
You can usefully change the default search order for an entered page name by setting the variable
in $PagePathFmt
config.php
, eg
$PagePathFmt
= array('$Group.$1', '$1.$DefaultName
', '$1.$1', '$DefaultGroup
.$1', 'Profiles.$1');
where "$1" is the name of the page entered.
If you are setting $DefaultName
in order to make a start page for your groups, you will need to also define $PagePathFmt
(see above) to get consistent use of this functionality. The simplest setting would be this:
$PagePathFmt
= array('$Group.$1', '$1.$DefaultName
');
Note that the order of the definitions of these variables ($DefaultName
and $PagePathFmt
) is important - it must occur before any call to ResolvePageName() and it (therefore) it cannot occur in a per-page or per-group customization script.
As noted above, when linking to the default home page, authors can omit the page name and simply identify the group followed by a forward slash ([[Foo/]]).
Note the forward slash is required to ensure that the link unambiguously points to the identified group. If the slash is omitted, the link can end up being interpreted as pointing to an existing (or new) page in the current group (if the group, or its default home page, do not exist).
No, PmWiki does not have subpages. Pm's reasons for not having subgroups are described at PmWiki:Hierarchical Groups, but it comes down to not having a good page linking syntax. If you create a link or pagename like [[A.B.C]]
PmWiki doesn't think of "B.C" as being in group "A", it instead thinks of "C" as being in group "AB", which is a separate group from "A". Wiki administrators can look at Cookbook:Subgroup Markup and Cookbook:Include With Edit for recipes that may be of some help with developing subgroups or subpages.
You can set PmWiki's $GroupPattern
variable to only accept the group names you want to define. For example, to limit pages to the "PmWiki", "Main", "Profiles", and "Example" groups, add the following to local/config.php:
$GroupPattern
= '(?:Site|SiteAdmin|PmWiki|Main|Profiles|Example)';
With this setting, only the listed groups will be considered valid WikiGroups. You can add more groups to the list by placing additional group names separated by pipes (|).
See other solutions to this at Cookbook:Limit Wiki Groups and Cookbook:New Group Warning.
How can I get rid of the 'Main' group in urls for pages pointing to Main?
How can I limit the creation of new groups?
See Cookbook:Limit Wiki Groups.
Why doesn't [[St. Giles and St. James]] work as a link? (It doesn't display anything.)
Because it contains periods, and destroys PmWiki's file structure, which saves pages as Group.PageName. Adding those periods disrupts this format. Links may only contain words. If you need a link precisely as shown, the page must be named eg StGilesAndStJames then you can use the (:title:) directive to have the page's title appear with periods (:title St. Giles and St. James:). (Although in US grammar the period is often omitted and in UK grammar the period must be omitted for contractions like St).
How can I delete a wiki group?
Normally you can't, as this requires an admin with server-side access to delete the file that makes up the group's RecentChanges page. But there is an option method of making it possible to delete RecentChanges pages from within the wiki if the admin enables the code found on Cookbook:RecentChanges Deletion.
How can I delete a wiki group's Group.RecentChanges page?
Normally you can't, as this requires an admin with server-side access to delete a file. But there is an optional method of making it possible to delete RecentChanges pages from within the wiki if the admin enables the code found on Cookbook:RecentChanges Deletion.
Can I delete a wiki group inside wiki.d folder on the server to eliminate the group?
Yes, if you delete all files named YourGroup.*, the pages from that group will be removed from the wiki. Note that the documentation (group PmWiki) and the site configuration (groups Site and SiteAdmin) that exist in the default installation, are located in wikilib.d and not in wiki.d, and some recipes provide files located in a wikilib.d subdirectory in the cookbook directory. (You shouldn't delete the groups Site and SiteAdmin, required for normal function.)
How can I list all pages in a WikiGroup?
In a wiki page use (:pagelist group=GroupName list=all:)
or in a search box type GroupName/ list=all
.
more infos about text formating rules.
This page provides a more complete list of some of the markup sequences available in PmWiki. Note that it's easy to create and edit pages without using any of the markups below, but if you ever need them, they're here.
To experiment with the rules, please edit the Wiki Sandbox.
To create paragraphs, simply enter text. Use a blank line to start a new paragraph.
Words on two lines in a row will wrap and fill as needed (the normal XHTML behavior). To turn off the automatic filling, use the (:linebreaks:)
directive above the paragraph.
\
(single backslash) at the end of a line to join the current line to the next one.
\\
(two backslashes) at the end of a line to force a line break.
\\\
(three backslashes) at the end of a line to force 2 line breaks, n backslashes will force n-1 line breaks
[[<<]]
to force a line break that will clear floating elements both left and right.
Arrows (->
) at the beginning of a paragraph can be used to produce an indented paragraph. More hyphens at the beginning (--->
) produce larger indents.
->Four score and seven years ago our fathers placed upon this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. |
Four score and seven years ago our fathers placed upon this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal.
|
Inverted Arrows (-<
) at the beginning of a paragraph can be used to produce a paragraph with a hanging indent. Adding hyphens at the beginning (---<
) causes all the text to indent.
-<Four score and seven years ago our fathers placed upon this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. |
Four score and seven years ago our fathers placed upon this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal.
|
--<Four score and seven years ago our fathers placed upon this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. And that food would be good too. |
|
Blocks of text to which (:linebreaks:)
has been applied can be indented by preceding the first line of the block with indention arrows (->
) and aligning subsequent lines under the first. An unindented line stops the block indentation. See Cookbook:Markup Tricks for an example.
Bullet lists are made by placing asterisks at the beginning of the line. Numbered lists are made by placing number-signs (#) at the beginning of the line. More asterisks/number-signs increases the level of bullet:
* First-level list item ** Second-level list item ### Order this #### And this (optional) ### Then this ** Another second-level item * A first-level item: cooking ## Prepare the experiment ### Unwrap the pop-tart ### Insert the pop-tart into the toaster ## Begin cooking the pop tart ## Stand back |
|
# A list is terminated by the first line that is not a list. # Also terminate a list using the escape sequence [@[==]@] [==] # Continue a list item by lining up the text with leading whitespace. # Use a forced linebreak \\ to force a newline in your list item. |
by the first line that is not a list.
|
## Text between list items can cause numbering to restart ## %item value=3% this can be dealt with |
|
Also see: PmWiki:ListStyles, Cookbook:WikiStylesPlus.
Powerful new* feature
When you define terms using this markup
PmWiki will recognize them as PageTextVariables
that you can use on any page or PageList.
FontSize('0.846', $m[1])
Definition lists are made by placing colons at the left margin (and between each term and definition):
:term:definition of term |
|
Whitespace indentation in lists. Any line that begins with whitespace and aligns with a previous list item (whether bulleted, numbers or definitional) is considered to be "within" that list item. Text folds and wraps as normal, and the (:linebreaks:)
directive is honored.
# First-level item\\ Whitespace used to continue item on a new line # Another first-level item # Whitespace combined with a single # to create a new item one level deeper |
|
This rule also apply on definition lists, but only the number of leading colons is significant for the following whitespace indented lines.
:Item: Definition text dispatched on several lines ::SubItem: Same kind of multiline definition |
|
Otherwise, lines that begin with whitespace are treated as preformatted text, using a monospace font and not generating linebreaks except where explicitly indicated in the markup. Note to administrators: Starting with version 2.2.0-beta41, this feature can be modified using $EnableWSPre
. (Another way to create preformatted text blocks is by using the [@...@] markup.)
Four or more dashes (----) at the beginning of a line produce a horizontal line.
monospace
text
Other styling
'+big+', '-small-', '^super^', '_sub_', {+insert or underscore+}, {-delete or strikethrough or strikeout-} |
big, small, super, sub, insert or underscore,
|
`WikiWord
WikiWord neutralisation
See also Wiki Styles for advanced text formatting options.
http:
", "ftp:
", "gopher:
", "mailto:
", or "news:
" to create links automatically, as in http://www.pmichaud.com/toast.
.gif
, .jpg
, or .png
are displayed as images in the page
[[#target]]
.
[=link address=]
See Links for details.
Headings are made by placing an exclamation mark (!) at the left margin. More exclamation marks increase the level of heading. For example,
!! Level 2 Heading !!! Level 3 Heading !!!! Level 4 Heading !!!!! Level 5 Heading |
Level 2 HeadingLevel 3 HeadingLevel 4 HeadingLevel 5 Heading |
Note that level 1 heading is already used as page title (at least in the PmWiki skin), so you should start with level 2 headings to create well formed, search engine optimized web pages.
See Cookbook:Numbered Headers for numbered headings.
Anything placed between [= and =] is not interpreted by PmWiki, but paragraphs are reformatted. This makes it possible to turn off special formatting interpretations and neutralise WikiWords that are not links (even easier is to use a tick ` in front, like `WikiWord).
This is useful to allow for escaped [=link address=]
to have any special characters, including quotes, spaces, parentheses and pipes.
For preformatted text blocks, use the [@...@] markup. It does neither reformat paragraphs nor process wiki markup:
[@ Code goes here like [[PmWiki.PmWiki]] '$CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'; #just some code @] |
Code goes here like [[PmWiki.PmWiki]] '$CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'; #just some code |
The multiline [@...@]
is a block markup, and in order to change the styling of these preformatted text blocks, you need to apply a "block" WikiStyle.
%block blue%[@ The font color of this text is blue @] |
The font color of this text is blue |
It is also useful to use [= =]
within other wiki structures, as this enables the inclusion of new lines in text values. The example below shows how to include a multi-line value in a hidden form field.
(:input hidden message "[=Line1 Line2=]":)
Note that "Replace on save" and "Replace on edit" patterns like ~~
~~
can replace strings even within escape sequences, use $EnableROSEscape
to control that.
(:comment Some information:)
can be very kind to subsequent authors, especially around complicated bits of markup.
Tables are defined by enclosing cells with '||'. A cell with leading and trailing spaces is centered; a cell with leading spaces is right-aligned; all other cells are left-aligned. An empty cell will cause the previous cell to span multiple columns. (There is currently no mechanism for spanning multiple rows.) A line beginning with '||' specifies the table attributes for subsequent tables. A '!' as the first character in a cell provides emphasis that can be used to provide headings.
||border=1 width=50% ||!Table||!Heading||!Example|| ||!Left || Center || Right|| ||A ||! a B || C|| || || single || || || || multi span |||| | |||||||||||||||
|
See Table Directives for advanced tables.
See Markup Master Index.
http://www.pmwiki.org/wiki/Cookbook/ThumbList#basic-usage
more infos about tables.
PmWiki has two types of table markup; the markup described in this page is useful for creating simple tables with lots of small cells, while table directive markup helps with larger scale or more complex tables. For more possibilities with formatting simple tables, see Cookbook:Rowspan in simple tables and Cookbook:Formatting tables.
Simple tables are created via use of double pipe characters: ||
. Lines beginning with this markup denote rows in a table or a formatting line. Within table row lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).
The first line in the markup contains formatting commands for the table. It only has double pipe characters at the start of the line.
|| border=1 || cell 1 || cell 2 || cell 3 || || cell 1 || cell 2 || |
|
Header cells can be created by placing ! as the first character of a cell. Note that these are table headers, not headings, so it doesn't extend to !!, !!!, etc.
|| border=1 ||! cell 1 ||! cell 2 ||! cell 3 || || cell 1 || cell 2 || cell 3 || |
|
A table can have a caption, indicated by ||!caption!||
. Any caption must appear prior to other rows of the table.
|| border=1 ||! A special table !|| ||! cell 1 ||! cell 2 ||! cell 3 || || cell 1 || cell 2 || cell 3 || |
|
Cell contents may be aligned left, centered, or aligned right.
||
.
||
.
|| border=1 width=100% ||!cell 1 ||! cell 2 ||! cell 3|| ||left-aligned || centered || right-aligned|| | ||||||
|
|| border=1 width=100% ||!cell default||!cell left || ||default-aligned||left-aligned || | ||||
|
Note that header and detail cells have different default alignments.
To get a cell to span multiple columns, follow the cell with empty cells. (At present there is no markup for spanning rows.)
|| border=1 width=100% || |||| right column || || || right two columns |||| || || middle column || || || left column || |||| || left two columns |||| || || entire row |||||| || left column || middle column || right column || | |||||||||||||||||||||
|
Any line that begins with ||
but doesn't have a closing ||
sets the table attributes for any tables that follow. These attributes can control the size and position of the table, borders, background color, and cell spacing. (In fact these are just standard HTML attributes that are placed in the <table> tag.)
Use the width=
attribute to set a table's width, using either a percentage value, an absolute size, or *.
See also $SimpleTableDefaultClassName
.
|| border=1 width=100% || cell 1 || cell 2 || cell 3 || || c1 || cellcellcellcell2 || cell 3 || | ||||||
|
The border=
attribute sets the size of a table's borders.
|| border=10 width=70% ||!cell 1 ||! cell 2 ||! cell 3|| ||left-aligned || centered || right-aligned|| |
|
|| border=0 width=70% ||!cell 1 ||! cell 2 ||! cell 3|| ||left-aligned || centered || right-aligned|| |
|
Use align=center
, align=left
, and align=right
to center, left, or right align a table. Note that align=left
and align=right
create a floating table, such that text wraps around the table.
|| border=1 align=center width=50% ||!cell 1 ||! cell 2 ||! cell 3|| ||left-aligned || centered || right-aligned|| Notice how text does not wrap with a table using "align=center". | ||||||
Notice how text does not wrap with a table using "align=center". |
|| border=1 align=left width=50% ||!cell 1 ||! cell 2 ||! cell 3|| ||left-aligned || centered || right-aligned|| Notice how text wraps to the right of a table using "align=left". | ||||||
Notice how text wraps to the right of a table using "align=left". |
|| border=1 align=right width=50% ||!cell 1 ||! cell 2 ||! cell 3|| ||left-aligned || centered || right-aligned|| Notice how text wraps to the left of a table using "align=right". | ||||||
Notice how text wraps to the left of a table using "align=right". |
||style="margin-left:0px;"
The bgcolor=
attribute sets the background color for a table. At present there is no way to specify the color of individual rows or cells in this type of table (but see Cookbook:FormattingTables).
|| border=1 align=center bgcolor=yellow width=70% ||!cell 1 ||! cell 2 ||! cell 3|| ||left-align || center || right-align|| |
|
To allow readers to reorder a table, give it the class="sortable" attribute:
|| class="sortable simpletable" ||! m||!Geographic zone ||!Highest point ||!Country || || 3700||Arctic ||Gunnbjørn Fjeld ||Greenland || || 8848||North Temperate Zone ||Mount Everest ||Nepal || || 5790||North Tropical Zone ||Cayambe ||Ecuador || || 6768||South Tropical Zone ||Huáscarán ||Peru || || 6960||South Temperate Zone ||Aconcagua ||Argentina || || 4892||Antarctic ||Mount Vinson ||(none) || | ||||||||||||||||||||||||||||
|
$EnableSortable
.How do I create a basic table?
Tables are created via use of the double pipe character: ||
. Lines beginning with this markup denote rows in a table; within such lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).
|| border=1 rules=rows frame=hsides || cell 1 || cell 2 || cell 3 || || cell 1 || cell 2 || cell 3 || |
|
How do I create cell headers?
Header cells can be created by placing ! as the first character of a cell. Note that these are table headers, not headings, so it doesn't extend to !!, !!!, etc.
|| border=1 rules=cols frame=vsides ||! cell 1 ||! cell 2 ||! cell 3 || || cell 1 || cell 2 || cell 3 || |
|
How do I obtain a table with thin lines and more distance to the content?
"Thin lines" is tricky and browser dependent, but the following works for Firefox and IE (Nov. 2009):
||border="1" style="border-collapse:collapse" cellpadding="5" width=66% ||!Header ||! Header || '''Header'''|| ||cells || with || padding|| || || || || |
|
How do I create an advanced table?
See table directives
My tables are by default centered. When I try to use '||align=left' they don't align left as expected.
Use ||style="margin-left:0px;" instead.
How can I specify the width of columns?
You can define the widths via custom styles, see Cookbook:FormattingTables and $TableCellAttrFmt
. Add in config.php :
$TableCellAttrFmt = 'class=col$TableCellCount';
table.column td.col1 { width: 120px; } table.column td.col3 { width: 40px; }
How can I display a double pipe "||" in cell text using basic table markup?
Escape it with [=||=]
to display || unchanged.
How do I apply styles to the elements of the table, like an ID to the table row, or a class/style to the TD?
See $WikiStyleApply.
Alternately, use table directives, which allow specifying styling either directly (style="...") or by a class="..." attribute for CSS.
http://www.pmwiki.org/wiki/Cookbook/Toggle
SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript. Use the following markup to embed source code within your page.
(:code PARAMETERS:)[@ | or | (:code PARAMETERS:) |
Parameter | Default Value | Description |
---|---|---|
auto_links | true | Allows you to turn detection of links in the highlighted element on and off. If the option is turned off, URLs won't be clickable. |
collapse | false | Allows you to force highlighted elements on the page to be collapsed by default. |
first_line | 1 | Allows you to change the first (starting) line number. |
gutter | true | Allows you to turn gutter with line numbers on and off. |
highlight | null | Allows you to highlight one or more lines to focus user's attention. When specifying as a parameter, you have to pass an array looking value, like [1, 2, 3] or just an number for a single line. |
html_script | false | Allows you to highlight a mixture of HTML/XML code and a script which is very common in web development. Setting this value to true requires that the brush you are using supports this feature. |
light | false | Allows you to disable toolbar and gutter with a single property. |
ruler | false | Allows you to show column ruler on top of highlighted elements. |
smart_tabs | true | Allows you to turn smart tabs feature on and off. |
tab_size | 4 | Allows you to adjust tab size. |
toolbar | true | Toggles toolbar on/off. |
lang | plain | Selects the language. |
wrap_lines | true | Allows you to turn line wrapping feature on and off. |
Brush Name | Brush Aliases |
---|---|
ActionScript3 | as3, actionscript3 |
Bash/Shell | bash, shell |
ColdFusion | cf, coldfusion |
C# | c-sharp, csharp |
C++ | cpp, c |
CSS | css |
Delphi | delphi, pas, pascal |
Diff | diff, patch |
Erlang | erl, erlang |
Groovy | groovy |
JavaScript | js, jscript, javascript |
Java | java |
JavaFX | jfx, javafx |
Perl | perl, pl |
PHP | php |
Plain Text | plain, text |
PowerShell | ps, powershell |
Python | py, python |
Ruby | rails, ror, ruby |
Scala | scala |
SQL | sql |
Visual Basic | vb, vbnet |
XML | xml, xslt, html, xhtml |
Example HTML code with embedded PHP script:
CodeBlockMarkup($pagename
, PSS($m[1]), PSS($m[3]))
If JavaScript is disabled it will look like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <title>SyntaxHighlighter Demo</title> <meta http-equiv='Content-Type' content='text/html; charset=utf-8' /> <body> <div style="font-weight: bold"><?= str_replace("\n", "<br/>", $var) ?></div> <? /*********************************** ** Multiline block comments **********************************/ $stringWithUrl = "http://alexgorbatchev.com"; $stringWithUrl = 'http://alexgorbatchev.com'; ob_start("parseOutputBuffer"); // Start Code Buffering session_start(); ?> </body> </html>