Changes for page Sandbox


on 2022-04-02 07:35

on 2024-05-02 05:56
Summary
Details
- Page properties
-
- Content
-
... ... @@ -1,7 +1,89 @@ 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 + 1 1 = Quagmyre = 2 2 3 3 Quagmyre 4 4 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 + 5 5 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! 6 6 7 7 {{info}} ... ... @@ -116,73 +116,62 @@ 116 116 117 117 You can insert images in your wiki pages: 118 118 119 -image:XWikiLogo.png 201 +[[image:XWikiLogo.png]] 120 120 121 121 = Macros = 122 122 123 123 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: 124 124 125 -== Warning Macro == 126 - 127 -{{warning}} 128 -Hello World 129 -{{/warning}} 130 - 131 -{{warning title="Title"}} 132 -Hello World 133 -{{/warning}} 134 - 135 135 == Box Macro == 136 136 137 -{{box title="Title"}}209 +{{box}} 138 138 box 139 139 {{/box}} 140 140 141 -{{box title="Title"}} 213 +{{box title="**Title**"}} 142 142 box 143 143 {{/box}} 144 144 145 -== NoteMacro ==217 +== Error Macro == 146 146 147 -{{ Notetitle="Title"}}148 - Note149 -{{/ box}}219 +{{error}} 220 +Error 221 +{{/error}} 150 150 151 -{{ boxtitle="Title"}}152 - Note153 -{{/ box}}223 +{{error title="**Title**"}} 224 +Error 225 +{{/error}} 154 154 155 155 == Info Macro == 156 156 157 -{{ Note title="Title"}}229 +{{info}} 158 158 Info 159 -{{/ box}}231 +{{/info}} 160 160 161 -{{ boxtitle="Title"}}233 +{{info title="**Title**"}} 162 162 Info 163 -{{/ box}}235 +{{/info}} 164 164 165 -== Error Macro == 166 - 167 -{{Note title="Title"}} 168 -Error 169 -{{/box}} 170 - 171 -{{box title="Title"}} 172 -Error 173 -{{/box}} 174 - 175 175 == Success Macro == 176 176 177 -{{ Notetitle="Title"}}239 +{{success}} 178 178 Success 179 -{{/ box}}241 +{{/success}} 180 180 181 -{{ boxtitle="Title"}}243 +{{success title="**Title**"}} 182 182 Success 183 -{{/ box}}245 +{{/success}} 184 184 247 +== Warning Macro == 185 185 249 +{{warning}} 250 +Hello World 251 +{{/warning}} 252 + 253 +{{warning title="**Title**"}} 254 +Hello World 255 +{{/warning}} 256 + 186 186 == Table of Contents == 187 187 188 188 This macro automatically generates a table of contents of your wiki page based on headings: