Wiki
WikiBack to Snip <-- Previous Change | Next Change -->
| Diff Summary | |||||
|---|---|---|---|---|---|
| Title | |||||
| Date | 2007-03-15 22:28:34 | 2007-04-04 23:20:29 | |||
| Editor | Herbert Poul | Herbert Poul | |||
| Tags | |||||
| 2007-03-15 22:28:34 by Herbert Poul | 2007-04-04 23:20:29 by Herbert Poul | ||||
|---|---|---|---|---|---|
| 14 | 14 | ||||
| 15 | # Documentation | 15 | # Documentation | ||
| 16 | 16 | ||||
| 17 | - Learn Wiki markup by playing in the [Sandbox] | 17 | - Learn Wiki markup by playing in the [Sandbox] | ||
| 18 | 18 | ||||
| t | 19 | TODO - further document syntax & co | t | 19 | ## Syntax |
| 20 | |||||
| 21 | The Wiki uses Markdown as it's markup language. Pl | ||||
| > | ease see http://daringfireball.net/projects/markdo | ||||
| > | wn/ for information about the syntax. | ||||
| 22 | |||||
| 23 | |||||
| 24 | ## Macros | ||||
| 25 | |||||
| 26 | Macros are a SCT extension to the Markdown languag | ||||
| > | e. Their basic syntax is: | ||||
| 27 | |||||
| 28 | {macroname parameter=value} | ||||
| 29 | |||||
| 30 | There is currently no public interface to add 3rd | ||||
| > | party macros.. but i'm planning on implementing on | ||||
| > | e. | ||||
| 31 | |||||
| 32 | The currently available macros are documented here | ||||
| > | : | ||||
| 33 | |||||
| 34 | ### News Macro | ||||
| 35 | |||||
| 36 | The news macro allows you to display threads of a | ||||
| > | given board category. A simple usage looks like th | ||||
| > | is: | ||||
| 37 | |||||
| 38 | {news category=7 baseURL=/board limit=5} | ||||
| 39 | |||||
| 40 | This would display the latest 5 threads in the boa | ||||
| > | rd category of the id '7'. | ||||
| 41 | |||||
| 42 | #### Parameters | ||||
| 43 | |||||
| 44 | The news macro supports the following parameters: | ||||
| 45 | |||||
| 46 | - Category (required): The Id of the Board categor | ||||
| > | y (as displayed in the URL to this board category) | ||||
| > | |||||
| 47 | - 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) | ||||
| 48 | - limit: The number of threads to list (default: 5 | ||||
| > | ) | ||||
| 49 | - templateName: The name of a django template to b | ||||
| > | e used for rendering. (default: wiki/news.html | ||||
| 50 | |||||
| 51 | #### Template | ||||
| 52 | |||||
| 53 | The News Macro requires a simple template (given b | ||||
| > | y the parameter 'templateName' which is by default | ||||
| > | wiki/news.html) | ||||
| 54 | |||||
| 55 | An example template might look like this: | ||||
| 56 | |||||
| 57 | {% load sph_extras %} | ||||
| 58 | |||||
| 59 | <ul class="news"> | ||||
| 60 | {% for thread in threads %} | ||||
| 61 | <li> | ||||
| 62 | <div class="subject">{{ thread.postdate| | ||||
| > | sph_date }}: {{ thread.subject }}</div> | ||||
| 63 | <div class="body">{{ thread.body_escaped | ||||
| > | }}</div> | ||||
| 64 | {% if baseURL %} | ||||
| 65 | <div class="comments"><a href="{{ base | ||||
| > | URL }}/thread/{{ thread.id }}/">{{ thread.replyCou | ||||
| > | nt }} Comments</a></div> | ||||
| 66 | {% endif %} | ||||
| 67 | </li> | ||||
| 68 | {% endfor %} | ||||
| 69 | </ul> | ||||
| 70 | |||||
| 71 | ### Include Macro | ||||
| 72 | |||||
| 73 | Allows the inclusion of an external URL into a wik | ||||
| > | i snip. The file included is also rendered using M | ||||
| > | arkdown ! | ||||
| 74 | |||||
| 75 | Example Usage: | ||||
| 76 | |||||
| 77 | {include url=http://yourhell.com/svn/root/djan | ||||
| > | go/communitytools/trunk/README start=Directories e | ||||
| > | nd=Examples} | ||||
| 78 | |||||
| 79 | 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'. | ||||
| 80 | |||||
| 81 | #### Parameters | ||||
| 82 | |||||
| 83 | - url (required): The URL to the file to include | ||||
| 84 | - 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) | ||||
| 85 | - end (optional): Some value which is used to dete | ||||
| > | rmine at which position to stop the inclusion. | ||||
| 86 | |||||
| 87 | |||||
| 88 | ### Image Macro | ||||
| 89 | |||||
| 90 | Administrators can add attachments to wiki snips. | ||||
| > | The Image macro allows to add such attachments as | ||||
| > | images into the wiki snip. | ||||
| 91 | |||||
| 92 | Example Usage: | ||||
| 93 | |||||
| 94 | {image: id=123} | ||||
| 95 | |||||
| 96 | The example would include the image with the attac | ||||
| > | hment Id 123. (The attachment Id is displayed in t | ||||
| > | he list of attachments) | ||||
| 97 | |||||
| 98 | #### Parameters | ||||
| 99 | |||||
| 100 | - id (required): Id of the attachment | ||||
| 101 | - img tag parameters: width, height, alt, align wh | ||||
| > | ich are taken 1:1 as HTML parameters. | ||||
| 102 | |||||
Powered by Sphene Community Tools
