Benutzer-Werkzeuge

Webseiten-Werkzeuge


wiki:syntax

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Letzte ÜberarbeitungBeide Seiten der Revision
wiki:syntax [2013/07/11 11:52] matthias.zagermannwiki:syntax [2013/07/23 14:16] – [8.1 Sortablejs] matthias.zagermann
Zeile 498: Zeile 498:
 Die Syntax von DokuWiki kann durch [[doku>plugins|Plugins]] erweitert werden. Wie die einzelnen Plugins benutzt werden, steht auf den zugehörigen Beschreibungsseiten. Die folgenden Plugins sind auf dieser DokuWiki Installation verfügbar: Die Syntax von DokuWiki kann durch [[doku>plugins|Plugins]] erweitert werden. Wie die einzelnen Plugins benutzt werden, steht auf den zugehörigen Beschreibungsseiten. Die folgenden Plugins sind auf dieser DokuWiki Installation verfügbar:
  
-===== Doodle-Plugin ===== +===== 8.1 Doodle Plugin ===== 
-Dieses kann dir helfen, Termine mit anderen Leuten zu planen oder Entscheidungen herbeizuführen. Die Syntax sieht wie folgt aus:+Dieses Plugin kann dir helfen, Termine mit anderen Leuten zu planen oder Entscheidungen herbeizuführen. Die Syntax sieht wie folgt aus:
   <doodle [id]>   <doodle [id]>
-  ^ [Auswahltext 1] ^ [Auswahltext 2] ^ ... ^+  ^ [Auswahltext] ^ [Auswahltext] ^ ... ^
   </doodle>   </doodle>
  
 Du brauchst lediglich einen Tabellenkopf, der die Auswahlmöglichkeiten enthält, in die ''%%<doodle>%%'' Tags einbetten. Du brauchst lediglich einen Tabellenkopf, der die Auswahlmöglichkeiten enthält, in die ''%%<doodle>%%'' Tags einbetten.
  
-^ [id]     | die ID des Doodle; muss eindeutig sein ((andernfalls werden Metadaten verschiedener Doodles mit der gleicher ID durcheinander gebracht, d.h. Antworten auf Entscheidungen in einem früheren Doodle erscheinen in der neuen, wenn die Entscheidungen die gleichen sind)); erscheint als Titel | obligatorisch | +^ [id]     | die ID des Doodle; muss eindeutig sein ((andernfalls werden Metadaten verschiedener Doodles mit der gleicher ID durcheinander gebracht, d.h. einige Antworten auf Entscheidungen aus einem früheren Doodle erscheinen im neuen Doodle)); erscheint als Titel | obligatorisch | 
-^ [choice] | an option for which users can tick a checkbox whether it's okay for them or not | obligatorisch |+^ [Auswahltext] | eine Option für die Benutzer zum Ankreuzen | obligatorisch |
  
-You may also add more optional parameters...+Es könne noch weitere, optionale Parameter verwendet werden...
  
   <doodle [disable] [single] [login]| [id]>   <doodle [disable] [single] [login]| [id]>
-  ^ [choice] ^ [choice] ^ ... ^+  ^ [Auswahltext] ^ [Auswahltext] ^ ... ^
   </doodle>   </doodle>
  
-^ [disable]| view the result(cannot vote) | +^ [disable]| das Ergebnis anzeigen (es kann nicht abgestimmt werden) | 
-^ [single] | only can check one choice +^ [single] | es kann nur eine Auswahl getroffen werden 
-^ [login] voter must login first & use fullname to be voter name |+^ [login] Benutzer muss eingeloggt sein, der Vor- und Nachname wird als Name verwendet |
  
