... |
... |
@@ -12,6 +12,107 @@ |
12 |
12 |
|
13 |
13 |
== Getting Started with XWiki == |
14 |
14 |
|
|
15 |
+The example macro in XWiki is an underrated powerhouse—great for *teaching*, *showcasing macros*, *hiding complex markup*, and *letting users play with source-output pairs*. Here are some **highly effective and interesting uses**: |
|
16 |
+ |
|
17 |
+--- |
|
18 |
+ |
|
19 |
+## 🧪 1. **Macro Showcase: Source-to-Output Toggle** |
|
20 |
+ |
|
21 |
+Show how a macro works without cluttering the page with raw syntax. |
|
22 |
+ |
|
23 |
+ |
|
24 |
+== Gallery Macro == |
|
25 |
+ |
|
26 |
+{{example}} |
|
27 |
+ |
|
28 |
+{{gallery}} |
|
29 |
+[[image:photo1.jpg]] |
|
30 |
+[[image:photo2.jpg]] |
|
31 |
+{{/gallery}} |
|
32 |
+ |
|
33 |
+{{/example}} |
|
34 |
+ |
|
35 |
+ |
|
36 |
+== Boilerplate Box == |
|
37 |
+{{example}} |
|
38 |
+{{box cssClass="highlight"}} |
|
39 |
+Insert your highlighted content here. |
|
40 |
+{{/box}} |
|
41 |
+{{/example}} |
|
42 |
+ |
|
43 |
+== Velocity Greeting == |
|
44 |
+{{example}} |
|
45 |
+{{velocity}} |
|
46 |
+#set($name = "Visitor") |
|
47 |
+Hello, $name! |
|
48 |
+{{/velocity}} |
|
49 |
+{{/example}} |
|
50 |
+ |
|
51 |
+ |
|
52 |
+== Info vs Warning == |
|
53 |
+{{example}} |
|
54 |
+{{info}}This is an info box.{{/info}} |
|
55 |
+ |
|
56 |
+{{warning}}This is a warning box.{{/warning}} |
|
57 |
+{{/example}} |
|
58 |
+ |
|
59 |
+== Footnote Demo == |
|
60 |
+{{example}} |
|
61 |
+This claim needs a source{{footnote}}Here it is.{{/footnote}}. |
|
62 |
+{{putFootnotes/}} |
|
63 |
+{{/example}} |
|
64 |
+ |
|
65 |
+== Groovy Lookup == |
|
66 |
+{{example}} |
|
67 |
+{{groovy}} |
|
68 |
+def now = new Date() |
|
69 |
+println("Current time: " + now) |
|
70 |
+{{/groovy}} |
|
71 |
+{{/example}} |
|
72 |
+ |
|
73 |
+ |
|
74 |
+== Access Current User == |
|
75 |
+{{example}} |
|
76 |
+{{velocity}} |
|
77 |
+Current user: **$xcontext.user** |
|
78 |
+{{/velocity}} |
|
79 |
+{{/example}} |
|
80 |
+ |
|
81 |
+ |
|
82 |
+== Expandable Summary == |
|
83 |
+{{example}} |
|
84 |
+{{expandable summary="🧠 Study Summary"}} |
|
85 |
+Key findings go here. |
|
86 |
+{{/expandable}} |
|
87 |
+{{/example}} |
|
88 |
+ |
|
89 |
+== List Formatting == |
|
90 |
+{{example}} |
|
91 |
+*Bad formatting* |
|
92 |
+* use - inconsistently |
|
93 |
+** Good formatting: |
|
94 |
+ * Consistent bullet style |
|
95 |
+ * Indented items properly |
|
96 |
+{{/example}} |
|
97 |
+ |
|
98 |
+== Python Code == |
|
99 |
+{{example}} |
|
100 |
+{{code language="python"}} |
|
101 |
+def greet(): |
|
102 |
+ print("Hello World") |
|
103 |
+{{/code}} |
|
104 |
+{{/example}} |
|
105 |
+ |
|
106 |
+== Audio Embedding == |
|
107 |
+{{example}} |
|
108 |
+{{html}} |
|
109 |
+<audio controls> |
|
110 |
+ <source src="/bin/download/Sandbox/TestPage2/Anti-Black%20racial%20slur%20was%20found%20written%20on%20high%20school%20desk%20in%20Rockville.mp3" type="audio/mpeg"> |
|
111 |
+ Your browser does not support the audio element. |
|
112 |
+</audio> |
|
113 |
+{{/html}} |
|
114 |
+{{/example}} |
|
115 |
+ |
15 |
15 |
This page covers all the essential steps and tips you need to create great content in XWiki without any confusion. |
16 |
16 |
|
17 |
17 |
== == |
... |
... |
@@ -258,6 +258,10 @@ |
258 |
258 |
{{video url="https://www.youtube.com/watch?v=dQw4w9WgXcQ"/}} |
259 |
259 |
{{/example}} |
260 |
260 |
|
|
362 |
+ |
|
363 |
+== Example Macro == |
|
364 |
+ |
|
365 |
+The example macro displays the output of a macro or script or anything that you like |
261 |
261 |
== Expandable Macro == |
262 |
262 |
|
263 |
263 |
The following example demonstrates how to present complex information cleanly using ` |
... |
... |
@@ -332,3 +332,5 @@ |
332 |
332 |
{{/expandable}} |
333 |
333 |
{{/example}} |
334 |
334 |
|
|
440 |
+ |
|
441 |
+ |