Wiki source code of Sandbox

Last modified by Drunk Monkey on 2024-05-02 05:56

Show last authors
1 {{html}}
2 <!--
3 = rss macro =
4
5 { { rss feed="https://nitter.net/I_Am_The_ICT/with_replies/rss" content="false" css="true" image="false" decoration="true"/
6 -->
7 {{/html}}
8
9
10 = Quagmyre =
11
12 Quagmyre
13
14 External Link ([[good>>https://files.quagmyre.com/index.html]])
15
16 External Link ([[bad>>https://files.quagmyre.com/nosuchfile.html]])
17
18 Linkchecker: [[here>>XWiki.ExternalLinks]]
19
20 Non existing [[internal link>>notexist||style="outline-width: 0px !important; user-select: auto !important;"]] test
21
22 == lc queue size ==
23
24 {{groovy}}
25 import com.xpn.xwiki.web.*
26 import org.xwiki.rendering.transformation.*
27
28 def checker = Utils.getComponent(Transformation.class, "linkchecker")
29
30 print "Link checker queue size = ${checker.linkQueue.size()}"
31 {{/groovy}}
32
33
34 == lc invalid links ==
35
36 {{groovy}}
37 import groovy.util.logging.*
38 import org.xwiki.observation.*
39 import org.xwiki.observation.event.*
40 import org.xwiki.rendering.transformation.linkchecker.*
41 import com.xpn.xwiki.web.*
42 import com.xpn.xwiki.*
43
44 @Log
45 class MyLinkListener implements EventListener
46 {
47 def xwiki
48 def context
49
50 MyLinkListener(xwiki, context)
51 {
52 this.xwiki = xwiki
53 this.context = context
54 }
55
56 String getName()
57 {
58 return "myLinkListener"
59 }
60
61 List<Event> getEvents()
62 {
63 return Arrays.asList(new InvalidURLEvent())
64 }
65
66 void onEvent(Event event, Object eventSource, Object data)
67 {
68 def url = eventSource.get("url")
69 def source = eventSource.get("source")
70 def state = eventSource.get("state")
71
72 log.info("Error for {url} in ${source} - Response code: ${state.getResponseCode()} - Checked: ${String.format('%tF %<tT', state.getLastCheckedTime())}")
73 }
74 }
75
76 // Register against the Observation Manager
77 def observation = Utils.getComponent(ObservationManager.class)
78 observation.removeListener("myLinkListener")
79 def listener = new MyLinkListener(xwiki, xcontext)
80 observation.addListener(listener)
81 {{/groovy}}
82
83
84
85 Glossary test: {{glossaryReference glossaryId="Glossary" entryId="OTE"}}OTE{{/glossaryReference}} is an entry, but OTP is not.
86
87 The sandbox is a part of your wiki that you can freely modify. It's meant to let you practice editing. You will discover how page editing works and create new pages. Simply click on **Edit** to get started!
88
89 {{info}}
90 Don't worry about overwriting or losing stuff when editing the page, you can always roll back to the first version of the page from the "History" tab at the bottom of the page.
91 {{/info}}
92
93 If you want to give a look to the underlying [[XWiki Syntax>>XWiki.XWikiSyntax]], you can click on "Wiki code" in the "Show" menu or click on the "Source" tab when editing the page.
94
95 Here are a number of test pages you can play with:
96
97 * [[Sandbox Test Page 1>>Sandbox.TestPage1]]
98 * [[Sandbox Test Page 2>>Sandbox.TestPage2]]
99 * [[Sandbox Test Page 3>>Sandbox.TestPage3]]
100
101 Below is a demonstration of the [[XWiki Syntax>>XWiki.XWikiSyntax]] you can use in wiki pages (headings, images, tables).
102
103 = {{id name="你好"/}}Headings =
104
105 XWiki offers 6 levels of headings. You can use them to structure your pages.
106
107 == Level 2 Heading ==
108
109 === Level 3 Heading ===
110
111 ==== Level 4 Heading 4 ====
112
113 ===== Level 5 Heading 5 =====
114
115 ====== Level 6 Heading 6 ======
116
117 = {{id name="这个"/}}Styles =
118
119 Basic styles are supported in XWiki:
120
121 * **Text in Bold**
122 * //Text in Italics//
123 * __Text in Underline__
124 * --Text in Strikethrough--
125 * Text in ,,subscript,,
126 * Text in ^^superscript^^
127
128 = Anchors - ascii =
129
130 xwiki code: ~{~{id name="ae"/}}
131
132 {{id name="ae"/}}ae
133
134 = Anchors - non ascii =
135
136 xwiki code: ~{~{id name="ä"/}}
137
138 {{id name="ä"/}}ä
139
140 = Lists =
141
142 You can create various types of lists in your wiki pages:
143
144 == Unordered list ==
145
146 * Level 1
147 ** Level 2
148 *** Level 3
149 ** Level 2
150 * Level 1
151
152 == Numbered list ==
153
154 1. Item
155 11. Subitem
156 111. Item
157 1. Subitem
158
159 == Mixed list ==
160
161 1. Item 1
162 11. Item 2
163 11*. Item 3
164 11*. Item 4
165 1. Item 5
166
167 = Tables =
168
169 You can create tables right into wiki pages:
170
171 == Table with headers in the top row ==
172
173 |= table header |= table header |= table header
174 | cell | cell | cell
175 | cell | cell | cell
176
177 == Table with headers in the top row and left column ==
178
179 |= table header |= table header |= table header
180 |= table header | cell | cell
181 |= table header | cell | cell
182
183 = Links =
184
185 XWiki allows you to create links to other pages in your wiki or on the web:
186
187 * [[WebHome]] -> links to the homepage of the current space
188 * [[Sandbox Home>>WebHome]] -> links can have labels
189 * [[Wiki Home>>Main.WebHome]] -> a link can use the SpaceName.PageName format to link to a page located in another space
190 * [[http://www.xwiki.org]] -> you can link to wiki pages or to external websites
191 * [[XWiki.org Website>>http://www.xwiki.org]] -> link labels work for exernal links too
192
193 You can also create links to attachments:
194
195 attach:XWikiLogo.png
196
197 = Images =
198
199 You can insert images in your wiki pages:
200
201 [[image:XWikiLogo.png]]
202
203 = Macros =
204
205 Macros allow you to make wiki content look better and to add additional features to your wiki. Here are 2 examples of how macros can be used in wiki pages:
206
207 == Box Macro ==
208
209 {{box}}
210 box
211 {{/box}}
212
213 {{box title="**Title**"}}
214 box
215 {{/box}}
216
217 == Error Macro ==
218
219 {{error}}
220 Error
221 {{/error}}
222
223 {{error title="**Title**"}}
224 Error
225 {{/error}}
226
227 == Info Macro ==
228
229 {{info}}
230 Info
231 {{/info}}
232
233 {{info title="**Title**"}}
234 Info
235 {{/info}}
236
237 == Success Macro ==
238
239 {{success}}
240 Success
241 {{/success}}
242
243 {{success title="**Title**"}}
244 Success
245 {{/success}}
246
247 == Warning Macro ==
248
249 {{warning}}
250 Hello World
251 {{/warning}}
252
253 {{warning title="**Title**"}}
254 Hello World
255 {{/warning}}
256
257 == Table of Contents ==
258
259 This macro automatically generates a table of contents of your wiki page based on headings:
260
261 {{toc/}}