-You can see this plugin in action [[http://www.ichiayi.com/wiki/tech:dokuwiki:plugin:doodle:demo|here]].+Demo des Plugins: [[http://www.ichiayi.com/wiki/opensource/dokuwiki/plugin/doodle/demo| Doodle Plugin Demo]]. 
 + 
 +===== 8.2 AV Bar Chart Plugin ===== 
 +Dieses Plugin stellt Daten als Balkendiagramm dar.\\ 
 +<barchart> 
 +1000| 
 +A:500, 
 +B:50, 
 +C:250, 
 +D:1000 
 +</barchart> 
 +<code> 
 +<barchart> 
 +1000| 
 +A:500, 
 +B:50, 
 +C:250, 
 +D:1000 
 +</barchart> 
 +</code> 
 +  * Der erste Wert ist der Maximalwert der Daten. 
 +  * Nach dem | folgt eine durch Komma separierte Liste mit Beschriftung:Wert-Paaren, die im Balkendiagramm angezeigt werden sollen. 
 + 
 +===== 8.3 Tablecalc Plugin ===== 
 +To perform a calculation you need to insert XL-style formula into work sheet. Any expression must be started with ''~~='' and finished by ''~~''. You can use direct range specification for functions (like XL does) or a special ''range()'' function. The range consists of a reference to the start cell and to the finish cell, like this: 
 +<code> 
 +r0c4 
 +</code> 
 +Please note, that row (''r'') and column (''c'') index starts from zero. Row and column prefixes can be swapped. The following is equal of the above: 
 +<code> 
 +c4r0 
 +</code> 
 + 
 +You can also reference to multiple cells in one range: 
 +<code> 
 +|r0c0:r1c1|| 
 +</code> 
 + 
 +Furthermore you can use multiple ranges: 
 +<code> 
 +r0c0:r1c1,r0c3:r1c4 
 +</code> 
 + 
 +There is a recommendation not to use references for non-existing cells. For example, this is not correct (though it will work, returning "3"): 
 +<code> 
 +| 1 | 
 +| 2 | 
 +| ~~=sum(r0c0:r99c99)~~ | 
 +</code> 
 + 
 +Instead use constructions like this: 
 +<code> 
 +| 1 | 
 +| 2 | 
 +| ~~=sum(range(0,0,col(),row()-1))~~ | 
 +</code> 
 + 
 +==== Functions ==== 
 + 
 +The following functions are implemented: 
 + 
 +''x'' = column, ''y'' = row 
 + 
 +^ Func                                      Description                                                                         ^ 
 +| cell(x,y)                    | Returns numeric value of (x,y) cell                                                              | 
 +| row()                        | Returns current row                                                                              | 
 +| col()                        | Returns current column                                                                           | 
 +| range(x1,y1,x2,y2)           | Returns internal range for other functions                                                       | 
 +| sum(range)                   | Returns sum of the specified range                                                               | 
 +| count(range)                 | Returns number of elements in the specified range                                                | 
 +| round(number;decimals)       | Returns number, rounded to specified decimals                                                    | 
 +| label(string)                | Binds label to the table                                                                         | 
 +| average(range)               | Returns average of the specified range                                                           | 
 +| min(range)                   | Returns minimum value within specified range                                                     | 
 +| max(range)                   | Returns minimum value within specified range                                                     | 
 +| check(condition;true;false)  | Executes ''true'' statement, if ''condition'' is not zero                                        | 
 +| compare(a;b;operation)       | Do math compare for ''a'' and ''b''. Returns zero when conditions for the ''operation'' are not met  | 
 +| calc()                       | FIXME  | 
 + 
 +Though you can use colon as delimiter in functions semi-colon is preferred and recommended. 
 + 
 + 
 +==== Operators ==== 
 + 
 +Most of the standard Javascript arithmetic operators are supported but some ((The conflicting operators are: %%^ | ~%%)) conflict with the table markup so the following operators are available: 
 + 
 +^  Operator  ^  Description 
 +|  +         | Addition and unary plus | 
 +|  -         | Subtraction and unary negative | 
 +|  *         | Multiplication | 
 +|  /         | Division | 
 +|  %         | Modulus (division remainder) | 
 +|  &         | Logical AND | 
 +|  %%<<%%    | Shift left | 
 +|  %%>>%%    | Shift right | 
 + 
 +==== Examples ==== 
 + 
 +=== I === 
 + 
 +<code> 
 +| 1 | 2 | ~~=r0c0+r0c1~~ | ~~=10.2+1.5~~ | 
 +</code> 
 + 
 +| 1 | 2 | 3 | 11.7 | 
 + 
 +=== II === 
 +<code> 
 +| 1 | 2 | 
 +| 3 | 4 | 
 +| ~~=sum(r0c0:r1c1)~~ || 
 +</code> 
 + 
 +| 1 | 2 | 
 +| 3 | 4 | 
 +| 10 || 
 + 
 + 
 + 
 +=== III === 
 +<code> 
 +| 1 | 2 | 3 | 4 | 
 +| 5 | 6 | 7 | 8 | 
 +| **~~=sum(r0c0:r1c1,r0c3:r1c4)~~** |||| 
 +</code> 
 + 
 +| 1 | 2 | 3 | 4 | 
 +| 5 | 6 | 7 | 8 | 
 +|  **26**  |||| 
 + 
 + 
 +=== IV === 
 +<code> 
 +|1| 
 +|2| 
 +|3|    
 +|4|    
 +|5.74| 
 +|6| 
 +|7|    
 +|8|    
 +|9|    
 +|10|     
 +|11|    
 +|~~=sum(range(col(),0,col(),row()-1))~~| 
 +</code> 
 + 
 +|1| 
 +|2| 
 +|3|    
 +|4|    
 +|5.74| 
 +|6| 
 +|7|    
 +|8|    
 +|9|    
 +|10|     
 +|11|    
 +|65.74| 
 + 
 + 
 + 
 +=== V === 
 +<code> 
 +|1| 
 +|2| 
 +|3|    
 +|4|    
 +|5| 
 +|6| 
 +|7|    
 +|8|    
 +|9|    
 +|10|     
 +|~~=average(range(col(),0,col(),row()-1))~~| 
 +</code> 
 + 
 + 
 +|1| 
 +|2| 
 +|3|    
 +|4|    
 +|5| 
 +|6| 
 +|7|    
 +|8|    
 +|9|    
 +|10|     
 +|5.5| 
 + 
 +=== VI === 
 +<code> 
 +| ~~=label(ex6_1)~~1 | 2 | 
 +| 3 | 4 | 
 + 
 +Sum: **~~=sum(ex6_1.c0r0:c99r99)~~** 
 +</code> 
 + 
 + 
 +| 1 | 2 | 
 +| 3 | 4 | 
 + 
 +Sum: **10** 
 + 
 +=== VII === 
 +<code> 
 +| **~~=label(ex7_1)~~11** | ~~=sum(ex7_2.c0r0:c99r99)~~ | 
 +| 13 | 14 | 
 + 
 +| ~~=label(ex7_2)~~1 | 2 | 
 +| 3 | 4 | 
 + 
 +Sum: **~~=sum(ex7_1.c0r0:c1r1)~~** 
 +</code> 
 + 
 + 
 +| **11** | 10 | 
 +| 13 | 14 | 
 + 
 +| 1 | 2 | 
 +| 3 | 4 | 
 + 
 +Sum: **48** 
 + 
 +=== VIII === 
 +<code> 
 +| **~~=min(c0r1:c0r3)~~** | **~~=max(c1r1:c1r3)~~** | 
 +| 1 | 7 | 
 +| 2 | 8 | 
 +| 3 | 9 | 
 + 
 +~~=calc()~~ 
 +</code> 
 + 
 +| **1** | **9** | 
 +| 1 | 7 | 
 +| 2 | 8 | 
 +| 3 | 9 | 
 + 
 + 
 +=== IX === 
 +<code> 
 +| 1 | ~~=check(cell(0,row()),#True,#False)~~ | 
 +| 0 | ~~=check(cell(0,row()),#True,#False)~~ | 
 +| x | ~~=check(cell(0,row()),#True,#False)~~ | 
 +|   | ~~=check(cell(0,row()),#True,#False)~~ | 
 +| **** | ~~=check(cell(0,row()),#True,#False)~~ | 
 +</code> 
 + 
 +| 1 | True | 
 +| 0 | False | 
 +| x | False | 
 +|  | False | 
 +|  | False | 
 + 
 + 
 +=== X === 
 +<code> 
 +| 1 | 2 | 1=2 | ~~=check(compare(cell(0,row()),cell(1,row()),#=),#True,#False)~~ | 
 +| 3 | 3 | 3=3 | ~~=check(compare(cell(0,row()),cell(1,row()),#=),#True,#False)~~ | 
 +| 4 | 5 | 4<5 | ~~=check(compare(cell(0,row()),cell(1,row()),#<),#True,#False)~~ | 
 +| 6 | 7 | 6>7 | ~~=check(compare(cell(0,row()),cell(1,row()),#>),#True,#False)~~ | 
 +| 8 | 9 | 8>9 | ~~=check(compare(cell(0,row()),cell(1,row()),#>),#True,#False)~~ | 
 +| 10 | 10 | 10≥10 | ~~=check(compare(cell(0,row()),cell(1,row()),#>=),#True,#False)~~ | 
 +| 11 | 11 | 11≤11 | ~~=check(compare(cell(0,row()),cell(1,row()),#>=),#True,#False)~~ | 
 +| 12 | 12 | 12≠12 | ~~=check(compare(cell(0,row()),cell(1,row()),#!=),#True,#False)~~ | 
 +</code> 
 + 
 +| 1 | 2 | 1=2 | False | 
 +| 3 | 3 | 3=3 | True | 
 +| 4 | 5 | 4<5 | True | 
 +| 6 | 7 | 6>7 | False | 
 +| 8 | 9 | 8>9 | False | 
 +| 10 | 10 | 10≥10 | True | 
 +| 11 | 11 | 11≤11 | True | 
 +| 12 | 12 | 12≠12 | False | 
 + 
 +=== XI === 
 + 
 +^  Operator  ^  Equation         ^ Result ^ 
 +|  +         | %%~~= 3 + 2 ~~%%  |  5  | 
 +|  -         | %%~~= 3 - 2 ~~%%  |  1  | 
 +|  *         | %%~~= 3 * 2 ~~%%  |  6  | 
 +|  /         | %%~~= 6 / 2 ~~%%  |  3  | 
 +|  %         | %%~~= 7 % 2 ~~%%  |  1  | 
 +|  unary +   | %%~~= +2 ~~%%      2  | 
 +|  unary -   | %%~~= -2 ~~%%      -2  | 
 +|  &         | %%~~= 3 & 2 ~~%%  |  2  | 
 +|  %%<<%%    | %%~~= 2 << 7 ~~%% |  256  | 
 +|  %%>>%%    | %%~~= 8 >> 2 ~~%% |  2  | 
 + 
 +===== 8.1 Sortablejs ===== 
 +Plugin, welches Tabellen nach Spalten sortierbar macht. 
 +du brauchst nur die Tabelle in ''<sortable>'' und ''</sortable>'' Tags einschließen. 
 +<sortable> 
 +^Col1^Col3^Col3^ 
 +|1|one|25/12/2008| 
 +|2|two|10/12/2008| 
 +</sortable> 
 +<code> 
 +<sortable> 
 +^Col1^Col3^Col3^ 
 +|1|one|25/12/2008| 
 +|2|two|10/12/2008| 
 +</sortable> 
 +</code> 
 + 
 +Tabelle, automatisch nach erster Spalte aufsteigend sortiert 
 +<sortable 1> 
 +^Col1^Col3^Col3^ 
 +|1|one|25/12/2008| 
 +|2|two|10/12/2008| 
 +</sortable> 
 +<code> 
 +<sortable 1> 
 +^Col1^Col3^Col3^ 
 +|1|one|25/12/2008| 
 +|2|two|10/12/2008| 
 +</sortable> 
 +</code> 
 + 
 +Tabelle, automatisch nach erster Spalte absteigend sortiert 
 +<sortable r1> 
 +^Col1^Col3^Col3^ 
 +|1|one|25/12/2008| 
 +|2|two|10/12/2008| 
 +</sortable> 
 +<code> 
 +<sortable r1> 
 +^Col1^Col3^Col3^ 
 +|1|one|25/12/2008| 
 +|2|two|10/12/2008| 
 +</sortable> 
 +</code> 
 + 
 +Um nach einer Spalte sortieren zu lassen, musst du einfach nur auf den entsprechenden Spaltenkopf klicken. ein weiterer Klick dreht die Sortierung um. 
 + 
 +==== Optionen ==== 
 + 
 +<code> 
 +<sortable [[r]column] [column=alpha|numeric|ddmm|mmdd|nosort]> 
 + 
 +  <sortable r1 1=numeric 2=alpha 3=nosort> 
 +            ││   │         │       │ 
 +            ││   │         │       └keine Sortierungsoption für Spalte 3 
 +            ││   │         └Sortierung der Spalte 2 in alphanummerischer Reihenfolge 
 +            ││   └Sortierung der Spalte 1 in nummerischer Reihenfolge 
 +            │└automatische Sortierung nach Spalte 1 beim Laden der Seite 
 +            └automatische absteigende Sortierung 
 +</code>
wiki/syntax.txt · Zuletzt geändert: 2024/02/28 15:32 von 127.0.0.1