deplate 0.7.3 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS.TXT +3 -0
- data/CHANGES.TXT +248 -175
- data/LICENSE.TXT +0 -0
- data/NEWS.TXT +28 -24
- data/README.TXT +0 -0
- data/TODO.TXT +174 -88
- data/VERSION.TXT +1 -1
- data/bin/deplate +0 -0
- data/bin/deplate.bat +0 -0
- data/etc/deplate.ini +91 -3
- data/lib/action_view/helpers/deplate.rb +45 -0
- data/lib/deplate.rb +6 -1
- data/lib/deplate/abstract-class.rb +0 -0
- data/lib/deplate/bib.rb +576 -0
- data/lib/deplate/builtin.rb +0 -0
- data/lib/deplate/cache.rb +55 -5
- data/lib/deplate/commands.rb +346 -183
- data/lib/deplate/common.rb +209 -48
- data/lib/deplate/converter.rb +12 -6
- data/lib/deplate/core.rb +777 -378
- data/lib/deplate/counters.rb +254 -0
- data/lib/deplate/css/article.css +4 -3
- data/lib/deplate/css/deplate.css +121 -5
- data/lib/deplate/css/heading-navbar.css +0 -0
- data/lib/deplate/css/layout-deplate-print.css +0 -0
- data/lib/deplate/css/layout-deplate.css +0 -0
- data/lib/deplate/css/sans-serif.css +0 -0
- data/lib/deplate/css/serif-e.css +0 -0
- data/lib/deplate/css/serif-rel.css +0 -0
- data/lib/deplate/css/serif.css +9 -3
- data/lib/deplate/css/slides.css +0 -0
- data/lib/deplate/css/tabbar-left.css +0 -0
- data/lib/deplate/css/tabbar-right-ie.css +3 -9
- data/lib/deplate/css/tabbar-right.css +51 -18
- data/lib/deplate/css/tabbar-top.css +7 -1
- data/lib/deplate/css/tabbar.css +0 -0
- data/lib/deplate/css/text-sans-serif.css +0 -0
- data/lib/deplate/css/text-serif.css +0 -0
- data/lib/deplate/define.rb +183 -177
- data/lib/deplate/deplate-string.rb +82 -0
- data/lib/deplate/docbook.rb +236 -128
- data/lib/deplate/elements.rb +584 -417
- data/lib/deplate/etc.rb +163 -101
- data/lib/deplate/external.rb +42 -11
- data/lib/deplate/fmt/dbk-article-4.1.2.rb +0 -0
- data/lib/deplate/fmt/dbk-article.rb +0 -0
- data/lib/deplate/fmt/dbk-book.rb +0 -0
- data/lib/deplate/fmt/dbk-ref.rb +3 -3
- data/lib/deplate/fmt/dbk-slides.rb +0 -0
- data/lib/deplate/fmt/dbk-snippet.rb +0 -0
- data/lib/deplate/fmt/html-snippet.rb +0 -0
- data/lib/deplate/fmt/html.rb +783 -550
- data/lib/deplate/fmt/htmlsite.rb +192 -199
- data/lib/deplate/fmt/htmlslides.rb +0 -0
- data/lib/deplate/fmt/htmlwebsite.rb +3 -3
- data/lib/deplate/fmt/latex-snippet.rb +0 -0
- data/lib/deplate/fmt/latex.rb +242 -83
- data/lib/deplate/fmt/null.rb +32 -0
- data/lib/deplate/fmt/php.rb +4 -4
- data/lib/deplate/fmt/phpsite.rb +6 -5
- data/lib/deplate/fmt/plain.rb +160 -106
- data/lib/deplate/fmt/template.rb +0 -0
- data/lib/deplate/fmt/xhtml10t.rb +0 -0
- data/lib/deplate/formatter-snippet.rb +0 -0
- data/lib/deplate/formatter.rb +613 -301
- data/lib/deplate/input.rb +202 -142
- data/lib/deplate/input/deplate-headings.rb +4 -6
- data/lib/deplate/input/deplate-restricted.rb +15 -9
- data/lib/deplate/input/deplate.rb +2 -4
- data/lib/deplate/input/rdoc.rb +39 -38
- data/lib/deplate/input/template.rb +0 -0
- data/lib/deplate/lib/Makefile.config +29 -0
- data/lib/deplate/lib/latex/deplate.sty +54 -0
- data/lib/deplate/lib/latex/highlight-extra.sty +0 -0
- data/lib/deplate/lib/latex/highlight-typical.sty +0 -0
- data/lib/deplate/lib/php/page-comment.inc.php +216 -0
- data/lib/deplate/lib/tabmenu.js +0 -0
- data/lib/deplate/locale/de.latin1 +155 -17
- data/lib/deplate/locale/ru.koi8-r +0 -0
- data/lib/deplate/locale/zh_cn.gb2312 +0 -0
- data/lib/deplate/macros.rb +133 -82
- data/lib/deplate/messages.rb +6 -4
- data/lib/deplate/metadata.rb +0 -0
- data/lib/deplate/metadata/marshal.rb +0 -0
- data/lib/deplate/metadata/xml.rb +0 -0
- data/lib/deplate/metadata/yaml.rb +0 -0
- data/lib/deplate/mod/anyword.rb +3 -3
- data/lib/deplate/mod/babelfish.rb +4 -4
- data/lib/deplate/mod/code-gvim.rb +8 -4
- data/lib/deplate/mod/code-highlight.rb +3 -3
- data/lib/deplate/mod/colored-log.rb +0 -0
- data/lib/deplate/mod/de.rb +2 -2
- data/lib/deplate/mod/en.rb +0 -0
- data/lib/deplate/mod/endnotes.rb +0 -0
- data/lib/deplate/mod/fr.rb +0 -0
- data/lib/deplate/mod/html-asciimath.rb +0 -0
- data/lib/deplate/mod/html-deplate-button.rb +0 -0
- data/lib/deplate/mod/html-headings-navbar.rb +5 -13
- data/lib/deplate/mod/html-jsmath.rb +39 -0
- data/lib/deplate/mod/html-obfuscate-email.rb +3 -3
- data/lib/deplate/mod/html-sidebar.rb +0 -0
- data/lib/deplate/mod/htmlslides-navbar-fh.rb +3 -3
- data/lib/deplate/mod/iconv.rb +0 -0
- data/lib/deplate/mod/imgurl.rb +4 -4
- data/lib/deplate/mod/inlatex-compound.rb +7 -10
- data/lib/deplate/mod/koma.rb +0 -0
- data/lib/deplate/mod/latex-emph-table-head.rb +0 -0
- data/lib/deplate/mod/latex-styles.rb +7 -4
- data/lib/deplate/mod/latex-verbatim-small.rb +0 -0
- data/lib/deplate/mod/makefile.rb +23 -7
- data/lib/deplate/mod/mark-external-urls.rb +3 -3
- data/lib/deplate/mod/markup-1-warn.rb +10 -10
- data/lib/deplate/mod/markup-1.rb +0 -0
- data/lib/deplate/mod/navbar-png.rb +24 -8
- data/lib/deplate/mod/noindent.rb +0 -0
- data/lib/deplate/mod/numpara.rb +0 -0
- data/lib/deplate/mod/particle-math.rb +4 -4
- data/lib/deplate/mod/php-extra.rb +46 -6
- data/lib/deplate/mod/pstoedit.rb +0 -0
- data/lib/deplate/mod/recode.rb +0 -0
- data/lib/deplate/mod/ru_koi8-r.rb +0 -0
- data/lib/deplate/mod/smart-dash.rb +26 -0
- data/lib/deplate/mod/smiley.rb +69 -7
- data/lib/deplate/mod/soffice.rb +0 -0
- data/lib/deplate/mod/symbols-latin1.rb +14 -23
- data/lib/deplate/mod/symbols-od-utf-8.rb +5 -3
- data/lib/deplate/mod/symbols-plain.rb +5 -35
- data/lib/deplate/mod/symbols-sgml.rb +8 -9
- data/lib/deplate/mod/symbols-utf-8.rb +8 -9
- data/lib/deplate/mod/symbols-xml.rb +5 -9
- data/lib/deplate/mod/syntax-region-alt.rb +5 -5
- data/lib/deplate/mod/utf8.rb +0 -0
- data/lib/deplate/mod/validate-html.rb +0 -0
- data/lib/deplate/mod/xmlrpc.rb +0 -0
- data/lib/deplate/mod/zh-cn-autospace.rb +18 -20
- data/lib/deplate/mod/zh-cn.rb +4 -6
- data/lib/deplate/nukumi2.rb +71 -0
- data/lib/deplate/once-method.rb +0 -0
- data/lib/deplate/output.rb +19 -21
- data/lib/deplate/particles.rb +178 -116
- data/lib/deplate/regions.rb +99 -58
- data/lib/deplate/skeletons.rb +122 -0
- data/lib/deplate/structured.rb +164 -106
- data/lib/deplate/template.rb +67 -43
- data/lib/deplate/templates/html-doc.html +0 -0
- data/lib/deplate/templates/html-left-tabbar-js.html +0 -0
- data/lib/deplate/templates/html-left-tabbar.html +0 -0
- data/lib/deplate/templates/html-tabbar-right-pcomments.php +22 -0
- data/lib/deplate/templates/html-tabbar-right-step.html +24 -0
- data/lib/deplate/templates/html-tabbar-right-table.html +0 -0
- data/lib/deplate/templates/html-tabbar-right.html +2 -4
- data/lib/deplate/templates/html-tabbar-top.html +0 -9
- data/lib/deplate/templates/html-tabbar.html +0 -0
- data/lib/deplate/variables.rb +127 -0
- data/lib/deplate/wiki-markup.rb +99 -33
- data/lib/deplate/xml.rb +18 -18
- data/lib/deplate/zh-cn.rb +0 -0
- data/lib/ps2ppm.rb +0 -0
- data/man/man1/deplate.1 +564 -474
- metadata +201 -186
data/lib/deplate/lib/tabmenu.js
CHANGED
File without changes
|
@@ -19,8 +19,8 @@ Abbildungsverzeichnis
|
|
19
19
|
List of Tables
|
20
20
|
Tabellenverzeichnis
|
21
21
|
|
22
|
-
p
|
23
|
-
S
|
22
|
+
p.\
|
23
|
+
S.\
|
24
24
|
|
25
25
|
see
|
26
26
|
siehe
|
@@ -79,11 +79,71 @@ ob der Verweis tats
|
|
79
79
|
|
80
80
|
|
81
81
|
|
82
|
+
################################## Bibliography
|
83
|
+
|
84
|
+
Ed.
|
85
|
+
Hg.
|
86
|
+
|
87
|
+
Eds.
|
88
|
+
Hg.
|
89
|
+
|
90
|
+
Edition
|
91
|
+
Auflage
|
92
|
+
|
93
|
+
Chapter
|
94
|
+
Kapitel
|
95
|
+
|
96
|
+
Available online at:
|
97
|
+
Online verf�gbar unter:
|
98
|
+
|
99
|
+
Available online at (%s):
|
100
|
+
Online verf�gbar unter (letzter Zugriff am: %s):
|
101
|
+
|
102
|
+
January
|
103
|
+
Januar
|
104
|
+
|
105
|
+
February
|
106
|
+
Februar
|
107
|
+
|
108
|
+
March
|
109
|
+
M�rz
|
110
|
+
|
111
|
+
April
|
112
|
+
April
|
113
|
+
|
114
|
+
May
|
115
|
+
Mai
|
116
|
+
|
117
|
+
June
|
118
|
+
Juni
|
119
|
+
|
120
|
+
July
|
121
|
+
Juli
|
122
|
+
|
123
|
+
August
|
124
|
+
August
|
125
|
+
|
126
|
+
September
|
127
|
+
September
|
128
|
+
|
129
|
+
October
|
130
|
+
Oktober
|
131
|
+
|
132
|
+
November
|
133
|
+
November
|
134
|
+
|
135
|
+
December
|
136
|
+
Dezember
|
137
|
+
|
138
|
+
|
82
139
|
################################## Messages in the log
|
83
140
|
|
84
141
|
Already required package with different options
|
85
142
|
LaTeX-Package wurde bereits mit anderen Optionen angefordert
|
86
143
|
|
144
|
+
Anonymous
|
145
|
+
Anonym
|
146
|
+
|
87
147
|
Argument parse error
|
88
148
|
Fehler beim Aufschl�sseln der Argumente
|
89
149
|
|
@@ -114,12 +174,18 @@ Kann
|
|
114
174
|
Can't copy css file
|
115
175
|
Kann CSS Datei nicht kopieren
|
116
176
|
|
177
|
+
Can't include remote images in current document
|
178
|
+
Dieses Dokument kann keine entfernten Bilder beinhalten
|
179
|
+
|
117
180
|
Can't parse date
|
118
181
|
Kann Datumsangabe nicht aufschl�sseln
|
119
182
|
|
120
183
|
Can't refer to id
|
121
184
|
Kann nicht auf ID verweisen
|
122
185
|
|
186
|
+
Cancel
|
187
|
+
Abbrechen
|
188
|
+
|
123
189
|
Clip is nil, which is quite strange and most likely deplate's error but as I haven't had the time yet to track this down this error still occurs.
|
124
190
|
Das Textst�ck ist nil, was ziemlich seltsam und vermutlich ein wirrer Fehler in der Programmlogik ist
|
125
191
|
|
@@ -138,15 +204,21 @@ Code: Du musst evtl. die Stildefinition ins Ausgabeverzeichnis kopieren
|
|
138
204
|
Command
|
139
205
|
Kommando
|
140
206
|
|
207
|
+
Command already defined
|
208
|
+
Kommando existiert bereits
|
209
|
+
|
210
|
+
Comment
|
211
|
+
Kommentar
|
212
|
+
|
141
213
|
Conflicting arguments
|
142
214
|
Widerspr�chliche Argumente
|
143
215
|
|
144
|
-
Conversion if Inline LaTeX failed
|
145
|
-
Fehler bei der Konvertierung eines LaTeX-Fragments
|
146
|
-
|
147
216
|
Copy css file
|
148
217
|
Kopiere CSS Datei
|
149
218
|
|
219
|
+
Copy file
|
220
|
+
Kopiere Datei
|
221
|
+
|
150
222
|
Creating directory
|
151
223
|
Erzeuge Verzeichnis
|
152
224
|
|
@@ -197,6 +269,9 @@ Wurde weggelassen!
|
|
197
269
|
Dropping
|
198
270
|
Wird weggelassen
|
199
271
|
|
272
|
+
E-Mail
|
273
|
+
E-Mail
|
274
|
+
|
200
275
|
Element already has a caption
|
201
276
|
Element hat bereits eine �berschrift
|
202
277
|
|
@@ -236,6 +311,9 @@ Da sollte etwas einer anderen Klasse sein
|
|
236
311
|
File not found
|
237
312
|
Datei nicht gefunden
|
238
313
|
|
314
|
+
File already exists
|
315
|
+
Datei ist bereits vorhanden
|
316
|
+
|
239
317
|
Files exist! Using
|
240
318
|
Bereits vorhandene Datei wird wiederverwendet
|
241
319
|
|
@@ -297,17 +375,26 @@ Internal error
|
|
297
375
|
Interner Programmfehler
|
298
376
|
|
299
377
|
Internal error: Bad log text
|
300
|
-
Programmfehler: Schlecht definierter Protokolleintrag
|
378
|
+
Interner Programmfehler: Schlecht definierter Protokolleintrag
|
379
|
+
|
380
|
+
Internal error: No @elt
|
381
|
+
Interner Programmfehler: Kein @elt
|
301
382
|
|
302
|
-
Internal error:
|
303
|
-
Programmfehler:
|
383
|
+
Internal error: No ID
|
384
|
+
Interner Programmfehler: Keine ID
|
304
385
|
|
305
386
|
Internal error in #output_file_name
|
306
|
-
Programmfehler in #output_file_name
|
387
|
+
Interner Programmfehler in #output_file_name
|
307
388
|
|
308
|
-
|
389
|
+
Internal error: Unknown level
|
390
|
+
Interner Programmfehler: Unbekannte Abschnittsnummer
|
391
|
+
|
392
|
+
Invalid ID
|
309
393
|
Ung�ltige ID
|
310
394
|
|
395
|
+
Invoking method failed
|
396
|
+
Fehler bei Methodenaufruf
|
397
|
+
|
311
398
|
Is no file
|
312
399
|
Ist keine Datei
|
313
400
|
|
@@ -320,6 +407,9 @@ Fehler beim Laden von Programmmodul
|
|
320
407
|
Loading
|
321
408
|
Lade
|
322
409
|
|
410
|
+
Macro already defined
|
411
|
+
Makro existiert bereits
|
412
|
+
|
323
413
|
Malformed command
|
324
414
|
Fehlerhafter Befehl
|
325
415
|
|
@@ -359,6 +449,9 @@ Ung
|
|
359
449
|
Missing arguments
|
360
450
|
Fehlendes Argument
|
361
451
|
|
452
|
+
Name
|
453
|
+
Name
|
454
|
+
|
362
455
|
Negative indentation level
|
363
456
|
Negatives Einr�ckniveau
|
364
457
|
|
@@ -380,16 +473,16 @@ Kein Argument
|
|
380
473
|
No bib entry type given
|
381
474
|
Fehlender BIBTEX-Eintragstyp
|
382
475
|
|
383
|
-
No clip-id given
|
384
|
-
Fehlende Textst�ck-ID
|
385
|
-
|
386
476
|
No element given
|
387
477
|
Fehlendes Blockelement
|
388
478
|
|
389
|
-
No
|
479
|
+
No filename
|
480
|
+
Fehlender Dateiname
|
481
|
+
|
482
|
+
No footnote ID
|
390
483
|
Fehlende Fu�noten-ID
|
391
484
|
|
392
|
-
No
|
485
|
+
No ID given
|
393
486
|
Keine ID
|
394
487
|
|
395
488
|
No input! Skip
|
@@ -404,7 +497,7 @@ Fehlender Ausgabeort f
|
|
404
497
|
No more input on STDIN
|
405
498
|
Keine weitere Eingabe auf STDIN
|
406
499
|
|
407
|
-
No object with that
|
500
|
+
No object with that ID
|
408
501
|
Unbekannte Objekt-ID
|
409
502
|
|
410
503
|
No or unknown formatter
|
@@ -416,9 +509,15 @@ Keine Ausgabedatei
|
|
416
509
|
No pattern specified
|
417
510
|
Fehlendes Muster
|
418
511
|
|
512
|
+
No permission
|
513
|
+
Fehlende Berechtigung
|
514
|
+
|
419
515
|
No programm name given!
|
420
516
|
Fehlender Programmname
|
421
517
|
|
518
|
+
No separator
|
519
|
+
Fehlendes Trennungszeichen
|
520
|
+
|
422
521
|
No slot
|
423
522
|
Fehlende Ausgabeposition
|
424
523
|
|
@@ -428,6 +527,9 @@ Fehlende Angabe einer Schablone
|
|
428
527
|
Not yet implemented!
|
429
528
|
Noch nicht implementiert!
|
430
529
|
|
530
|
+
Nothing to register
|
531
|
+
Kein Element, um es zu registrieren
|
532
|
+
|
431
533
|
Object has no label
|
432
534
|
Objekt hat keine Marke
|
433
535
|
|
@@ -481,10 +583,13 @@ Verweis auf unbekannte Marke
|
|
481
583
|
Regexp error when parsing
|
482
584
|
Regexp-Fehler bei der Textanalyse
|
483
585
|
|
586
|
+
Region already defined
|
587
|
+
Region existiert bereits
|
588
|
+
|
484
589
|
Register heading
|
485
590
|
Registriere �berschrift
|
486
591
|
|
487
|
-
Register
|
592
|
+
Register ID
|
488
593
|
Registriere ID
|
489
594
|
|
490
595
|
Require failed
|
@@ -535,6 +640,9 @@ Einrichten der Ausgabeformatierung
|
|
535
640
|
Setting up text scanner
|
536
641
|
Einrichten des Einlesemoduls
|
537
642
|
|
643
|
+
Setting variable
|
644
|
+
Setze Variable
|
645
|
+
|
538
646
|
Should be excluded
|
539
647
|
Soll nicht eingelesen werden
|
540
648
|
|
@@ -559,6 +667,12 @@ Text hat sich ge
|
|
559
667
|
Source not found; assume that output is okay
|
560
668
|
Kein Quelltext gefunden; nehme an, dass die Ausgabe aktuell ist
|
561
669
|
|
670
|
+
Subject
|
671
|
+
Betreff
|
672
|
+
|
673
|
+
Submit
|
674
|
+
Senden
|
675
|
+
|
562
676
|
Table: Can't join with above cell
|
563
677
|
Tabelle: Kann Zelle nicht mit der dar�berliegenden vereinen
|
564
678
|
|
@@ -580,6 +694,12 @@ Unbekannte Marke
|
|
580
694
|
Undefined slot
|
581
695
|
Unbekannte Ausgabeposition
|
582
696
|
|
697
|
+
Unexpected argument
|
698
|
+
Unerwartetes Argument
|
699
|
+
|
700
|
+
Unexpected number of output files
|
701
|
+
Unerwartete Anzahl von Ausgabedateien
|
702
|
+
|
583
703
|
Unexpected R output (Please check the output for errors!)
|
584
704
|
Unerwartete Ausgabe von R (Bitte pr�fe die Ausgabedatei auf Fehler!)
|
585
705
|
|
@@ -595,6 +715,9 @@ Unbekanntes Textst
|
|
595
715
|
Unknown command
|
596
716
|
Unbekanntes Kommando
|
597
717
|
|
718
|
+
Unknown counter
|
719
|
+
Unbekannter Z�hler
|
720
|
+
|
598
721
|
Unknown doc variable
|
599
722
|
Unbekannte Variable
|
600
723
|
|
@@ -610,15 +733,27 @@ Unbekanntes Ausgabeformat
|
|
610
733
|
Unknown formatting agent
|
611
734
|
Unbekannter Formatierungsagent
|
612
735
|
|
736
|
+
Unknown ID
|
737
|
+
Unbekannte Kennung
|
738
|
+
|
739
|
+
Unknown indentation mode
|
740
|
+
Unbekannter Einr�ckungsmodus
|
741
|
+
|
613
742
|
Unknown input format
|
614
743
|
Unbekanntes Eingabeformat
|
615
744
|
|
616
745
|
Unknown InterWiki name
|
617
746
|
Unbekannter InterWiki-Name
|
618
747
|
|
748
|
+
Unknown list
|
749
|
+
Unbekannte Liste
|
750
|
+
|
619
751
|
Unknown LIST type
|
620
752
|
Unbekannter Typ f�r LIST
|
621
753
|
|
754
|
+
Unknown list type
|
755
|
+
Unbekannter Listentyp
|
756
|
+
|
622
757
|
Unknown macro
|
623
758
|
Unbekanntes Makro
|
624
759
|
|
@@ -634,6 +769,9 @@ Unbekannte Regionenklasse
|
|
634
769
|
Unknown service
|
635
770
|
Unbekannter Dienst
|
636
771
|
|
772
|
+
Unknown skeleton
|
773
|
+
Unbekannte Textschablone
|
774
|
+
|
637
775
|
Unknown smiley
|
638
776
|
Unbekannter Smiley
|
639
777
|
|
File without changes
|
File without changes
|
data/lib/deplate/macros.rb
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
# @Website: http://deplate.sf.net/
|
4
4
|
# @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
|
5
5
|
# @Created: 25-M�r-2004.
|
6
|
-
# @Last Change:
|
7
|
-
# @Revision: 0.
|
6
|
+
# @Last Change: 14-Mai-2006.
|
7
|
+
# @Revision: 0.1261
|
8
8
|
|
9
9
|
require 'forwardable'
|
10
10
|
|
@@ -27,16 +27,33 @@ class Deplate::Macro < Deplate::BaseParticle
|
|
27
27
|
|
28
28
|
def exec(deplate, container, context, cmd, *args)
|
29
29
|
c = deplate.input.macros[cmd]
|
30
|
+
if c.nil?
|
31
|
+
m = /^([[:alnum:]_]+)(\[.*?\])?(\.|!)?/.match(cmd)
|
32
|
+
if m
|
33
|
+
if deplate.clips[m[1]]
|
34
|
+
args[2] = cmd
|
35
|
+
c = deplate.input.macros['get']
|
36
|
+
elsif deplate.variables.include?(m[1])
|
37
|
+
if m[3]
|
38
|
+
args[2] = cmd[0..-2]
|
39
|
+
c = deplate.input.macros['var']
|
40
|
+
else
|
41
|
+
args[2] = cmd
|
42
|
+
c = deplate.input.macros['arg']
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
30
47
|
if c
|
31
48
|
begin
|
32
49
|
return c.new(deplate, container, context, *args)
|
33
50
|
rescue Exception => e
|
34
|
-
puts e.backtrace[0..10].join("\n")
|
35
|
-
puts
|
51
|
+
# puts e.backtrace[0..10].join("\n")
|
52
|
+
puts 'Internal error when initializing ' + c.name
|
36
53
|
raise e
|
37
54
|
end
|
38
55
|
else
|
39
|
-
container.log([
|
56
|
+
container.log(['Unknown macro', cmd, args.inspect], :unknown_macro)
|
40
57
|
end
|
41
58
|
end
|
42
59
|
end
|
@@ -68,7 +85,7 @@ class Deplate::Macro < Deplate::BaseParticle
|
|
68
85
|
@elt = @elt.compact
|
69
86
|
end
|
70
87
|
|
71
|
-
def join_elt(sep=
|
88
|
+
def join_elt(sep='')
|
72
89
|
process_elt
|
73
90
|
if block_given?
|
74
91
|
yield
|
@@ -84,7 +101,7 @@ class Deplate::Macro < Deplate::BaseParticle
|
|
84
101
|
elsif @text
|
85
102
|
return @text
|
86
103
|
else
|
87
|
-
return
|
104
|
+
return ''
|
88
105
|
end
|
89
106
|
end
|
90
107
|
end
|
@@ -106,42 +123,9 @@ end
|
|
106
123
|
|
107
124
|
class Deplate::Macro::Footnote < Deplate::Macro
|
108
125
|
register_as 'fn'
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
attr_reader :accum, :regNote, :label, :level, :caption, :captionOptions
|
113
|
-
|
114
|
-
def setup(text)
|
115
|
-
if text
|
116
|
-
@fnId = @args["id"]
|
117
|
-
if @fnId and text and !text.empty?
|
118
|
-
@regNote = @fnId
|
119
|
-
@accum = text
|
120
|
-
# @level = @container.level
|
121
|
-
fn = Deplate::Regions::Footnote.new(@deplate, @source, @regNote, {}, self)
|
122
|
-
fn.finish
|
123
|
-
else
|
124
|
-
@fnId ||= text
|
125
|
-
end
|
126
|
-
if @container.kind_of?(Deplate::Element::Table)
|
127
|
-
@container.contains_footnotes = true
|
128
|
-
end
|
129
|
-
else
|
130
|
-
log("No footnote id", :error)
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
def process
|
135
|
-
fn = @deplate.footnotes[@fnId]
|
136
|
-
if fn
|
137
|
-
fn.elt.consumed = true
|
138
|
-
@elt = fn
|
139
|
-
else
|
140
|
-
log(["Unknown footnote", @fnId, @deplate.footnotes.keys.inspect], :error)
|
141
|
-
@elt = nil
|
142
|
-
end
|
143
|
-
return format_particle(:format_footnote, self)
|
144
|
-
end
|
126
|
+
include Deplate::Footnote
|
127
|
+
alias :setup :footnote_setup
|
128
|
+
alias :process :footnote_process
|
145
129
|
end
|
146
130
|
|
147
131
|
|
@@ -151,7 +135,7 @@ class Deplate::Macro::Cite < Deplate::Macro
|
|
151
135
|
|
152
136
|
def setup(text)
|
153
137
|
@deplate.options.citations << self
|
154
|
-
@elt = text.split(/\s
|
138
|
+
@elt = text.split(/\s*[;, ]\s*/)
|
155
139
|
for c in @elt
|
156
140
|
@container.add_metadata(@source,
|
157
141
|
"type" => "citation",
|
@@ -187,30 +171,77 @@ class Deplate::Macro::Date < Deplate::Macro
|
|
187
171
|
end
|
188
172
|
|
189
173
|
|
174
|
+
class Deplate::Argument < Deplate::Macro
|
175
|
+
def value(text)
|
176
|
+
@deplate = @deplate.options.master if @deplate.options.master
|
177
|
+
val = @deplate.variables[text]
|
178
|
+
if val.nil?
|
179
|
+
val = @args['default']
|
180
|
+
log(['Unknown variable', '{arg}', text]) if val.nil?
|
181
|
+
end
|
182
|
+
transformed_value(val)
|
183
|
+
end
|
184
|
+
|
185
|
+
def transformed_value(val)
|
186
|
+
case val
|
187
|
+
when Array
|
188
|
+
if (j = @args['join'])
|
189
|
+
return val.join(j)
|
190
|
+
end
|
191
|
+
when Hash
|
192
|
+
if @args['keys']
|
193
|
+
return transformed_value(val.keys)
|
194
|
+
elsif @args['values']
|
195
|
+
return transformed_value(val.values)
|
196
|
+
elsif @args['join']
|
197
|
+
return transformed_value(val.to_a)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
return val
|
201
|
+
end
|
202
|
+
|
203
|
+
def process
|
204
|
+
post_process_text(super)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
|
190
209
|
# Access document options set with DOC.
|
191
|
-
class Deplate::Macro::
|
210
|
+
class Deplate::Macro::Var < Deplate::Argument
|
192
211
|
register_as 'doc'
|
193
212
|
register_as 'var'
|
194
213
|
|
195
214
|
def setup(text)
|
196
|
-
|
215
|
+
val = value(text)
|
216
|
+
unless val.nil?
|
217
|
+
@text = plain_text(val.inspect)
|
218
|
+
end
|
197
219
|
end
|
198
220
|
end
|
199
221
|
|
200
222
|
|
201
223
|
# Access template arguments or document options set with DOC and parse.
|
202
|
-
class Deplate::Macro::Arg < Deplate::
|
224
|
+
class Deplate::Macro::Arg < Deplate::Argument
|
203
225
|
register_as 'arg'
|
204
226
|
register_as 'val'
|
205
227
|
|
206
228
|
def setup(text)
|
207
|
-
|
208
|
-
val
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
@text =
|
229
|
+
val = value(text)
|
230
|
+
unless val.nil?
|
231
|
+
case val
|
232
|
+
when String
|
233
|
+
@text = val
|
234
|
+
# when TrueClass
|
235
|
+
# @text = '{true}'
|
236
|
+
# when FalseClass
|
237
|
+
# @text = '{false}'
|
238
|
+
# when Numeric
|
239
|
+
# @text = "{0d#{val}}"
|
240
|
+
else
|
241
|
+
# @text = val.to_s
|
242
|
+
@text = val.inspect
|
243
|
+
end
|
244
|
+
@text = Deplate::Core.escape_characters(@text, @args)
|
214
245
|
if !@args['asString']
|
215
246
|
@elt = @deplate.parse(@container, @text)
|
216
247
|
end
|
@@ -220,14 +251,15 @@ end
|
|
220
251
|
|
221
252
|
|
222
253
|
# Access template arguments or document options set with DOC and parse.
|
223
|
-
class Deplate::Macro::XArg < Deplate::
|
254
|
+
class Deplate::Macro::XArg < Deplate::Argument
|
224
255
|
register_as 'xarg'
|
225
256
|
register_as 'xval'
|
226
257
|
|
227
258
|
def setup(text)
|
228
259
|
c = @deplate.variables[text] || @args["default"]
|
229
260
|
if c
|
230
|
-
|
261
|
+
c = Deplate::Core.escape_characters(c, @args)
|
262
|
+
@elt = @deplate.parse(@container, c)
|
231
263
|
else
|
232
264
|
log(["Unknown variable", '{xarg}', text])
|
233
265
|
end
|
@@ -245,6 +277,17 @@ class Deplate::Macro::Opt < Deplate::Macro
|
|
245
277
|
end
|
246
278
|
|
247
279
|
|
280
|
+
# Access element options set with OPT
|
281
|
+
class Deplate::Macro::Msg < Deplate::Macro
|
282
|
+
register_as 'msg'
|
283
|
+
|
284
|
+
def setup(text)
|
285
|
+
@elt = @deplate.parse(@container, @deplate.msg(text))
|
286
|
+
# @text = @deplate.msg(text)
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
|
248
291
|
# Access clips (probably requires some processing?)
|
249
292
|
class Deplate::Macro::Clip < Deplate::Macro
|
250
293
|
register_as 'clip'
|
@@ -270,7 +313,7 @@ class Deplate::Macro::Clip < Deplate::Macro
|
|
270
313
|
log(["Unknown clip", @id], :error) unless @elt
|
271
314
|
end
|
272
315
|
else
|
273
|
-
log(["No
|
316
|
+
log(["No ID given", @id], :error)
|
274
317
|
end
|
275
318
|
end
|
276
319
|
end
|
@@ -292,7 +335,15 @@ class Deplate::Macro::Ruby < Deplate::Macro
|
|
292
335
|
register_as 'ruby'
|
293
336
|
|
294
337
|
def setup(text)
|
295
|
-
|
338
|
+
rv = @deplate.eval_ruby(self, @args, text)
|
339
|
+
if rv
|
340
|
+
rv = rv.to_s
|
341
|
+
if @args['native'] or @args['ins']
|
342
|
+
@text = rv
|
343
|
+
else
|
344
|
+
@elt = @deplate.parse(self, rv)
|
345
|
+
end
|
346
|
+
end
|
296
347
|
end
|
297
348
|
end
|
298
349
|
|
@@ -307,13 +358,13 @@ class Deplate::Macro::Ref < Deplate::Macro
|
|
307
358
|
end
|
308
359
|
|
309
360
|
def process
|
310
|
-
id = @args["byId"]
|
311
|
-
if id
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
end
|
361
|
+
# id = @args["byId"]
|
362
|
+
# if id
|
363
|
+
# @text = @deplate.get_label_by_id(self, id)
|
364
|
+
# unless @text
|
365
|
+
# log(["Can't refer to ID", id], :error)
|
366
|
+
# end
|
367
|
+
# end
|
317
368
|
return format_particle(:format_ref, self)
|
318
369
|
end
|
319
370
|
end
|
@@ -325,7 +376,7 @@ class Deplate::Macro::Label < Deplate::Macro
|
|
325
376
|
register_as 'lab'
|
326
377
|
|
327
378
|
def setup(text)
|
328
|
-
@deplate.add_label(self, text,
|
379
|
+
@deplate.add_label(self, text, level_as_string, :container => @container)
|
329
380
|
@text = format_particle(:format_label, self, :string, [text])
|
330
381
|
end
|
331
382
|
end
|
@@ -344,16 +395,13 @@ class Deplate::Macro::Latex < Deplate::Macro
|
|
344
395
|
register_as 'ltx'
|
345
396
|
set_formatter :format_ltx
|
346
397
|
|
347
|
-
class << self
|
348
|
-
attr_reader :formatter
|
349
|
-
end
|
350
|
-
|
351
398
|
attr_reader :accum, :caption
|
352
399
|
|
353
400
|
def setup(text)
|
354
401
|
prelude = @deplate.formatter.prelude('ltxPrelude')
|
355
402
|
@accum = [ prelude, text ].flatten.compact
|
356
403
|
@text = text
|
404
|
+
@args['inline'] = true
|
357
405
|
@deplate.formatter.inlatex(self)
|
358
406
|
end
|
359
407
|
|
@@ -385,7 +433,7 @@ class Deplate::Macro::List < Deplate::Macro
|
|
385
433
|
when "dl"
|
386
434
|
@type = "Description"
|
387
435
|
when "ol"
|
388
|
-
@type = "
|
436
|
+
@type = "Ordered"
|
389
437
|
else
|
390
438
|
@type = "Itemize"
|
391
439
|
end
|
@@ -498,10 +546,9 @@ class Deplate::Macro::Text < Deplate::Macro
|
|
498
546
|
@elt = @deplate.parse(@container, text, @alt)
|
499
547
|
end
|
500
548
|
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
# end
|
549
|
+
def process
|
550
|
+
format_particle(:format_void, self, super)
|
551
|
+
end
|
505
552
|
end
|
506
553
|
|
507
554
|
|
@@ -553,7 +600,7 @@ class Deplate::Macro::Image < Deplate::Macro
|
|
553
600
|
end
|
554
601
|
|
555
602
|
def process
|
556
|
-
return @deplate.formatter.include_image(@text, @args, true)
|
603
|
+
return @deplate.formatter.include_image(self, @text, @args, true)
|
557
604
|
end
|
558
605
|
end
|
559
606
|
|
@@ -586,12 +633,6 @@ class Deplate::Macro::Idx < Deplate::Macro
|
|
586
633
|
register_as 'idx'
|
587
634
|
|
588
635
|
def setup(text)
|
589
|
-
# auto = @args["auto"]
|
590
|
-
# auto = @deplate.variables["autoindex"] if auto.nil?
|
591
|
-
# @acc = []
|
592
|
-
# for i in text.split(/\s*;\s*/)
|
593
|
-
# @acc << @deplate.add_index(self, i)
|
594
|
-
# end
|
595
636
|
@acc = Deplate::Command::IDX.get_indices(@container, @deplate, @args, text, @source)
|
596
637
|
end
|
597
638
|
|
@@ -622,9 +663,19 @@ class Deplate::Macro::Let < Deplate::Macro
|
|
622
663
|
end
|
623
664
|
|
624
665
|
|
666
|
+
class Deplate::Macro::Counter < Deplate::Macro
|
667
|
+
register_as 'counter'
|
668
|
+
|
669
|
+
def setup(text)
|
670
|
+
@text = @deplate.options.counters.get_s(text, @args)
|
671
|
+
end
|
672
|
+
end
|
673
|
+
|
674
|
+
|
625
675
|
class Deplate::Core
|
626
676
|
def self.simple_macro(name, body)
|
627
677
|
cn = name.capitalize
|
678
|
+
cn.gsub!(/\W/, '_')
|
628
679
|
eval %{
|
629
680
|
class Deplate::Macro::#{cn} < Deplate::Macro
|
630
681
|
register_as #{name.inspect}
|