Tests for a PmWiki syntax highlighter
This is to test Cookbook:PmSyntax (syntax highlighting only). Try the Toggle buttons!
Notes
Don't feel intimidated by the apparent complexity, in most real-world scenarios you'll have much fewer markups so close together (except probably in pagelist templates and forms which are edited rarely). In a usual situation you'll have the occasional markup stand out.
If this is bad, the same without highlighting is probably worse ;-)
and Toggle dark theme
! Page structure(:toc:)(:notoc:)!! Heading!!! Subheading!!!! Sub-subheading----- horizontal rule
Q: Question
A: Answer
!! Basic markup* List
* List
## Nested
## Item
Part of "Item"
## After
* Another kind of nested,
* aligned to "A" above
: Term : Definition
: Term2 : Def 2
: With [=:=] colon: Definition
Preformatted block with
'''leading''' spaces
-> Indented text
------< hanging text line
!! Inline markups'''Strong''', ''emphasis'',
@@code@@, '-small-', '+big+'[--smaller--], [++bigger++]{+underlined+}, {-struck-}'^superscript^', '_subscript_'
Join line \
with next.
Line breaks\\
More line breaks\\\\\
[=escaped text, not processed,
and can span multiple lines=][@ Another escaped text.
* ''Markup'' isn't processed.
@]!!! Custom inline markups
Would need some configuration:
'~italic~' and '*bold*'
[^footnote^] {$ formula $}
!! Core meta directives(:title Syntax highlighting for PmWiki markup:)(:description Some text:)(:keywords Documentation, edit, help, markup:)(:Summary: Tests for a PmWiki syntax highlighter:)(:linebreaks:) or (:nolinebreaks:), or even (:nl:)(:nolinkwikiwords:) or (:nospacewikiwords:)(:comment Message to the editors:)%comment% Message to updaters %%(:redirect PageName#anchor status=301from=namequiet=1:)!!! Conditionals(:if3exprauth admin ||auth attr ||auth edit :)[[Logout ->{$Name}?action=logout]](:elseif3[!auth read {*$FullName}&&name Group.*]:)
Conditional
(:elseif3date 2021-12-28..:) A (:else3:) B (:if3end:)!!! Skin sections(:noleft:)(:noright:)(:noaction:)(:notitle:)(:noheader:)(:nofooter:), (:nogroupheader:)(:nogroupfooter:)!!! Page text variablesProperty: Start of line text variable
:Another: Variable in definition list
(:MyVariable:Some value:) or (:EmptyValue::)(:Multiline:Variable
can have line
breaks :)
Print out variables: {$FullName}, {*$Title}, {*$:Summary}{{*$Name}$:Summary}{Group.OtherPage$Title}
In Pagelist templates: {=$Group}, {<$Group}, {>$Group}
In templates and included sections: {$$variable}(:include{*$FullName}-Users#fromanchor#toanchor \
lines=12..34self=0basepage=abcvariable=value:)
!![[WikiStyles]]%blue% some text%%%apply=blockcolor=red% Some text
%define=mystyleapply=p\
border="2px dotted green"%>>framebgcolor=yellow<<
Text
>><<%newwin%[[Link]]%%* item %list classname id=ul2%* item %item comment%## %ALPHA% A
## B
## C %value=6%!!! Some PHP and CSS code
See [[WikiStyles#highlight]]%hlt php%[@# only geeks allowedif(!isset($EnableGeek)) exit;
@]%hlt css%[@/* only ants can read */body, body * {
font-size: 1px!important;
}@]!! Blocks, advanced tables(:div3class=myblock:)(:sectionid=mysection:)
text
(:sectionend:)(:div3end:)(:detailsopen=open\
summary="Toggle section...":)
Some text
(:detailsend:)(:tableclass=t1border=1:)(:cellcolspan=2:) H
(:tableend:)
and Toggle dark theme
!! Pagelists and templates(:pagelistgroup={*$Group}count=5..10fmt=#template:)(:pagelist$:Summary=?*$Title=A*if="auth read {=$Name}":)(:searchboxgroup=PmWikilabel="Search documentation":)!! Pagelists templates[[#template]](:template defaultsname=valuegroup=Mainorder=name:)(:template first:)
Pages in the list:
(:template each{=$Group}:)'''{=$Group}:'''(:template each:)* [[{=$FullName}|{=$Title}]] modified {=$LastModified}(:template last:)
Displayed {$$PageCount} pages
(:template none:)
No pages found.
[[#templateend]]
!! Simple tables||border=1class="sortable"||! Table caption !||||! head ||! head |||| cell || cell ||||''double'' cell ||||!! Markup expressions{(ftimefmt="%a %d %b, %Y")}{(strlen"PmWiki")}{(tolower(substr"PmWiki" 2))}{(asspaced{*$FullName})}!! Internationalization
Click $[Edit] to modify the page,
or $[History] to see old versions.
$[Password required]$[Editing {*$FullName}]
and Toggle dark theme
!! Forms(:input formaction=https://example.com/path/method=post:)(:input textname=namevalue=valueid=identifier:)(:input email authid placeholder="Your email"size=40:)(:input password authpw required=required:)(:input textareaname=areavalue=[=multi-
line
content=]cols=80rows=3:)(:input checkboxname=accept_termsvalue=yes\
label="I accept the terms"required=required:)(:input defaultsource={*$FullName}:)(:input defaultrequest=1:)(:input textname=$:DataInPTVdisabled=disabled:)(:input submit post "Okay":)(:input end:)
Also (:input e_form...:), (:input e_author...:),
(:input e_savedraftbutton:), ..., (:input captcha:),
(:input pmform...:) and (:pmformtarget=target:)
!! Other core markup(:messages:)(:attachlistnames=*.jpg:)<<|[[Trail]]|>> linear trail
^|[[Trail]]|^ breadcrumb trail
(:markupclass=horiz:)
[=
Markup demonstration
=]
(:markupclass=norender:)
* Other markup example
(:markupend:)
Signatures ~~~ and ~~~~ (while editing, before being expanded)
(:fox cbox put=belowmark=!!Commentstemplate=Site.FoxCommentTemplate:)(:toggle hide box1 button=1:)(:toggleid="line2"id2="line1"group="lines"init=hideshow="show line 2"hide="hide line 2":)(:attachtablefilter=xxxsort=nameshow=mimetype:)(:includesection"#blog-summary-pagelist blogid=blog1 status=publish":)(:thumblist Group.Page px=128cols=4name="paris_*":)(:thumbgallerycols=3tlmode=1:)
pic1.jpg | Caption
pic2.jpg | Another caption
(:thumbgalleryend:)(:thumb Group.Page/pic3.jpeg titlemft="click thru for larger image"captionfmt="watch this space":)(:pmcalstyles=PmCal-Minimonthsback=1monthsahead=2includes=false:)(:minim1=128x128m2=200x200:)(:sourcelang=cssheader="$HTMLStylesFmt['sourceblock'] = '"footer="';":)[=
.sourceblocklink {
text-align: right;
font-size: smaller;
=](:autosections:), (:nosectionsinincludes:), (:nohorzsections:){(wordcount"this is a string")}{(plist Cookbook.* -Cookbook.*Skin*)}{(extract Term1 -Term2 ...name=PageNamegroup=GroupName\
keyword=valuekeyword2=value2...)}(:galleriaoption_name="STRING":)(:case-correction:){$TotalCount}, {$PageCount}, {$PageViews}
etc...
Actual snippet from a custom menu and Toggle dark theme
Contains conditionals, form elements with attributes and values,
wikistyles, page variables, page text variables, and custom
Markup Expressions nested in the form values.
(:if33exprenabled EnableWorse &&!name SideBar,RecentChanges,GroupAttributes:)* %itempadding="1mm 4mm"%(:input defaultsource={*$FullName}:)\
(:input checkboxid=m_chklabel="Page maintainer":)\
%id=m_claim%claim%%%id=m_clear%clear%%\\
(:input text $:MaintainerName placeholder="Maintainer name"\
data-me="{(userdata $real_name)}"id=MaintainerName:)\\
(:input text $:MaintainerEmail placeholder="Maintainer email"\
size=14data-me="{(userdata $email)}"id=MaintainerEmail:)\
(:input button setmainainer Save id=savemaintainer:)* [[{*$FullName}#deletepage"Delete page and all history"|Delete page]]%itemcolor=red%(:if33end:)
(Looking at this I think it would have been wiser to write a custom directive, but this is an old website built gradually with small additions over the years. --Petko)
0: 00.00 00.00 config start
1: 00.03 00.01 config end
2: 00.64 00.21 MarkupToHTML begin
3: 00.65 00.21 MarkupToHTML begin
4: 00.66 00.21 MarkupToHTML end
5: 00.75 00.24 MarkupToHTML end
6: 00.77 00.25 MarkupToHTML begin
7: 00.80 00.25 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
8: 00.82 00.26 ReadApprovedUrls SiteAdmin.ApprovedUrls end
9: 00.83 00.26 MarkupToHTML end
10: 00.83 00.26 MarkupToHTML begin
11: 00.85 00.27 MarkupToHTML end
12: 00.86 00.27 now