0 Votes

Changes for page Start here if you're new

Last modified by Ryan C on 2025/06/28 04:59

From version 31.1
edited by Ryan C
on 2025/05/14 15:48
Change comment: There is no comment for this version
To version 22.1
edited by Ryan C
on 2025/05/14 13:41
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -12,43 +12,49 @@
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**:
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 16  
17 -----
17 +---
18 18  
19 -## 🧪 1. **Macro Showcase: Source-to-Output Toggle**##
19 +## 🧪 1. **Macro Showcase: Source-to-Output Toggle**
20 20  
21 -In this section we will go over many of the common macros used. The source code is how you use the macro editing in Wiki mode. If you are doing standard WYSIWYG edit mode (the default mode you get when you click edit instead of the dropdown), you can call most of these macros by simply typing /thecommand
21 +Show how a macro works without cluttering the page with raw syntax.
22 22  
23 -
24 -== Gallery Macro `/gallery` ==
25 -
23 +```xwiki
24 +== Gallery Macro ==
26 26  {{example}}
27 27  {{gallery}}
28 -[[1747262485678-297.png]]
27 +[[image:photo1.jpg]]
29 29  [[image:photo2.jpg]]
30 30  {{/gallery}}
31 31  {{/example}}
31 +```
32 32  
33 -Alternatively 
34 -\\
33 +**Why it's good:** New users see both source and result without confusion.
35 35  
36 -{{example}}
37 -{{carousel/}}
35 +---
38 38  
39 -
40 -{{/example}}
37 +## 📝 2. **Editable Template Snippets**
41 41  
42 -== Boilerplate Box ==
39 +Use `{{example}}` to store reusable content that users can copy, paste, and modify.
43 43  
41 +```xwiki
42 +== Boilerplate Box ==
44 44  {{example}}
45 45  {{box cssClass="highlight"}}
46 46  Insert your highlighted content here.
47 47  {{/box}}
48 48  {{/example}}
48 +```
49 49  
50 -== Velocity Greeting ==
50 +---
51 51  
52 +## 🎓 3. **Educational Tutorials (e.g., Velocity or Groovy)**
53 +
54 +Teach scripting with real, live code examples.
55 +
56 +```xwiki
57 +== Velocity Greeting ==
52 52  {{example}}
53 53  {{velocity}}
54 54  #set($name = "Visitor")
... ... @@ -55,31 +55,45 @@
55 55  Hello, $name!
56 56  {{/velocity}}
57 57  {{/example}}
64 +```
58 58  
66 +---
59 59  
60 -== Info vs Warning ==
68 +## 🎯 4. **Comparing Macro Parameters**
61 61  
70 +Demonstrate how different macro parameters change output—side-by-side.
71 +
72 +```xwiki
73 +== Info vs Warning ==
62 62  {{example}}
63 -{{info}}
64 -This is an info box.
65 -{{/info}}
75 +{{info}}This is an info box.{{/info}}
66 66  
67 -{{warning}}
68 -This is a warning box.
69 -{{/warning}}
77 +{{warning}}This is a warning box.{{/warning}}
70 70  {{/example}}
79 +```
71 71  
72 -== Footnote Demo ==
81 +---
73 73  
74 -{{example}}
75 -footnote{{footnote}} https://www.thewhitearchive.org/bin/view/Guides%20and%20Help/Start%20here%20if%20you're%20new/#edit{{/footnote}}
83 +## 🧩 5. **Interactive Data Blocks (TOC, Footnotes, etc.)**
76 76  
85 +Visually show what happens when you use certain macros together.
86 +
87 +```xwiki
88 +== Footnote Demo ==
89 +{{example}}
90 +This claim needs a source{{footnote}}Here it is.{{/footnote}}.
77 77  {{putFootnotes/}}
78 78  {{/example}}
93 +```
79 79  
95 +---
80 80  
81 -== Groovy Lookup ==
97 +## 🧪 6. **Live Scripting Playgrounds**
82 82  
99 +Embed small self-contained scripting playgrounds where users can view or modify dynamic output.
100 +
101 +```xwiki
102 +== Groovy Lookup ==
83 83  {{example}}
84 84  {{groovy}}
85 85  def now = new Date()
... ... @@ -86,29 +86,61 @@
86 86  println("Current time: " + now)
87 87  {{/groovy}}
88 88  {{/example}}
109 +```
89 89  
111 +---
90 90  
91 -== Expandable Summary ==
113 +## 📦 7. **Component/API Call Demos**
92 92  
115 +Useful for devs exploring the API.
116 +
117 +```xwiki
118 +== Access Current User ==
93 93  {{example}}
120 +{{velocity}}
121 +Current user: **$xcontext.user**
122 +{{/velocity}}
123 +{{/example}}
124 +```
125 +
126 +---
127 +
128 +## 📘 8. **Expandable Wiki Templates with Output**
129 +
130 +Pair `{{example}}` with `{{expandable}}` for full disclosure without visual clutter.
131 +
132 +```xwiki
133 +== Expandable Summary ==
134 +{{example}}
94 94  {{expandable summary="🧠 Study Summary"}}
95 95  Key findings go here.
96 96  {{/expandable}}
97 97  {{/example}}
139 +```
98 98  
99 -== List Formatting ==
141 +---
100 100  
143 +## 🔧 9. **Syntax Training: Bad vs Good**
144 +
145 +Side-by-side "Do this, not that" with toggles.
146 +
147 +```xwiki
148 +== List Formatting ==
101 101  {{example}}
102 102  *Bad formatting*
103 -
104 104  * use - inconsistently
105 105  ** Good formatting:
106 -* Consistent bullet style
107 -* Indented items properly
153 + * Consistent bullet style
154 + * Indented items properly
108 108  {{/example}}
156 +```
109 109  
110 -== Python Code ==
158 +---
111 111  
160 +## 💡 Bonus Tip: Combine `{{example}}` + `{{code}}` for Highlighted Snippets
161 +
162 +```xwiki
163 +== Python Code ==
112 112  {{example}}
113 113  {{code language="python"}}
114 114  def greet():
... ... @@ -115,21 +115,16 @@
115 115   print("Hello World")
116 116  {{/code}}
117 117  {{/example}}
170 +```
118 118  
119 -== Audio Embedding ==
172 +---
120 120  
121 -{{example}}
122 -{{html}}
123 -<audio controls>
124 - <source src="/bin/download/Sandbox/TestPage2/Anti-Black%20racial%20slur%20was%20found%20written%20on%20high%20school%20desk%20in%20Rockville.mp3" type="audio/mpeg">
125 - Your browser does not support the audio element.
126 -</audio>
127 -{{/html}}
128 -{{/example}}
174 +Want me to generate a panel with these uses or make a macro gallery page pre-filled with them?
129 129  
176 +
130 130  This page covers all the essential steps and tips you need to create great content in XWiki without any confusion.
131 131  
132 -== ==
179 +== ==
133 133  
134 134  == 📎 **Attachments and Images** ==
135 135  
... ... @@ -148,8 +148,6 @@
148 148  1. Upload or select the image.
149 149  1. Choose the **Thumbnail option** to create a clickable enlargable preview automatically.
150 150  
151 -[[image:1747262485678-297.png||data-xwiki-image-style="thumbnail-clickable" width="200"]]
152 -
153 153  ----
154 154  
155 155  == ⚡ **Using the / Macro Shortcut** ==
... ... @@ -379,12 +379,12 @@
379 379  == Example Macro ==
380 380  
381 381  The example macro displays the output of a macro or script or anything that you like
382 -
383 383  == Expandable Macro ==
384 384  
385 385  The following example demonstrates how to present complex information cleanly using `
386 386  
387 387  {{example}}
432 +
388 388  {{expandable summary="Study: The Wilson Effect: The Increase in Heritability of IQ With Age"}}
389 389  **Source:** *Twin Research and Human Genetics (Cambridge University Press)*
390 390  **Date of Publication:** *2013*
... ... @@ -454,4 +454,4 @@
454 454  {{/example}}
455 455  
456 456  
457 -
502 +
1747262485678-297.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.AdminAngriff
Size
... ... @@ -1,1 +1,0 @@
1 -1.6 MB
Content