| | | |
| # Documentation | | # Documentation |
| | | |
| - Learn Wiki markup by playing in the [Sandbox] | | - Learn Wiki markup by playing in the [Sandbox] |
| | | |
t | TODO - further document syntax & co
| t | ## Syntax
|
| | |
|
| | | The Wiki uses Markdown as it's markup language. Pl |
| | | ease see http://daringfireball.net/projects/markdo |
| | | wn/ for information about the syntax.
|
| | |
|
| | |
|
| | | ## Macros
|
| | |
|
| | | Macros are a SCT extension to the Markdown languag |
| | | e. Their basic syntax is:
|
| | |
|
| | | {macroname parameter=value}
|
| | |
|
| | | There is currently no public interface to add 3rd |
| | | party macros.. but i'm planning on implementing on |
| | | e.
|
| | |
|
| | | The currently available macros are documented here |
| | | :
|
| | |
|
| | | ### News Macro
|
| | |
|
| | | The news macro allows you to display threads of a |
| | | given board category. A simple usage looks like th |
| | | is:
|
| | |
|
| | | {news category=7 baseURL=/board limit=5}
|
| | |
|
| | | This would display the latest 5 threads in the boa |
| | | rd category of the id '7'.
|
| | |
|
| | | #### Parameters
|
| | |
|
| | | The news macro supports the following parameters:
|
| | |
|
| | | - Category (required): The Id of the Board categor |
| | | y (as displayed in the URL to this board category) |
| | |
|
| | | - baseURL (required): The URL at which the board i |
| | | s located. (This parameter might get obsolete pret |
| | | ty soon since there is now a way to automatically |
| | | resolve a configured URL)
|
| | | - limit: The number of threads to list (default: 5 |
| | | )
|
| | | - templateName: The name of a django template to b |
| | | e used for rendering. (default: wiki/news.html
|
| | |
|
| | | #### Template
|
| | |
|
| | | The News Macro requires a simple template (given b |
| | | y the parameter 'templateName' which is by default |
| | | wiki/news.html)
|
| | |
|
| | | An example template might look like this:
|
| | |
|
| | | {% load sph_extras %}
|
| | |
|
| | | <ul class="news">
|
| | | {% for thread in threads %}
|
| | | <li>
|
| | | <div class="subject">{{ thread.postdate| |
| | | sph_date }}: {{ thread.subject }}</div>
|
| | | <div class="body">{{ thread.body_escaped |
| | | }}</div>
|
| | | {% if baseURL %}
|
| | | <div class="comments"><a href="{{ base |
| | | URL }}/thread/{{ thread.id }}/">{{ thread.replyCou |
| | | nt }} Comments</a></div>
|
| | | {% endif %}
|
| | | </li>
|
| | | {% endfor %}
|
| | | </ul>
|
| | |
|
| | | ### Include Macro
|
| | |
|
| | | Allows the inclusion of an external URL into a wik |
| | | i snip. The file included is also rendered using M |
| | | arkdown !
|
| | |
|
| | | Example Usage:
|
| | |
|
| | | {include url=http://yourhell.com/svn/root/djan |
| | | go/communitytools/trunk/README start=Directories e |
| | | nd=Examples}
|
| | |
|
| | | The example would include content from the file fr |
| | | om the given url starting with a line containing ' |
| | | Directories' until a line containing the content ' |
| | | Examples'.
|
| | |
|
| | | #### Parameters
|
| | |
|
| | | - url (required): The URL to the file to include
|
| | | - start (optional): Some value which is used to de |
| | | termine at which position in the file to start the |
| | | inclusion. (The line containing the given word wi |
| | | ll not be included)
|
| | | - end (optional): Some value which is used to dete |
| | | rmine at which position to stop the inclusion.
|
| | |
|
| | |
|
| | | ### Image Macro
|
| | |
|
| | | Administrators can add attachments to wiki snips. |
| | | The Image macro allows to add such attachments as |
| | | images into the wiki snip.
|
| | |
|
| | | Example Usage:
|
| | |
|
| | | {image: id=123}
|
| | |
|
| | | The example would include the image with the attac |
| | | hment Id 123. (The attachment Id is displayed in t |
| | | he list of attachments)
|
| | |
|
| | | #### Parameters
|
| | |
|
| | | - id (required): Id of the attachment
|
| | | - img tag parameters: width, height, alt, align wh |
| | | ich are taken 1:1 as HTML parameters.
|
| | |
|