Changes between Version 10 and Version 11 of User Guide/Wiki Style Guide


Ignore:
Timestamp:
May 11, 2020, 6:05:52 PM (5 years ago)
Author:
jkol
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • User Guide/Wiki Style Guide

    v10 v11  
    33
    44== Contributing to the Wiki
    5 
    65For consistent wiki formatting, please adhere to the following style guidelines.
     6[[PageOutline(3-6,,inline,unnumbered)]]
    77
    88=== General Guidelines
     
    2222  * On a console: make sure the prompt starts with {{{user@console:path$}}}
    2323  * On a compute machine: make sure the prompt starts with {{{root@console:path$}}}
    24  
    2524
    2625=== Page Specific Formatting
    2726
    2827==== Section Pages
    29 Pages that are introductory to larger sections that contain many sub pages (eg. the main [wiki:TestbedInformation Testbed Information] page or the [wiki:tutorials Tutorials] page) should use the following as a starting point:
     28Pages that are introductory to larger sections that contain many sub-pages (e.g. the [wiki:tutorials Tutorials] page) should use the following as a starting point:
    3029
    3130{{{
    32 [[TOC(SectionPageName/SubsectionPageName/*, depth=1, noheading)]]
     31[[Include(WikiToC)]]
    3332
    3433= Section Title
    35 Brief description of the section.
     34Brief description of the section...
    3635
    37 To list pages below this one, use:
    38 [[TOC(./*,nonumbering,depth=2)]]
     36[[TOC(SectionPageName/*,inline,nonumbering,notitle,noheading,depth=2)]]
    3937}}}
    4038
    41 '''NOTE:''' Please remember to put the wiki URL corresponding to the page name in the TOC macro. You can see the wiki URL at the top of the page during editing.
    42 
    43   ''Example:'' For this page, the top of the page says "''Editing test/ExperimenterInformation/WikiStyleGuide''", so the TOC macro should then be `[[TOC(test/ExperimenterInformation/WikiStyleGuide/*,depth=1)]]`. Don't forget to add the `/*` at the end of the wiki URL.
    44 
    45 The default TOC depth should be left at 1, unless it makes sense otherwise.
     39The TOC macro will auto-generate an alphabetical inline list of links to sub-pages of the section. If the sub-pages need to have a specific order, feel free to edit the TOC macro or create the list by hand, but try to keep the style as similar as possible.
    4640
    4741==== Individual Pages
    4842Individual wiki pages should use the following as a starting point:
     43
    4944{{{
    5045[[Include(WikiToC)]]
    51 [[TOC(noheading)]]
    5246
    53 = Page Title
    54 Brief description of the page.
     47== Page Title
     48Brief description of the page...
     49[[PageOutline(3-6,,inline,unnumbered)]]
    5550
    56 == Sub Section Title
    57 Sub section content.
     51=== Sub Section Title
     52Sub section content...
     53}}}
     54
     55{{{#!box type=note
     56For pages nested deeper, please increase the number of equal signs in the headings to account for the page depth accordingly (though max heading depth is 6). Otherwise, the auto-generated table of contents on parent pages may not generate correctly.
    5857}}}
    5958
    6059==== Tutorial Pages
    61 
    6260Please us the following document skeleton when writing a tutorial.
    6361
    6462{{{
    6563{{{
    66 [[TOC(noheading)]]
     64[[Include(WikiToC)]]
    6765
    68 = Tutorial Title
     66== Tutorial Title
    6967
    70 == Description
     68=== Description
    7169Description and goal of the tutorial described here...
     70[[PageOutline(3-6,,inline,unnumbered)]]
    7271
    73 == Prerequisites
     72=== Prerequisites
    7473In order to access the test bed, create a reservation and have it approved by the reservation service. Access to the resources is granted after the reservation is confirmed. Please follow the process shown on [wiki:cosmos_workflow the COSMOS work flow page] to get started.
    7574
    76 == Resource Requirements
     75=== Resource Requirements
    7776List of specific resources or requirements, including OMF image name if applicable.
    7877
    79 == Setup
     78=== Setup
    8079Steps to setup the tutorial...
    8180
    82 == Execution
     81=== Execution
    8382
    84 === The first thing you do
     83==== The first thing you do
    8584First step of the tutorial...
    8685
    87 === The second thing you do
     86==== The second thing you do
    8887Second step of the tutorial...
    8988}}}
     
    9190
    9291
    93 === Syntax Highlighting and code blocks
     92=== Code Blocks and Syntax Highlighting
     93When including raw source code blocks, try to use the appropriate syntax highlighting for the language used. Trac uses [https://pygments.org/docs/lexers/ pygments] to do syntax highlighting in code blocks.
    9494
    95 Trac uses [https://pygments.org/docs/lexers/ pygments] to do syntax highlighting in code blocks
     95==== Example 1
    9696{{{
    9797{{{#!shell
    98   echo "foo"
     98echo "foo"
     99}}}
    99100}}}
    100101
    101 or
     102 will be rendered as
    102103
     104{{{#!shell
     105echo "foo"
     106}}}
     107
     108==== Example 2
     109{{{
    103110{{{#!ruby
    104111defTopology('rxnode') { |t|
     
    117124}}}
    118125
     126 will be rendered as
     127
     128{{{#!ruby
     129defTopology('rxnode') { |t|
     130  # Load the topology of imaged nodes
     131  # These nodes are from most recent omf load command
     132  baseTopo = Topology['system:topo:imaged']
     133
     134  # Draw a random node from the pool of active ones
     135  aNode = baseTopo.getUniqueRandomNode
     136
     137  # Add this random node to this 'senderTopo' topology
     138  t.addNode(aNode)
     139  puts "RX: #{t.getNodeByIndex(0).to_s}"
     140}
     141}}}
     142
    119143==== Common formats
    120144
    121 || language || shortname for codeblock ||
    122 || shell script || bash, sh, ksh, zsh, shell ||
    123 || shell session || console, shell-session ||
    124 || powershell || powershell, posh, ps1, psm1 ||
    125 || ruby session || rbcon, irb ||
    126 || ruby code || rb, ruby, duby ||
    127 || json || json ||
    128 || json w no braces || json-object ||
    129 || yaml, yml || yaml ||
    130 || mix of yaml and jinja ||yaml+jinja, salt, sls ||
    131 || docker || docker, dockerfile ||
     145 ||=Language =||=Shortname for Codeblock =||
     146 || shell script || bash, sh, ksh, zsh, shell ||
     147 || shell session || console, shell-session ||
     148 || powershell || powershell, posh, ps1, psm1 ||
     149 || ruby session || rbcon, irb ||
     150 || ruby code || rb, ruby, duby ||
     151 || json || json ||
     152 || json w no braces || json-object ||
     153 || yaml, yml || yaml ||
     154 || mix of yaml and jinja ||yaml+jinja, salt, sls ||
     155 || docker || docker, dockerfile ||
    132156
    133157=== Using Markdown or !RestructuredText
    134158
    135 Using code blocks like before, Trac can render other markup formats
     159To use Markdown instead of Tracs' own language, simply enclose the Markdown text in a code block starting with `#!Markdown` like this:
    136160{{{
    137161{{{#!Markdown
    138 # heading 1
    139 ## heading 2
    140 ### heading 3
     162# Some Title
     163Sample text.
     164
     165## A Sub Section
     166More sample text.
     167
     168### Yet another sub section
     169Even more sample text.
     170}}}
     171}}}
     172
     173or if you want to use !RestructuredText instead, start the code block with `#!rst` like this:
     174{{{
     175{{{#!rst
     176**********
     177Some Title
     178**********
     179Sample text.
     180
     181A Sub Section
     182#############
     183More sample text.
     184
     185Yet another sub section
     186***********************
     187Even more sample text.
    141188}}}
    142189}}}
     
    145192
    146193
    147