User Tools

Site Tools


wiki:syntax

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:syntax [2011/12/21 13:42]
claes [Quoting]
wiki:syntax [2014/02/06 17:39]
claes
Line 30: Line 30:
  
 You should use forced newlines only if really needed. You should use forced newlines only if really needed.
 +==== Font Color ====
 +  <fc #FF0000>Test Red</fc>
 +<fc #FF0000>Test Red</fc>
 +  <fc #00FF00>Test Green</fc>
 +<fc #00FF00>Test Green</fc>
 +  <fc #0000FF>Test Blue</fc>
 +<fc #0000FF>Test Blue</fc>  
  
 ===== Links ===== ===== Links =====
Line 579: Line 586:
   </sxh>   </sxh>
  
-brush alias - The brush alias (language) that SyntaxHighlighter should use. Defaults to “text” if none is provided. See SyntaxHighlighter Brushes for a complete list of available brushes. Add new brushes to the scripts directory (see plugin structure) and the alias(es) and brush file name to the available brushes string in Config Manager (example: ”…,bat cmd shBrushBat.js”). The brush file name is case sensitive.+brush alias - The brush alias (language) that SyntaxHighlighter should use. Defaults to “text” if none is provided. See [[http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/|SyntaxHighlighter Brushes]] for a [[http://www.undermyhat.org/blog/2009/09/list-of-brushes-syntaxhighligher/|complete list of available brushes]]. Add new brushes to the scripts directory (see plugin structure) and the alias(es) and brush file name to the available brushes string in Config Manager (example: ”…,bat cmd shBrushBat.js”). The brush file name is case sensitive.
  
-options - Semicolon separated options for SyntaxHighlighter, see SyntaxHighlighter Configuration. Block Title isn't a normal configuration option, but the plugin handles it as if it was, i.e. “title: <title string>;”. :!: Do not collapse code and hide the toolbar at the same time, title will not show.+options - Semicolon separated options for SyntaxHighlighter, see [[http://alexgorbatchev.com/SyntaxHighlighter/manual/configuration/|SyntaxHighlighter Configuration]]. [[http://alexgorbatchev.com/SyntaxHighlighter/whatsnew.html#blocktitle|Block Title]] isn't a normal configuration option, but the plugin handles it as if it was, i.e. “title: <title string>;”. :!: Do not collapse code and hide the toolbar at the same time, title will not show.
  
 === Example === === Example ===
Line 962: Line 969:
  
 Additional sites can be added to the ''sites.conf'' file in the plugin directory. Video ID recognition patterns for the toolbar button are configured in ''sites.js''. Additional sites can be added to the ''sites.conf'' file in the plugin directory. Video ID recognition patterns for the toolbar button are configured in ''sites.js''.
 +
 +===== Slideshow =====
 +See [[playground:slideshow|DokuWiki S5 Slideshows]] for an example.
 +===== Columns =====
 +Following a number of requests, the plugin is re-designed to support headings and vertical alignment of the columns content. In order to support the new features syntax of the plugin is extended with extra attributes that should be specified in front of the column width:
 +
 +<code>
 +<columns 100% first column attributes 50% second column attributes ->
 +
 +Content of the first column.
 +
 +<newcolumn>
 +
 +Content of the second column.
 +
 +</columns>
 +</code>
 +
 +With this extra attributes the columns declaration gets more and more cluttered. To prevent that you can specify column attributes in the ''%%<newcolumn>%%'' tag. In this case the order of the attributes and column width is not important:
 +
 +<code>
 +<columns 100% first column attributes 50%>
 +
 +Content of the first column.
 +
 +<newcolumn second column *-* attributes>
 +
 +Content of the second column.
 +
 +</columns>
 +</code>
 +
 +
 +=== Headings ===
 +
 +The headings are specified the using the standard DokuWiki syntax:
 +
 +<code>
 +<columns 100% 50% ->
 +
 +===== Heading =====
 +
 +Content of the first column.
 +
 +<newcolumn>
 +
 +Content of the second column.
 +
 +</columns>
 +</code>
 +
 +By default plugin puts the content within a column without explicitly specifying the section level. This works fine when the entire columns block belongs to a single section but can produce unexpected results when the headings are used within the block:
 +
 +<code>
 +====== Level 1 Heading ======
 +
 +<columns 100% 50% ->
 +
 +Implicit level 1 content.
 +
 +===== Level 2 Headline 1 =====
 +
 +Level 2 content.
 +
 +<newcolumn>
 +
 +Implicit level 1 content that should be in level 2 section.
 +
 +===== Level 2 Headline 2 =====
 +
 +Level 2 content.
 +
 +</columns>
 +</code>
 +
 +You can force the beginning of the second column to be in level 2 by specifying "''continue''" attribute (or shorthand "''%%...%%''"):
 +
 +<code>
 +====== Level 1 Heading ======
 +
 +<columns 100% 50% ->
 +
 +Implicit level 1 content.
 +
 +===== Level 2 Headline 1 =====
 +
 +Level 2 content.
 +
 +<newcolumn continue>
 +
 +Level 2 content.
 +
 +===== Level 2 Headline 2 =====
 +
 +Level 2 content.
 +
 +</columns>
 +</code>
 +
 +
 +
 +=== Alignment ===
 +
 +The vertical alignment is specified with new alignment attributes. There are four horizontal alignment attributes (''left'', ''center'', ''right'' and ''justify'') and three vertical alignment attributes (''top'', ''middle'' and ''bottom''). There may be multiple alignment attributes per column:
 +
 +<code>
 +<columns 100% left 50% right bottom ->
 +
 +Aligned on the left side.
 +
 +<newcolumn>
 +
 +Aligned to the right-bottom corner.
 +
 +</columns>
 +</code>
 +
 +All attributes can be abbreviated to the first letter, the single letter attributes may be merged together:
 +
 +<code>
 +<columns 100% l 50%>
 +
 +Aligned on the left side.
 +
 +<newcolumn rb>
 +
 +Aligned to the right-bottom corner.
 +
 +<newcolumn m *-*>
 +
 +The old alignment syntax is still supported.
 +Content of this column is centered both ways.
 +
 +</columns>
 +</code>
 +
 +===== AV Task Box =====
 +<code>
 +<task>
 +TITLE: A test task
 +PRIORITY: High
 +ESTIMATE: 4h
 +PROGRESS: 10%
 +ASSIGNED: Sherri
 +DESCRIPTION: Some stuff for you. You can have newlines in this part. Description must be the last item.
 +</task>
 +</code>
 +  * The labels for each item are //not// case sensitive. I just make them all caps to make them visible.
 +  * Each item must take up only one line, except the description can be on multiple lines.
 +  * The description will maintain newlines.
 +  * The description must be the last item in the list before the </task> tag. The other items can be in any order before the description item.
 +  * You can leave out any of the items(attributes), or leave them blank, and it will still look okay.
 +  * The entire thing is wrapped in a span with the CSS class "avtaskbox" so you can style it in your CSS.
 +
 +<task>
 +TITLE: A test task
 +PRIORITY: High
 +ESTIMATE: 4h
 +PROGRESS: 10%
 +ASSIGNED: Sherri
 +DESCRIPTION: Some stuff for you. You can have newlines in this part. Description must be the last item.
 +</task>
 +===== Timeline2 =====
 +https://www.dokuwiki.org/plugin:timeline2
 +
 +<TimeLine interval=01/01/2010-31/12/2010 color=c0c0c0 scale=m>
 +highlight=01/07/2010-01/09/2010:00ff00=test
 +highlight=01/03/2010-01/08/2010:ff0000=include=Include
 +highlight=15/08/2010-15/12/2010:0000ff=test2
 +</TimeLine>\\
 +hmm
 +
 +hmm
 +<TimeLine interval=01/01/2010-10/02/2010 color=c0c0c0 scale=w>
 +highlight=02/01/2010-31/01/2010:00ff00=test
 +</TimeLine>
 +<TimeLine interval=01/01/2010-10/02/2010 color=c0c0c0 scale=m legend>
 +highlight=02/01/2010-02/01/2010:00ff00=test
 +highlight=05/01/2010-07/01/2010:0080ff=test2
 +</TimeLine>
 +hmm
 +
 +<code>
 +<TimeLine interval=01/01/2010-31/12/2010 color=c0c0c0 scale=m>
 +highlight=01/07/2010-01/09/2010:00ff00=test
 +highlight=01/03/2010-01/08/2010:ff0000=include=Include
 +highlight=15/08/2010-15/12/2010:0000ff=test2
 +</TimeLine>\\
 +hmm
 +
 +hmm
 +<TimeLine interval=01/01/2010-10/02/2010 color=c0c0c0 scale=w>
 +highlight=02/01/2010-31/01/2010:00ff00=test
 +</TimeLine>
 +<TimeLine interval=01/01/2010-10/02/2010 color=c0c0c0 scale=m legend>
 +highlight=02/01/2010-02/01/2010:00ff00=test
 +highlight=05/01/2010-07/01/2010:0080ff=test2
 +</TimeLine>
 +hmm
 +</code>
 +
 +<code>
 +<TimeLine interval=dd/mm/yyyy-dd/mm/yyyy [color=hexcolor] [[scale={w|m|y}] [legend]>
 +highlite=dd/mm/yyyy-dd/mm/yyyy[:hex color][=internal wiki page link][=Name of link][=lrch]
 +...
 +</TimeLine>
 +</code>
 +
 +===== Include =====
 +
 +
 +==== Examples ====
 +
 +''%%{{page>wiki:syntax#Tables}}%%'' will include the section about tables of the syntax page.
 +
 +''%%{{namespace>project_foo}}%%'' will include all pages in the ''project_foo'' namespace.
 +
 +''%%{{page>blog:mypage&tags&comments}}%%'' will include the page ''blog:mypage'' and show the tags from the [[tag]] plugin and the number of comments from the [[discussion]] plugin. Both plugins need to be installed for this example.
 +
 +''%%{{tagtopic>testtag}}%%'' will include all pages with the tag ''testtag'', the [[tag]] plugin needs to be installed for this example.
 +
 +==== Syntax ====
 +
 +Simply enclose the ID of the page to be included in double curly brackets:
 +
 +  {{page>[id]&[flags]}}
 +  {{section>[id]#[section]&[flags]}}
 +  {{namespace>[namespace]&[flags]}}
 +  {{tagtopic>[tag]&[flags]}}
 +
 +^ [id] | page ID of the page to include; some [[#macros]] are possible; shortcuts are resolved ('':'', ''.'', ''..'') | required |
 +^ [section] | limits the included page to a specific section and its subsections | optional; default is the whole page |
 +^ [tag]|include pages with tag topic tag, requires [[doku>plugin:tag]] |required |
 +^ [flags] | flags delimited by ''&'', see [[#Configuration and Flags|flags]] | optional |
 +
 +The plugin offers four syntaxes, ''%%{{page>...}}%%'' , ''%%{{section>...}}%%'' , ''%%{{namespace>...}}%%'' and ''%%{{tagtopic>...}}%%''.
 +
 +Section is aimed more at including sections, page at including whole pages and namespace at including whole namespaces. Tagtopic includes all pages with a ''tagtopic'' ''tag''.
 +
 +==== Configuration and Flags ====
 +The plugin can be configured in the DokuWiki configuration manager available in the admin menu. These settings also affect the [[plugin:blog]] plugin which uses the include plugin to generate the blog page. For most settings there are flags that allow to override the setting. Some features are only available as flag.
 +
 +^ Configuration option ^ Flags ^ Description ^
 +^ ''noheader'' | ''noheader''/ (''show'')''header'' | Don't display the header of the inserted section |
 +^ ''firstseconly'' | ''firstsec''(''tion'')''only''/ ''fullpage'' | Display only the first section of the included page |
 +^ ''showtaglogos'' | - |Show/hide an image for the first tag (if the page has tags) |
 +^ ''showfooter'' | ''footer''/''nofooter'' |Show/hide page footer below the included page |
 +^ ''showlink'' | ''link''/''nolink'' | Makes the first headline of a included page/section a link to the included page/section |
 +^ ''showpermalink'' | ''permalink''/ ''nopermalink'' | Show/hide a permalink to the included page in the page footer |
 +^ ''showdate'' | ''date''/''nodate'' | Show/hide creation date of the page in the page footer |
 +^ ''showmdate'' | ''mdate''/''nomdate'' | Show/hide modification date of the page in the page footer |
 +^ ''showuser'' | ''user''/''nouser'' | Show/hide user name of the page creator in the page footer |
 +^ ''showcomments'' | ''comments''/''nocomments'' | Show/hide number of comments in the page footer (requires the [[plugin:discussion]] plugin) |
 +^ ''showlinkbacks'' | ''linkbacks''/''nolinkbacks'' | Show/hide number of linkbacks in the page footer (requires the [[plugin:linkback|linkback]] or [[plugin:backlinks2]] plugin) |
 +^ ''showtags'' | ''tags''/''notags'' | Show/hide tags in the page footer (requires the [[plugin:tag]] plugin) |
 +^ ''showeditbtn'' | ''editbtn'' or ''editbutton''/''noeditbtn'' or ''noeditbutton'' | Show/hide edit button below the included page |
 +^ ''doredirect'' | ''redirect''/''noredirect'' | Redirect back to original page after an edit |
 +^ ''usernamespace'' | - | Namespace for user pages (see ''showuser'' configuration) (default ''user'') |
 +^ ''doindent'' | ''indent''/''noindent'' | Indent included pages relative to the section of the page they get included in |
 +^ ''linkonly'' | ''linkonly''/''nolinkonly'' or ''include_content'' | Display only a link instead of the whole page content |
 +^ '' title''| ''title''/''notitle'' | Show the title instead of the page id|
 +^ ''pageexists''| ''pageexists''/ ''nopageexists'' | Only list page ids of existing pages (see ''existlink'')|
 +^ -| ''existlink'' | Display a link and do so only if page page-id exists (combination of ''linkonly'' and ''pageexists'')|
 +^ ''parlink''| ''parlink''/''noparlink'' | (Don't) put the link into a paragraph environment (for inline lists) |
 +^ ''order'' | ''order=OPTION'' | Ordering criteria for namespace includes, possible options: page ID (''id''), title (''title''), date created (''created''), date modified (''modified''), [[plugin:indexmenu#metadata_tag_syntax|indexmenu sort order]] (''indexmenu''), custom sort order using the ''%%{{include_n>[number]}}%%'' on the pages that are included similar to the indexmenu tags (''custom''). |
 +^ ''rsort'' | ''rsort''/''sort'' | Reverse the sort order in namespace includes. |
 +^ ''depth'' | ''depth=DEPTH'' | The maximum depth of subnamespaces of which pages are included in namespace includes, default is ''1'' for only the specified namespace, ''0'' is for unlimited depth. |
 +^ - | ''inline'' | Don't close/open sections when including a page. This flag should be used when the include syntax is used inside other syntax elements like lists or tables or inside other plugin syntax. |
 +^ - | ''beforeeach=ENTITY''/ ''aftereach=ENTITY'' | Display an [[:entities|entity]] before/after each included page. The entity is printed outside the section/include environment, this is mainly for adding custom HTML code (when the text isn't recognized as entity it is directly displayed but escaped so you can't directly use HTML code here). |
 +^ ''safeindex''| - | Don't index metadata of included pages that are non-public. This can cause problems with other plugins that use the metadata index and can be safely disabled in wikis where the permissions of the included pages match the permissions of the parent pages. |
 +
 +
 +
 +Examples:
 +
 +  {{page>concept&firstseconly&footer}}
 +  {{page>mypage&noindent}}
 +  {{namespace>myns&order=modified}}
 +
 +
 +==== Macros ====
 +
 +Simple macros are possible to serve a page on a per user or per date base. These are:
 +
 +^ @USER@  | username |
 +^ @NAME@  | full name of user |
 +^ @GROUP@ | first group the user belongs to |
 +^ @YEAR@  | 4-digit year |
 +^ @MONTH@ | 2-digit month |
 +^@WEEK@ |2-digit ISO week number |
 +^ @DAY@   | 2-digit day |
 +^ @DATE<expr>@ | use a calculated date instead of today in date macros |
 +
 +<expr> in **''@DATE<expr>@''** can be one of:
 +
 +^ PYEAR | previous year |
 +^ NYEAR | next year |
 +^ PMONTH | previous month |
 +^ NMONTH | next month |
 +^ PWEEK | previous week |
 +^ NWEEK | next week |
 +^ YESTERDAY | yesterday's date |
 +^ TOMORROW | tomorrow's date |
 +
 +Examples:
 +
 +  {{page>@MONTH@:@DAY@:birthdays}}
 +includes the page ''birthdays'' in namespace <month>:<day>: eg. ''10:15: birthdays'' for the 15th of october.
 +
 +  {{page>@USER@:message}}
 +incudes the page ''message'' from the namespace <user> of the logged in user
 +
 +  {{page>foo@DATENWEEK@@YEAR@:@WEEK@}}
 +includes the page <weekno> from the namespace ''foo<year>'' with next week's date  e.g.  foo2012:01 for the 27th of december 2011
  
  
wiki/syntax.txt · Last modified: 2021/08/14 04:21 (external edit)