cewebs-didaktiki 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +407 -0
- data/cewebs-didaktiki.gemspec +2 -2
- data/lib/cewebs-didaktiki/delivery.rb +10 -6
- data/lib/cewebs-didaktiki/helpers/grammar_didaktiki.rb +27 -18
- data/lib/cewebs-didaktiki/helpers/output_latex.rb +2 -0
- data/lib/cewebs-didaktiki/helpers/output_xhtml.rb +4 -3
- data/lib/cewebs-didaktiki/helpers/views.rb +28 -12
- data/server/data/Default/Data/Formulas/1 +604 -0
- data/server/data/Default/Data/Formulas/revisions.xml +8 -0
- data/server/data/Default/Data/Help/1 +382 -0
- data/server/data/Default/Data/Help/revisions.xml +8 -0
- data/server/data/Default/linking.xml +4 -0
- data/server/data/Default/strings.xml +10 -8
- metadata +12 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0d8eed94401a6504a4d8c57ede4e5c8a371d3ec6fb54ccffb01ba78ef31d19de
|
|
4
|
+
data.tar.gz: a98174ee560c187b2caf52fd9eecfa030f5fcf1d7140b44603925659e02849bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93f75655d30565a28f029e9c3657724fc764abf375a71bd2e029f284a041923cbffd6b66e41d83fe6e565e542dc7cd6d7c5b25099ad579d3b0c2917f0419e5d6
|
|
7
|
+
data.tar.gz: fc89c10a96cb5b8a8cc3159cf64a6f7f1c6eacb4ee53f87d0b402c74c7cd9d7a9d2f222e050771c34408261a5e55d45a82401598055bebfd8e49baffcc7f1380
|
data/README.md
CHANGED
|
@@ -10,6 +10,413 @@ cewebs-aman service aman didaktiki # the AMan in the directory aman offers the
|
|
|
10
10
|
|
|
11
11
|
See the README of `cewebs-transformationengine` for how all parts of CEWebS work together.
|
|
12
12
|
|
|
13
|
+
Every new wiki starts with two pages, copied from `server/data/Default/Data`: **Help**, the markup reference below, and **Formulas**, which shows the supported formula commands.
|
|
14
|
+
|
|
15
|
+
## Markup
|
|
16
|
+
|
|
17
|
+
Διδακτικη implements a WIKI as a CEWebS (Cooperative Environment Web Service). The markup of **Διδακτικη** is similar to [MediaWiki](http://de.wikipedia.org), but differs in some nuances from MediaWiki.
|
|
18
|
+
|
|
19
|
+
### Paragraphs
|
|
20
|
+
|
|
21
|
+
Every new line (CR/LF) starts a new paragraph. So to write a paragraph, start a new line, write the whole content, and let the browser wrap the lines.
|
|
22
|
+
For more space between two paragraphs, insert an empty line. It must not contain a space, otherwise an empty box is created.
|
|
23
|
+
|
|
24
|
+
### Boxes
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
This box is created simply by starting the line with a blank (space).
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Links
|
|
31
|
+
|
|
32
|
+
Making links to other locations on the web works by inserting
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
[http://www.ruby-lang.org|description]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
mailto: links work by inserting
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
[mailto:et@cewebs.org|description]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Creating new WIKI-keywords (new documents in the WIKI) is as simple as writing
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
[[keyword]]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The resulting link is red when the linked document does not already exists. It turns to blue when content is added.
|
|
51
|
+
|
|
52
|
+
Making internal links (referencing WIKI-keywords) works similar to creating
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
[[keyword|description]]
|
|
56
|
+
[[keyword#section_1|description]]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The keyword is the name of the existing WIKI-site. The section_? (anchor) is optional and the digit ? to refer a certain caption is the number of the heading within this document.
|
|
60
|
+
|
|
61
|
+
Example: on the Help page, heading "Links" has the number 3, because we start counting from 0. An internal link to it looks like:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
[[Help#section_3|Links]]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Headings
|
|
68
|
+
|
|
69
|
+
Headings work as expected:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
== heading
|
|
73
|
+
=== sub-heading
|
|
74
|
+
==== sub-sub-heading
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Other basics
|
|
78
|
+
|
|
79
|
+
| Markup | Meaning |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `/*WIKI syntax expression*/` | A comment. The expression inside is not processed by the WIKI markup parser. |
|
|
82
|
+
| `/**Invisible Comment**/` | A comment. This comment can only be seen by screen readers or when editing the page. |
|
|
83
|
+
| `// invisible comment which needs no white space` | |
|
|
84
|
+
| `''emphasis''` | Two single quotes. Tells the parser to print the content in *italic letters*. |
|
|
85
|
+
| `'''strong'''` | Three single quotes. Tells the parser to print the content in **bold letters**. |
|
|
86
|
+
| `___underline___` | Three underscores. Tells the parser to print the content in <u>underline letters</u>. |
|
|
87
|
+
| `---strike through---` | Three dashes. Tells the parser to print the content in ~~strike through~~. |
|
|
88
|
+
| `%%monospaced%%` | to print text `monospaced` (typewriter). |
|
|
89
|
+
| `!!annotation!!` | This element is excluded from export. With this element the users can put comments in the text, to further ease collaboration. This should not be used as versioning instrument. |
|
|
90
|
+
|
|
91
|
+
A difference to MediaWiki markup is introduced by making it possible to create indented text blocks. This is especially useful when one has to add long quotes to his documents. An indented paragraph is denoted by two leading **>** characters (`>>`).
|
|
92
|
+
|
|
93
|
+
Newlines are handled differently like they are handled in MediaWiki. Every newline has an impact on the result. To create a paragraph one can enter two newlines. More than two lines create a bigger space (although this space is not growing with more then three newlines).
|
|
94
|
+
|
|
95
|
+
### Lists
|
|
96
|
+
|
|
97
|
+
Lists basically work like in MediaWiki with the exception that a newline is possible. A list is terminated when two newlines (a paragraph) occur.
|
|
98
|
+
|
|
99
|
+
| Markup | Meaning |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `* a star` | A star at the beginning of a line starts a normal bullet-list. The list continues until a paragraph or a heading is found. |
|
|
102
|
+
| `** two stars` | Two stars at the beginning of a line start a sub-list. It can only exist inside a bullet-list or numbered list. |
|
|
103
|
+
| `*** three stars` | Three stars at the beginning of a line start a sub-sub-list. It can only exist inside a bullet-sub-list or numbered sub-list. |
|
|
104
|
+
| `# a hash` | A hash symbol at the beginning of a line starts a numbered list. The list continues until a paragraph or a heading is found. |
|
|
105
|
+
| `## two hashes` | Two hash symbols at the beginning of a line start a numbered sub-list. It can only exist inside a bullet-list or numbered list. |
|
|
106
|
+
| `### three hashes` | Three hash symbols at the beginning of a line start a numbered sub-sub-list. It can only exist inside a bullet-sub-list or numbered sub-list. |
|
|
107
|
+
|
|
108
|
+
As already obvious these two list types can also be interspersed. The last list type is a definition-list. It is used by writing
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
;definition: description
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
starting at the beginning of a line. This type comes in very handy when defining concepts or terms.
|
|
115
|
+
|
|
116
|
+
Example for a bullet-list:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
* A: Something sub-bullets have to be added:
|
|
120
|
+
** Sub 1
|
|
121
|
+
More stuff in Sub one
|
|
122
|
+
** Sub 1
|
|
123
|
+
~ A: continued
|
|
124
|
+
More A: stuff
|
|
125
|
+
* B: More stuff
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
To realize the *A: continued* which is obviously not possible with only the star syntax, we added **~** as a way to terminate sub-bullet-lists.
|
|
129
|
+
|
|
130
|
+
#### Continuing a numbered list
|
|
131
|
+
|
|
132
|
+
To continue a numbered list write a hash symbol at the beginning of a line followed by the keyword "counter:" and the number of the next bullet point.
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
#counter: 3 /* causes starting the numbered list with bullet point number three */
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
This is useful if you would like to insert a picture within a bullet point - what terminates the list automatically, because it indicates a paragraph.
|
|
139
|
+
|
|
140
|
+
Examples:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
Starting a new list, because a paragraph follows point two...
|
|
144
|
+
# point one
|
|
145
|
+
# point two
|
|
146
|
+
|
|
147
|
+
# point next
|
|
148
|
+
# point after the next
|
|
149
|
+
|
|
150
|
+
Continuing the previous list by using the defined syntax...
|
|
151
|
+
# point one
|
|
152
|
+
# point two
|
|
153
|
+
|
|
154
|
+
#counter: 3
|
|
155
|
+
# point next
|
|
156
|
+
# point after the next
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Literature references
|
|
160
|
+
|
|
161
|
+
A custom addition that to my best of knowledge only exist in Διδακτικη are the literature references. They are inspired by the way LaTeX handles them. A reference can be placed on an arbitrary page in the WIKI, by using the
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
[ref:identifier] reference text
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
syntax (starting in a new line). This reference can than be cited everywhere in the WIKI by using
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
[cite:identifier]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The export-system also assists this system by collecting the references from the whole WIKI and appending it to the exported document. So its wise to put all references to a central document that is not included in the export.
|
|
174
|
+
|
|
175
|
+
### Images
|
|
176
|
+
|
|
177
|
+
Inserting images is modelled after adding attachments to an email. Images can be added to a document and then be used. Images from other documents are not (!) usable- Adding the images to the document is as easy as uploading them. When uploading a size restriction can also be applied. If an image exceeds this size, it is resized to meet the restriction. This is also useful for vector graphic images, as they often do not contain size information. By using [ImageMagick](http://www.imagemagick.org) it is possible to throw over 90 major formats at the system. Images can be used inside the page by writing
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
[image:name|description]
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### Referencing
|
|
184
|
+
|
|
185
|
+
Every image on the page can then be referenced inside the text by using
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
[fig:name]
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Both, cites and references to images are clickable. For images the page scrolls to the image, for references one jumps to the page with the reference.
|
|
192
|
+
|
|
193
|
+
#### Alignment
|
|
194
|
+
|
|
195
|
+
By default images are displayed centred. To change the position you have the following possibilities:
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
[image-left:picture.png|description] // image = left, text = below the image
|
|
199
|
+
[image-float-left:picture.png|description] // image = left, text = right next to the image
|
|
200
|
+
[image-float-right:picture.png|description] // image = right, text = left next to the image
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Tables
|
|
204
|
+
|
|
205
|
+
Tables also differ from MediaWiki. A table is created by starting a line with **"|| "**. At the end of each row the user has to put also a **"||"**. Each row can span multiple lines in the input box. Each cell has to be separated by another **" || "**. By default the text is aligned left. This can be changed by using **"c"**, **"l"** or **"r"** directly after **"||"**. With the modifier **"h"** you can define a header line.
|
|
206
|
+
For example:
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
||h Name ||hc Age ||h Sex ||
|
|
210
|
+
|| Jürgen ||c 29 || male ||
|
|
211
|
+
|| Axel ||c 27 || male ||
|
|
212
|
+
|| Monika ||c 22 || female ||
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Furthermore the following vertical alignements inside cells are possible:
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
VT vertical top
|
|
219
|
+
VB vertical bottom
|
|
220
|
+
VC vertical center
|
|
221
|
+
V_ vertical baseline
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
If you write
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
NW no whitespace wrapping
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
lines are not wrapped when spaces are in a cell. This is an advantage when setting math formulas within cells.
|
|
231
|
+
|
|
232
|
+
For normal cells you can also use the modifiers **"G"** (Good), **"B"** (Bad) and **"N"** (Neutral). A table that contains a list (and a description that can be referenced with `[tab:table1]`) can be created like this:
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
||-
|
|
236
|
+
* Test 1
|
|
237
|
+
* Test 2
|
|
238
|
+
||B Hello ||
|
|
239
|
+
[border][table1:Table Description]
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
#### Color
|
|
243
|
+
|
|
244
|
+
| Modifier | Comment |
|
|
245
|
+
|---|---|
|
|
246
|
+
| `G` | Good |
|
|
247
|
+
| `B` | Bad |
|
|
248
|
+
| `N` | Neutral |
|
|
249
|
+
| `CA` | Color A |
|
|
250
|
+
| `CB` | Color B |
|
|
251
|
+
| `CC` | Color C |
|
|
252
|
+
| `CD` | Color D |
|
|
253
|
+
| `CE` | Color E |
|
|
254
|
+
| `CF` | Color F |
|
|
255
|
+
|
|
256
|
+
#### Dark Borders
|
|
257
|
+
|
|
258
|
+
| Dark Border | Comment |
|
|
259
|
+
|---|---|
|
|
260
|
+
| `BO` | All sides |
|
|
261
|
+
| `BL` | Left |
|
|
262
|
+
| `BR` | Right |
|
|
263
|
+
| `BT` | Top |
|
|
264
|
+
| `BB` | Bottom |
|
|
265
|
+
|
|
266
|
+
#### Column width
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
||hS Small ||hM Medium ||hL Large ||hXL X-Large ||hXXL XX-Large||
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
#### Multi-Column
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
||c2 two columns || second column? ||
|
|
276
|
+
|| 1 || 2 || 3 ||
|
|
277
|
+
[border]
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### Multi-Row
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
||r2 two rows || 2 || 3 ||
|
|
284
|
+
|| 1 || 2 || 3 ||
|
|
285
|
+
[border]
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
|| 1 ||r2 X || 3 ||
|
|
290
|
+
|| 1 || 2 || 3 ||
|
|
291
|
+
[border]
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
```
|
|
295
|
+
|| 1 ||r4 X || 3 ||
|
|
296
|
+
|| 1 || 2 || 3 ||
|
|
297
|
+
|| 1 || 2 || 3 ||
|
|
298
|
+
|| 1 || 2 || 3 ||
|
|
299
|
+
|| 1 || 2 || 3 ||
|
|
300
|
+
[border]
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
#### Alignment
|
|
304
|
+
|
|
305
|
+
Tables are displayed centred by default, when they have a description. Otherwise you can use the markup `[center]` (combined with the markup `[border]` or alone) to change the position from left hand side to the middle.
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
|| content ||
|
|
309
|
+
[table1:Table Description]
|
|
310
|
+
|
|
311
|
+
|| content ||
|
|
312
|
+
[border][center]
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Monospaced Text
|
|
316
|
+
|
|
317
|
+
There is also the ability to add text that is printed in monospaced letters. This is especially useful when one wants to add source code to a document. Every line with a space as the first letter is printed monospaced, multiple successive lines following this rule are interpreted as block. Example:
|
|
318
|
+
|
|
319
|
+
```
|
|
320
|
+
people.each do |person|
|
|
321
|
+
puts person + ' has an IQ of ' + rand(200)
|
|
322
|
+
end
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Mathematical Formulas
|
|
326
|
+
|
|
327
|
+
Διδακτικη has support for mathematical formulas through LaTeX syntax. They are turned into MathML by [Temml](https://temml.org) in the browser, all current browsers display MathML. The page Formulas, in every new wiki, shows the supported commands. There is support for both, inline (denoted by `$`)
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
Use a formula ($R_{2}=(\left\lbrace A,B,C,D,E,F,G \right\rbrace, F_{2})$) inside a sentence.
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
and block formulas (denoted by `\[` and `\]`) put on a single line
|
|
334
|
+
|
|
335
|
+
```
|
|
336
|
+
\[\sum_{n=1}^\infty \frac{1}{n} = \infty\]
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
It is also possible to reference block formulas by giving them a label, like in the following example:
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
\[my sum:\sum_{n=1}^\infty \frac{1}{n} = \infty\]
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
You can now reference it in the text by writing
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
Yada yada [formula:my sum] yada shebang.
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Without JavaScript the formulas are shown as their LaTeX code.
|
|
352
|
+
|
|
353
|
+
[Temml](https://temml.org) is written by Ron Kok and published under the MIT license ([source code](https://github.com/ronkok/Temml)). It started as a fork of [KaTeX](https://katex.org). The engine ships an unchanged copy (version 0.14.0) in `static/js/temml/`, together with its license.
|
|
354
|
+
|
|
355
|
+
How it works: redel puts every formula, with its delimiters, into a `<span class="formula">`. The engine (`static/js/engine.js`) loads Temml only for pages that contain one, and replaces the TeX with MathML. Browsers without MathML keep the TeX.
|
|
356
|
+
|
|
357
|
+
### Table of Contents
|
|
358
|
+
|
|
359
|
+
On every Page you can insert a table of contents for inter-page navigation. You can jump to all headings.
|
|
360
|
+
|
|
361
|
+
```
|
|
362
|
+
[toc]
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
or
|
|
366
|
+
|
|
367
|
+
```
|
|
368
|
+
[table of contents]
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
### Compartments
|
|
372
|
+
|
|
373
|
+
First of all the corresponding Διδακτικη wiki-service on the *admin* page has to be configured (only *managers* may do this) to allow *group*, *team* or *person* oriented wikis.
|
|
374
|
+
There are three values for each type: **no**, **public** and **private**.
|
|
375
|
+
|
|
376
|
+
* **no**: no wikis for either groups, teams or persons.
|
|
377
|
+
* **public**: wikis are public readable, only the owner(s) (*group*, *team* or *person*) are able to edit the corresponding pages.
|
|
378
|
+
* **private**: only the owner(s) are able to read and edit the corresponding wiki.
|
|
379
|
+
|
|
380
|
+
Afterwards you may insert the following compartment commands on every page of your Διδακτικη:
|
|
381
|
+
|
|
382
|
+
```
|
|
383
|
+
[user-compartments] all persons
|
|
384
|
+
[user-compartments:g1] all persons in group 1
|
|
385
|
+
[team-compartments] every group and every team
|
|
386
|
+
[team-compartments:g1] every team of group 1
|
|
387
|
+
[group-compartments]
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
A must: if there is more than one possible group, the group has to be specified in team compartments.
|
|
391
|
+
Exception: admins are not included.
|
|
392
|
+
|
|
393
|
+
### Print/Export
|
|
394
|
+
|
|
395
|
+
You can establish an HTML version of particular CEWebS pages. List all pages you want to include in the HTML version and add
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
[export-html-index:/CEWebS/static/styles/content.css]
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Example:
|
|
402
|
+
|
|
403
|
+
```
|
|
404
|
+
[export-html-index:/CEWebS/static/styles/content.css]
|
|
405
|
+
[[Course Goals]]
|
|
406
|
+
[[Course Schedule]]
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
The parameter has to be a link to a css that will be included in the resulting page. To export the current page you can write:
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
[export-html:/CEWebS/static/styles/content.css]
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
A second export format is LaTeX. The result is a ZIP File with all included pages as individual .tex documents plus an Image directory. The syntax is consistent with the HTML export:
|
|
416
|
+
|
|
417
|
+
* `[export-latex-index]` for exporting all sub-pages.
|
|
418
|
+
* `[export-latex]` for exporting the current page.
|
|
419
|
+
|
|
13
420
|
## License
|
|
14
421
|
|
|
15
422
|
GPL-3.0-or-later, see LICENSE.GPL.
|
data/cewebs-didaktiki.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = "cewebs-didaktiki"
|
|
3
|
-
s.version = "3.0.
|
|
3
|
+
s.version = "3.0.3"
|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
|
5
5
|
s.license = "GPL-3.0-or-later"
|
|
6
6
|
s.summary = "Wiki for CEWebS"
|
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
|
20
20
|
s.email = 'juergen.mangler@gmail.com'
|
|
21
21
|
s.homepage = 'http://www.cewebs.org'
|
|
22
22
|
|
|
23
|
-
s.add_runtime_dependency 'cewebs-servicesbase', '~> 3.0'
|
|
23
|
+
s.add_runtime_dependency 'cewebs-servicesbase', '~> 3.0', '>= 3.0.2'
|
|
24
24
|
s.add_runtime_dependency 'diff-lcs', '~> 1.6'
|
|
25
25
|
s.add_runtime_dependency 'mimemagic', '~> 0.4'
|
|
26
26
|
end
|
|
@@ -58,7 +58,8 @@ module Didaktiki
|
|
|
58
58
|
when 'versions'
|
|
59
59
|
CEWebS::Prepare.new(:cachekey => key.call(c.what,r.user), :authenticate => true)
|
|
60
60
|
when 'pages'
|
|
61
|
-
|
|
61
|
+
# the page it was opened from, for [back]
|
|
62
|
+
CEWebS::Prepare.new(:cachekey => key.call(r.user,c.name('what')), :authenticate => true)
|
|
62
63
|
when 'latex', 'html', 'edit', 'save', 'versionshow', 'diff', 'ascurrent', 'image', 'file', 'delete', 'discuss', 'exportwiki'
|
|
63
64
|
CEWebS::Prepare.new(:cachekey => '', :authenticate => true)
|
|
64
65
|
when 'aresource'
|
|
@@ -85,7 +86,7 @@ module Didaktiki
|
|
|
85
86
|
CEWebS::Document.new(:content => view.render(:backlinks), :modified => modified)
|
|
86
87
|
when 'pages'
|
|
87
88
|
modified = r.newer(*c.files(File.join(c.path,'linking.xml'))) or return nil
|
|
88
|
-
CEWebS::Document.new(:content => view.render(:pages), :modified => modified)
|
|
89
|
+
CEWebS::Document.new(:content => view.render(:pages), :modified => modified, :access => c.name('what') == '' ? [] : [back(c)])
|
|
89
90
|
when 'versions'
|
|
90
91
|
return message(c,'accessdenied') unless c.access.edit?
|
|
91
92
|
modified = r.newer(*c.files(c.storage.cpath + 'revisions.xml')) or return nil
|
|
@@ -158,7 +159,7 @@ module Didaktiki
|
|
|
158
159
|
meta = page.meta
|
|
159
160
|
end
|
|
160
161
|
content = c.xhtml(text,s,s.current,meta['discussion'])[0]
|
|
161
|
-
access = [{ :href => c.link('pages'
|
|
162
|
+
access = [{ :href => c.link('pages'), :text => c.strings.sfind('pages') }]
|
|
162
163
|
access << { :href => c.link('versions'), :text => c.strings.sfind('versions') } unless s.new?
|
|
163
164
|
access << { :href => c.link('edit'), :text => c.strings.sfind('edit') }
|
|
164
165
|
CEWebS::Document.new(
|
|
@@ -237,10 +238,13 @@ module Didaktiki
|
|
|
237
238
|
file = upload(c) or return
|
|
238
239
|
factor = 10 - c.r.raw('max').to_i.clamp(0,7)
|
|
239
240
|
width, height = %w{maxwidth maxheight}.map { |m| c.custom.find("number(/custom/object/@#{m})").to_i }
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
width = width * factor / 10
|
|
242
|
+
# twice the pixels of the size it is shown at, so it is sharp on high resolution screens
|
|
243
|
+
png = ReDel::Image::shrink(file.data,width * 2,height * 2) or return
|
|
244
|
+
pw, ph = ReDel::Image::size(png)
|
|
245
|
+
scale = [1.0, width.to_f / pw, height.to_f / ph].min
|
|
242
246
|
c.storage.add_object(file.value,file.data,nil,:images_orig)
|
|
243
|
-
c.storage.add_object(file.value,png,{ 'width' =>
|
|
247
|
+
c.storage.add_object(file.value,png,{ 'width' => (pw * scale).round, 'height' => (ph * scale).round },:images)
|
|
244
248
|
end #}}}
|
|
245
249
|
|
|
246
250
|
def save(c,text,eid,comment,meta,base,name) #{{{
|
|
@@ -89,6 +89,7 @@ module Wiki
|
|
|
89
89
|
P_PINCLUDE = Pattern.new("P_PINCLUDE", /\[include:[\w-]+,[\w-]+/, /\](.*?)(\n|\z)/, true)
|
|
90
90
|
P_INCLUDE = Pattern.new("P_INCLUDE", /\[include:[\w-]+,[\w-]+/, /\]/)
|
|
91
91
|
P_STREAM = Pattern.new("P_STREAM", /\[stream:/, /\]/)
|
|
92
|
+
P_ABBR = Pattern.new("P_ABBR", /\[abbr:/, LINKEND)
|
|
92
93
|
P_COMPARTMENT = Pattern.new("P_COMPARTMENT", /\[compartment:/, LINKEND)
|
|
93
94
|
P_USER_COMPARTMENTS = Pattern.new("P_USER_COMPARTMENTS", /\[user-compartments(:g[\d-]+)?\]/, /(.*?)(\n|\z)/, true)
|
|
94
95
|
P_TEAM_COMPARTMENTS = Pattern.new("P_TEAM_COMPARTMENTS", /\[team-compartments(:g[\d-]+)?\]/, /(.*?)(\n|\z)/, true)
|
|
@@ -114,23 +115,23 @@ module Wiki
|
|
|
114
115
|
GP_OL2 = [ P_LO2 ]
|
|
115
116
|
GP_OL3 = [ P_LO3 ]
|
|
116
117
|
GP_DL = [ P_LD ]
|
|
117
|
-
GP_LD = [ P_RAWHIDE, P_RAW, P_UL1, P_OL1, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
118
|
-
GP_LU1 = [ P_RAWHIDE, P_RAW, P_UL2, P_OL2, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
119
|
-
GP_LU2 = [ P_RAWHIDE, P_RAW, P_UL3, P_OL3, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
120
|
-
GP_LU3 = [ P_RAWHIDE, P_RAW, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
121
|
-
GP_LO1 = [ P_RAWHIDE, P_RAW, P_UL2, P_OL2, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
122
|
-
GP_LO2 = [ P_RAWHIDE, P_RAW, P_UL3, P_OL3, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
123
|
-
GP_LO3 = [ P_RAWHIDE, P_RAW, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
124
|
-
GP_TD = [ P_IMAGE, P_RAWHIDE, P_RAW, P_UL1, P_OL1, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
125
|
-
GP_P = [ P_RAWHIDE, P_RAW, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
126
|
-
GP_BLOCKQUOTE = [ P_RAWHIDE, P_RAW, P_UL1, P_UL1, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
127
|
-
GP_STRONG = [ P_RAWHIDE, P_RAW, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
128
|
-
GP_TT = [ P_RAWHIDE, P_RAW, P_STRONG, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
129
|
-
GP_UNDERLINE = [ P_RAWHIDE, P_RAW, P_STRONG, P_TT, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
130
|
-
GP_STRIKEOUT = [ P_RAWHIDE, P_RAW, P_STRONG, P_TT, P_UNDERLINE, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
131
|
-
GP_EM = [ P_RAWHIDE, P_RAW, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
132
|
-
GP_COMMENT = [ P_RAWHIDE, P_RAW, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
133
|
-
GP_REF = [ P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_FILE, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
118
|
+
GP_LD = [ P_RAWHIDE, P_RAW, P_UL1, P_OL1, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
119
|
+
GP_LU1 = [ P_RAWHIDE, P_RAW, P_UL2, P_OL2, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
120
|
+
GP_LU2 = [ P_RAWHIDE, P_RAW, P_UL3, P_OL3, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
121
|
+
GP_LU3 = [ P_RAWHIDE, P_RAW, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
122
|
+
GP_LO1 = [ P_RAWHIDE, P_RAW, P_UL2, P_OL2, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
123
|
+
GP_LO2 = [ P_RAWHIDE, P_RAW, P_UL3, P_OL3, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
124
|
+
GP_LO3 = [ P_RAWHIDE, P_RAW, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
125
|
+
GP_TD = [ P_IMAGE, P_RAWHIDE, P_RAW, P_UL1, P_OL1, P_P, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
126
|
+
GP_P = [ P_RAWHIDE, P_RAW, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
127
|
+
GP_BLOCKQUOTE = [ P_RAWHIDE, P_RAW, P_UL1, P_UL1, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
128
|
+
GP_STRONG = [ P_RAWHIDE, P_RAW, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
129
|
+
GP_TT = [ P_RAWHIDE, P_RAW, P_STRONG, P_UNDERLINE, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
130
|
+
GP_UNDERLINE = [ P_RAWHIDE, P_RAW, P_STRONG, P_TT, P_STRIKEOUT, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
131
|
+
GP_STRIKEOUT = [ P_RAWHIDE, P_RAW, P_STRONG, P_TT, P_UNDERLINE, P_EM, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
132
|
+
GP_EM = [ P_RAWHIDE, P_RAW, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_COMMENT, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
133
|
+
GP_COMMENT = [ P_RAWHIDE, P_RAW, P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_CITE, P_GRAPH, P_FORMULA, P_FORMULA1, P_FILE, P_FIGURE, P_TAB, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
134
|
+
GP_REF = [ P_STRONG, P_TT, P_UNDERLINE, P_STRIKEOUT, P_EM, P_FILE, P_LINK, P_CHARS, P_COMPARTMENT, P_INCLUDE, P_STREAM, P_ABBR, P_LINK_WEB, P_LINK_MAIL, P_LINK_CEWEBS ]
|
|
134
135
|
|
|
135
136
|
### Optional functions called when a pattern occurs (m + patternname) ####
|
|
136
137
|
|
|
@@ -236,6 +237,13 @@ module Wiki
|
|
|
236
237
|
LINK(ts,ti,te)
|
|
237
238
|
""
|
|
238
239
|
end
|
|
240
|
+
# [abbr:VSM|Value Stream Mapping]: shows VSM, explains it on hover
|
|
241
|
+
def mP_ABBR(ts,ti,te)
|
|
242
|
+
comp = ti.split(/\|/,2)
|
|
243
|
+
raise ReDel::TagError if comp.length < 2
|
|
244
|
+
@tree.last.data = comp[1]
|
|
245
|
+
comp[0]
|
|
246
|
+
end
|
|
239
247
|
def mP_COMPARTMENT(ts,ti,te)
|
|
240
248
|
LINK(ts,ti,te)
|
|
241
249
|
end
|
|
@@ -309,7 +317,8 @@ module Wiki
|
|
|
309
317
|
ti
|
|
310
318
|
end
|
|
311
319
|
def mP_CODE(ts,ti,te)
|
|
312
|
-
|
|
320
|
+
# the space of the first line is already consumed by the pattern (ts)
|
|
321
|
+
temp = ti.gsub(/\n /,"\n")
|
|
313
322
|
@tree.last.data = { :language => "", :label => "", :caption => "", :data => "" }
|
|
314
323
|
temp.gsub!(/^\[language:([^\]]+)\][ \t]*\n/) do |m|
|
|
315
324
|
@tree.last.data[:language] = $1
|
|
@@ -134,6 +134,8 @@ module Wiki
|
|
|
134
134
|
|
|
135
135
|
def mOP_LINK_WEB(data) "\\href{#{data}}{"; end
|
|
136
136
|
def mCP_LINK_WEB(data) "}"; end
|
|
137
|
+
# no hover in a pdf, so the explanation follows in brackets, escaped like any text
|
|
138
|
+
def mCP_ABBR(data) " (#{string(nil,1,[nil],data)})"; end
|
|
137
139
|
|
|
138
140
|
def mOP_FILE(data) ""; end
|
|
139
141
|
def mCP_FILE(data) ""; end
|
|
@@ -218,10 +218,10 @@ module Wiki
|
|
|
218
218
|
end
|
|
219
219
|
end #}}}
|
|
220
220
|
def P_LINK_MAIL(data,&blk) external("mailto:#{data}",&blk); end
|
|
221
|
-
def P_LINK_WEB(data,&blk) external(data,&blk); end
|
|
222
|
-
def external(link) #{{{
|
|
221
|
+
def P_LINK_WEB(data,&blk) external(data,:target => '_blank', :rel => 'noopener',&blk); end
|
|
222
|
+
def external(link,attrs={}) #{{{
|
|
223
223
|
text_ '«'
|
|
224
|
-
a_(:href => link) { yield }
|
|
224
|
+
a_({:href => link}.merge(attrs)) { yield }
|
|
225
225
|
text_ '»'
|
|
226
226
|
end #}}}
|
|
227
227
|
def P_FILE(data) #{{{
|
|
@@ -317,6 +317,7 @@ module Wiki
|
|
|
317
317
|
def P_STREAM(data) #{{{
|
|
318
318
|
video_ :id => "stream_#{@stream += 1}", :height => 406, :width => 720, :controls => 'controls', :src => data
|
|
319
319
|
end #}}}
|
|
320
|
+
def P_ABBR(data) abbr_(:title => data) { yield }; end
|
|
320
321
|
|
|
321
322
|
def P_IMAGE(data,node) #{{{
|
|
322
323
|
name, caption = data[1]
|