-
Notifications
You must be signed in to change notification settings - Fork 31
/
markdoc.dlg
1097 lines (847 loc) · 32.8 KB
/
markdoc.dlg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
VERSION 12
POSITION . . 440 420
// -----------------------------------------------------------------------------
// LISTS
// =============================================================================
// Specify markdoc Format
LIST format_list
BEGIN
pdf
docx
odt
html
tex
markdown
END
// Specify the Markup langugae
LIST markup_list
BEGIN
markdown
latex
html
END
// Specify the Markup langugae for Stata documentation
LIST helpfile_list
BEGIN
markdown
markdown+smcl
smcl
END
// Specify the Markup langugae
LIST slide_markup_list
BEGIN
markdown
latex
END
// Specify the Document Theme
LIST style_list
BEGIN
simple
stata
formal
END
// Beamer Theme
LIST theme_list
BEGIN
default
AnnArbor
Antibes
Bergen
Berkeley
Berlin
Boadilla
boxes
CambridgeUS
Copenhagen
Darmstadt
Dresden
Frankfurt
Goettingen
Hannover
Ilmenau
JuanLesPins
Luebeck
Madrid
Malmoe
Marburg
Montpellier
PaloAlto
Pittsburgh
Rochester
Singapore
Szeged
Warsaw
END
// Beamer Color
LIST color_list
BEGIN
default
albatross
beaver
beetle
crane
dolphin
dove
fly
lily
orchid
rose
seagull
seahorse
sidebartab
structure
whale
wolverine
END
// Beamer Font
LIST font_list
BEGIN
default
professionalfonts
serif
structurebold
structureitalicserif
structuresmallcapsserif
END
LIST code_list
BEGIN
tiny
scriptsize
footnotesize
small
normalsize
large
Large
LARGE
huge
Huge
END
// -----------------------------------------------------------------------------
// MAIN PAGE BUTTONS
// =============================================================================
OK ok1, label("OK")
CANCEL can1, label("Cancel")
SUBMIT sub1, label("Submit")
HELP hlp1, view("help markdoc") //"browse https://github.com/haghish/markdoc/wiki"
RESET res1
COPY copy1
// -----------------------------------------------------------------------------
// GENERAL SCRIPTS
// =============================================================================
// Initial script that is executed automatically
SCRIPT PREINIT
BEGIN
* main.master.disable
//main.statax.disable
*if sub.visible() {
*}
// for example, this will disable the foolowing button
*main.toc.disable
END
// Reset Values of the Main Tab
// ----------------------------
SCRIPT mainReset
BEGIN
*main.sourceFile.disable
*main.sourceFile.setvalue ""
*main.markup.setvalue ""
*sub.sourceFile.setvalue ""
*vignette.sourceFile.setvalue ""
END
// Reset Values of the Slides Tab
// -------------------------------
SCRIPT subReset
BEGIN
*main.sourceFile.setvalue ""
*main.markup.setvalue ""
*vignette.sourceFile.setvalue ""
END
SCRIPT vignetteReset
BEGIN
*sub.sourceFile.setvalue ""
*main.sourceFile.setvalue ""
END
SCRIPT main_POSTINIT
BEGIN
// enable the main dialog and disable the rest
*main.sourceFile.enable
*main.sourceFile.enable
END
// -----------------------------------------------------------------------------
// DYNAMIC DOCUMENT TAB
// =============================================================================
DIALOG main, label("markdoc") tabtitle("Dynamic Document")
BEGIN
//define the source value
//FRAME box 10 72 310 30
// Browse SMCL or DO file
// -------------------------------------------------------------------------
TEXT txt_file 10 5 320 . , label(`"Select "smcl" or "do" file"')
FILE sourceFile 10 +20 420 . , error("Open file") label(Browse...) ///
filter("smcl file|*.smcl|do file|*.do") tooltip("markdoc can produce a dynamic document by translating a SCML log-file or actively executing a Do-file. Select a SMCL or Do-file to be used as the source of the document.") ///
onchange("script mainReset")
// Specify Markup, Format, Style
// -------------------------------------------------------------------------
TEXT tx_markup 10 +30 200 . , label("Markup language")
COMBOBOX markup @ +20 100 . , dropdownlist contents(markup_list) onselchange("program test") tooltip("markdoc supports several markup languages that can be used for writing the documentation. Specify the markup language that you have used in your source code.")
TEXT tx_format +120 -20 200 . , label("Document format")
//COMBOBOX format @ +20 100 . , dropdownlist contents(format_list) onselchange("program test") ////onselchange("script disablethem") //onselchange("main.master.disable") // onselchange("program test")
RADIO r6 @ +20 100 ., first label("md") onclickon("program test")
RADIO r1 +50 @ @ . , middle label("html") onclickon("program test") //option(nociforeground)
RADIO r2 +50 @ @ ., middle label("pdf") onclickon("program test") tooltip(`"producing PDF document requires wkhtmltopdf software, which you can install manually or by using the "install" option"')
RADIO r4 +50 @ @ ., middle label("docx") onclickon("program test")
RADIO r5 +50 @ @ ., middle label("odt") onclickon("program test")
RADIO r3 +50 @ @ ., last label("tex") onclickon("program test") //onclickon("script TeXoptions")
// GROUPBOX
// -------------------------------------------------------------------------
GROUPBOX gb_opts 10 +35 420 305, label("Options")
// RIGHT COLUMN
// ---------------------------------------------------------------------
// install
CHECKBOX install +10 +25 -20 . , option(install) label("Install required software") default(0) tooltip(`"markdoc requires "Pandoc" and "wkhtmltopdf" third-party software. It also requires 2 Stata packages which are "weaver" and "statax". This option automatically installs these software, if they are not already installed on your machine."')
// replace
CHECKBOX replace @ +17 @ . , option(replace) label("Replace the existing document") default(1)
// master
CHECKBOX master @ +17 @ . , option(master) label("Create HTML or LaTeX template") default(1) tooltip("LaTeX format requires a document template. Without the template, you will not be able to typeset the document to PDF. Usually you are required to create your own template, load the packages you need, etc. However, markdoc provides this option to facilitate writing with LaTeX and automatically creates the layout if you haven't defined it in the source file.")
// syntax highlighter
CHECKBOX statax @ +17 @ . , option(statax) label("Statax syntax highlighter") default(1)
// table of content
CHECKBOX toc @ +17 @ . , option(toc) label("Table of content")
// current date
CHECKBOX date @ +17 @ . , option(date) label("Add the current date")
// numbered
CHECKBOX numbered @ +17 @ . , option(numbered) label("Count Stata commands") tooltip("this option will number the Stata commands, 1,2,3,... ")
// mini
CHECKBOX mini @ +17 @ . , option(mini) label("Avoid using Pandoc or wkhtmltopdf (mini mode)") tooltip("the mini mode runs markdoc without calling third-party software such as Pandoc or wkhtmltopdf. this mode is limited and does not fully support Markdown syntax, but it can produce a document on a machine that does not have thse software installed.") //onclickon(main.mini.disable) //onclickoff(main.mini.enable)
// title of the document
TEXT tx_title @ +30 50 ., label(Title)
EDIT title 80 @ 340 18 //EDIT ed_title +30 @ 340 .
// Author of the document
TEXT tx_author 20 +20 50 ., label(Author)
EDIT author 80 @ 340 18
// Affiliation
TEXT tx_affiliation 20 +20 55 ., label(Affiliation)
EDIT affiliation 80 @ 340 18
// Address
TEXT tx_address 20 +20 50 ., label(Address)
EDIT address 80 @ 340 18
// Summary
TEXT tx_summary 20 +20 60 ., label(Summary)
EDIT summary 80 @ 340 36
// LEFT COLUMN
// ---------------------------------------------------------------------
// layout
TEXT tx_style 220 135 200 . , label("Select document layout style")
COMBOBOX style @ +20 100 . , dropdownlist contents(style_list)
// layout
TEXT tx_template @ +31 200 . , label("Use layout (css, docx, tex, etc)")
FILE template @ +20 200 . , error("Open file") label(Browse...) ///
filter("css file|*.css|LaTeX header Template|*.tex|Microsoft Word Template|*.docx|OpenOffice Template|*.odt|All files|*.*")
//CHECKBOX activate @ +31 200 . , default(0) label("Adjust linesize") onclickon("program test") onclickoff("program test")
//SPINNER linesize 340 @ 80 . , min(80) max(255) default(110) tooltip("Adjust the width of your document. If the specified linesize is less than the actual width, your document will show unreasonably disjoint lines or words.")
END
// -----------------------------------------------------------------------------
// PRESENTATION SLIDES TAB
// =============================================================================
DIALOG sub, tabtitle("Presentation Slide")
BEGIN
//BUTTON help 200 100 80 ., label("Help") onpush("view help markdoc")
// Browse SMCL or DO file
// -------------------------------------------------------------------------
TEXT txt_file 10 5 320 . , label(`"Select "smcl" or "do" file"')
FILE sourceFile 10 +20 420 . , error("Open file") label(Browse...) onchange("script subReset") filter("smcl file|*.smcl|do file|*.do") tooltip("markdoc can produce dynamic presentation slides by translating a SCML log-file or actively executing a Do-file. Select a SMCL or Do-file to be used as the source of the document.")
// Specify Markup, Format, Style
// -------------------------------------------------------------------------
TEXT tx_markup 10 +30 200 . , label("Markup language")
COMBOBOX markup @ +20 100 . , dropdownlist contents(slide_markup_list) onselchange("program subtest") tooltip("markdoc supports several markup languages that can be used for writing the documentation. Specify the markup language that you have used in your source code.")
TEXT tx_format +120 -20 200 . , label("Presentation slide format")
RADIO r1 @ +20 100 . , first label("pdf") onclickon("program subtest") //option(nociforeground)
RADIO r2 +50 @ @ ., last label("html") onclickon("program subtest")
//RADIO r2 +50 @ @ ., middle label("slidy") onclickon("program subtest")
//RADIO r3 +50 @ @ ., last label("dzslide") onclickon("program subtest") //onclickon("script TeXoptions")
// BUTTON bu_facvars @ +50 @ ., label("my Button") onpush("program bu_facvars_getOpts")
//BUTTON bu_facvars _ilft +35 200 ., ///
//onpush("program bu_facvars_getOpts") ///
//label(resource LBL_FACTOR_VARIABLE_DISPLAY_OPTIONS)
GROUPBOX beamer 10 +35 420 70, label("Beamer layout")
TEXT tx_theme +10 +20 200 50 , label("Theme")
COMBOBOX theme @ +17 69 . , dropdownlist contents(theme_list) //onselchange("program test") tooltip("markdoc supports several markup languages that can be used for writing the documentation. Specify the markup language that you have used in your source code.")
TEXT tx_color +72 -17 200 50 , label("Color")
COMBOBOX color @ +17 69 . , dropdownlist contents(color_list) //onselchange("program test") tooltip("markdoc supports several markup languages that can be used for writing the documentation. Specify the markup language that you have used in your source code.")
TEXT tx_font +72 -17 200 50 , label("Font")
COMBOBOX font @ +17 69 . , dropdownlist contents(font_list) //onselchange("program test") tooltip("markdoc supports several markup languages that can be used for writing the documentation. Specify the markup language that you have used in your source code.")
TEXT tx_codesize +72 -17 50 . , label("Code size")
COMBOBOX codesize @ +17 69 . , dropdownlist contents(code_list) default(scriptsize) //onselchange("program test") tooltip("markdoc supports several markup languages that can be used for writing the documentation. Specify the markup language that you have used in your source code.")
TEXT tx_bwidth +77 -17 50 . , label("Width")
SPINNER bwidth @ +17 50 . , min(80) max(255) default(128) tooltip("change the font size of the slide")
TEXT tx_bheight +60 -17 50 . , label("Height")
SPINNER bheight @ +17 50 . , min(80) max(255) default(96) tooltip("change the font size of the slide")
// GROUPBOX
// -------------------------------------------------------------------------
GROUPBOX gb_opts 10 +50 420 218, label("Options")
// RIGHT COLUMN
// ---------------------------------------------------------------------
// install
CHECKBOX install +10 +25 -20 . , option(install) label("Install required software") default(0) tooltip(`"markdoc requires "Pandoc" and "wkhtmltopdf" third-party software. It also requires 2 Stata packages which are "weaver" and "statax". This option automatically installs these software, if they are not already installed on your machine."')
// replace
CHECKBOX replace @ +17 @ . , option(replace) label("Replace the existing document") default(1)
// current date
//CHECKBOX date @ +17 @ . , option(date) label("add the current date")
// numbered
CHECKBOX numbered @ +17 @ . , option(numbered) label("Count Stata commands") tooltip("this option will number the Stata commands, 1,2,3,... ")
// master
CHECKBOX master @ +17 @ . , option(master) label("Create LaTeX template") default(0) tooltip("LaTeX format requires a document template. Without the template, you will not be able to typeset the document to PDF. Usually you are required to create your own template, load the packages you need, etc. However, markdoc provides this option to facilitate writing with LaTeX and automatically creates the layout if you haven't defined it in the source file.")
// noisily
CHECKBOX noisily @ +17 @ . , option(noisily) label("Execute markdoc noisily") tooltip("Having trouble with markdoc? use this option to execute markdoc noisily and get information about where the problem is likely to be...") //onclickon(main.noisily.disable) //onclickoff(main.noisily.enable)
// title of the document
TEXT tx_title @ 322 50 ., label(Title)
EDIT title 80 @ 340 18 //EDIT ed_title +30 @ 340 .
// subtitle
TEXT tx_subtitle 20 +20 50 ., label(Subtitle)
EDIT subtitle 80 @ 340 18
// Author of the document
TEXT tx_author 20 +20 50 ., label(Author)
EDIT author 80 @ 340 18
// Affiliation
TEXT tx_affiliation 20 +20 55 ., label(Date/Aff)
EDIT affiliation 80 @ 340 18
// Address
//TEXT tx_address 20 +20 . ., label(Address)
//EDIT address 80 @ 340 18
// Summary
*TEXT tx_summary 20 +20 . ., label(Summary)
*EDIT summary 80 @ 340 50
// LEFT COLUMN
// ---------------------------------------------------------------------
// layout
* TEXT tx_style 220 134 200 . , label("Theme")
*BUTTON yamlgenerator @ +20 80 . , label("Generate...") onpush("view dialog yaml") //onpush("program sub_yaml")
//COMBOBOX style @ +20 100 . , dropdownlist contents(style_list)
* COMBOBOX theme @ +20 80 . , dropdownlist contents(theme_list)
* TEXT tx_color +100 134 200 . , label("Color")
* COMBOBOX color @ +20 80 . , dropdownlist contents(color_list)
// layout
TEXT tx_template 220 221 200 . , label("Use layout (css or tex)")
FILE template @ +20 200 . , error("Open file") label(Browse...) ///
filter("css file|*.css|LaTeX header Template|*.tex|Microsoft Word Template|*.docx|OpenOffice Template|*.odt|All files|*.*")
//CHECKBOX activate @ +31 200 . , label("Adjust linesize") default(0) onclickon("program subtest") onclickoff("program subtest")
//SPINNER linesize 340 @ 80 . , min(80) max(255) default(110) tooltip("Adjust the width of your document. If the specified linesize is less than the actual width, your document will show unreasonably disjoint lines or words.")
END
// -----------------------------------------------------------------------------
// PACKAGE VIGNETTE TAB
// =============================================================================
DIALOG vignette, tabtitle("Package Vignette")
BEGIN
// Browse ADO or MATA file
// -------------------------------------------------------------------------
TEXT txt_file 10 5 320 . , label(`"Select "ado" or "mata" file"')
FILE sourceFile 10 +20 420 . , error("Open file") label(Browse...) ///
filter("Ado file|*.ado|Mata file|*.mata") tooltip("markdoc can produce Stata help file by extracting the documentation from the source code. Select a script file to be used as the source of the document.") ///
onchange("script vignetteReset")
// Specify Markup, Format, Style
// -------------------------------------------------------------------------
TEXT tx_markup 10 +30 200 . , label("Markup language")
COMBOBOX markup @ +20 100 . , dropdownlist contents(helpfile_list) onselchange("program vintest") tooltip("markdoc supports a combination of Markdown and SMCL for writing the documentation. However, you also have the choice to just use SMCL, if you want to be very strict. Using Markdown is generally recommended.")
TEXT tx_format +120 -20 200 . , label("Document format")
//COMBOBOX format @ +20 100 . , dropdownlist contents(format_list) onselchange("program test") ////onselchange("script disablethem") //onselchange("main.master.disable") // onselchange("program test")
RADIO r1 @ +20 100 . , first label("sthlp") onclickon("program vintest") tooltip(`"Stata help file"') //option(nociforeground)
RADIO r2 +47 @ @ ., middle label("pdf") onclickon("program vintest") tooltip(`"producing PDF document requires wkhtmltopdf software, which you can install manually or by using the "install" option"')
RADIO r3 +42 @ @ ., middle label("html") onclickon("program vintest") //onclickon("script TeXoptions")
RADIO r4 +47 @ @ ., middle label("docx") onclickon("program vintest")
RADIO r5 +48 @ @ ., middle label("odt") onclickon("program vintest")
RADIO r6 +40 @ @ ., middle label("tex") onclickon("program vintest")
RADIO r7 +40 @ @ ., last label("md") onclickon("program vintest")
// GROUPBOX
// -------------------------------------------------------------------------
GROUPBOX gb_opts 10 +35 420 305, label("Options")
// RIGHT COLUMN
// ---------------------------------------------------------------------
// install
CHECKBOX install +10 +25 -20 . , option(install) label("Install required software") default(0) tooltip(`"markdoc requires "Pandoc" and "wkhtmltopdf" third-party software. It also requires 2 Stata packages which are "weaver" and "statax". This option automatically installs these software, if they are not already installed on your machine."')
// replace
CHECKBOX replace @ +17 @ . , option(replace) label("Replace the existing document") default(1)
// append template
CHECKBOX helplayout @ +17 @ . , option(helplayout) label("Append help-file template") default(0) tooltip("Check this button to append the template help-file to your ado or mata file")
// master
CHECKBOX master @ +17 @ . , option(master) label("Create HTML or LaTeX template") default(1) tooltip("LaTeX format requires a document template. Without the template, you will not be able to typeset the document to PDF. Usually you are required to create your own template, load the packages you need, etc. However, markdoc provides this option to facilitate writing with LaTeX and automatically creates the layout if you haven't defined it in the source file.")
// table of content
CHECKBOX toc @ +17 @ . , option(toc) label("Table of content")
// current date
CHECKBOX date @ +17 @ . , option(date) label("Add the current date")
// noisily
CHECKBOX minimode @ +17 @ . , option(mini) label("Avoid using Pandoc or wkhtmltopdf (mini mode)") tooltip("the mini mode runs markdoc without calling third-party software such as Pandoc or wkhtmltopdf. this mode is limited and does not fully support Markdown syntax, but it can produce a document on a machine that does not have thse software installed.") //onclickon(main.noisily.disable) //onclickoff(main.noisily.enable)
// title of the document
TEXT tx_title @ +47 50 ., label(Title)
EDIT title 80 @ 340 18 //EDIT ed_title +30 @ 340 .
// Author of the document
TEXT tx_author 20 +20 50 ., label(Author)
EDIT author 80 @ 340 18
// Affiliation
TEXT tx_affiliation 20 +20 55 ., label(Affiliation)
EDIT affiliation 80 @ 340 18
// Address
TEXT tx_address 20 +20 50 ., label(Address)
EDIT address 80 @ 340 18
// Summary
TEXT tx_summary 20 +20 60 ., label(Summary)
EDIT summary 80 @ 340 36
// LEFT COLUMN
// ---------------------------------------------------------------------
// layout
TEXT tx_style 220 135 200 . , label("Select document layout style")
COMBOBOX style @ +20 100 . , dropdownlist contents(style_list)
// layout
TEXT tx_template @ +31 200 . , label("Use layout (css, docx, tex, etc)")
FILE template @ +20 200 . , error("Open file") label(Browse...) ///
filter("css file|*.css|LaTeX header Template|*.tex|Microsoft Word Template|*.docx|OpenOffice Template|*.odt|All files|*.*")
//CHECKBOX activate @ +30 -20 . , label("Adjust linesize") default(0) onclickon("program vintest") onclickoff("program vintest")
//SPINNER linesize 340 @ 80 . , min(80) max(255) default(110) tooltip("Adjust the width of your document. If the specified linesize is less than the actual width, your document will show unreasonably disjoint lines or words.")
*TEXT tx_linesize @ +25 240 . , label("Adjust document linesize")
*SPINNER linesize 360 @ 60 . , min(80) max(255) default(100) tooltip("Adjust the width of your document. If the specified linesize is less than the actual width, your document will show unreasonably disjoint lines or words.")
END
// -----------------------------------------------------------------------------
// TEST PROGRAMS
// =============================================================================
// test for the main tab
// -----------------------------------------------------------------------------
PROGRAM test
BEGIN
// drop other source files
// -----------------------
if main.sourceFile.isneq("") {
sub.sourceFile.iseq("")
vignette.sourceFile.iseq("")
}
// activate the linesize
// ----------------------
*call main.linesize.disable
*if main.activate.iseq(0) {
* call main.linesize.disable
*}
*if main.activate.iseq(1) {
* call main.linesize.enable
*}
if main.markup.iseq("markdown") {
call main.r1.enable
call main.r2.enable
call main.r3.enable
call main.r4.enable
call main.r5.enable
call main.r6.enable
// Statax defaults
// ----------------------------------------------------------
if main.r4.iseq(1) | main.r5.iseq(1) | main.r6.iseq(1) {
call main.statax.disable
}
else {
call main.statax.enable
}
// master defaults
// ----------------------------------------------------------
if main.r1.iseq(1) | main.r3.iseq(1) {
call main.master.enable
}
else {
call main.master.disable
}
}
if main.markup.iseq("latex") {
call main.statax.disable
call main.master.enable
call main.r3.enable
call main.r1.disable
call main.r4.disable
call main.r5.disable
call main.r6.disable
}
if main.markup.iseq("html") {
call main.r1.enable
call main.r3.disable
call main.r4.disable
call main.r5.disable
call main.r6.disable
}
/*
if main.format.iseq("latex") {
call main.master.enable
}
*/
// master
/*
if main.format.iseq("tex") {
call main.master.enable
}
else {
call main.master.disable
}
*/
// STATAX
if main.format.iseq("html") | main.format.iseq("pdf") {
call main.statax.enable
}
else {
call main.statax.disable
}
END
// test for the sub tab
// -----------------------------------------------------------------------------
PROGRAM subtest
BEGIN
// drop other source files
// -----------------------
if sub.sourceFile.isneq("") {
main.sourceFile.iseq("")
vignette.sourceFile.iseq("")
}
// activate the linesize
// ----------------------
*call sub.linesize.disable
*if sub.activate.iseq(0) {
* call sub.linesize.disable
*}
*if sub.activate.iseq(1) {
* call sub.linesize.enable
*}
/*
if sub.r1.iseq(1) {
call sub.theme.enable
call sub.color.enable
call sub.font.enable
call sub.codesize.enable
call sub.bwidth.enable
call sub.bheight.enable
}
else {
call sub.theme.disable
call sub.color.disable
call sub.font.disable
call sub.codesize.disable
call sub.bwidth.disable
call sub.bheight.disable
}
*/
// else if the markup is Markdown
if sub.markup.iseq("markdown") & sub.r1.iseq(1) {
call sub.r1.enable
call sub.r2.enable
//call sub.r3.enable
call sub.master.disable
call sub.theme.enable
call sub.color.enable
call sub.font.enable
call sub.codesize.enable
call sub.bwidth.enable
call sub.bheight.enable
}
// else if the markup is LaTeX
else {
call sub.r2.disable
*call sub.r3.disable
*call sub.yamlgenerator.disable
if sub.r1.iseq(1) {
call sub.master.enable
}
else {
call sub.master.disable
}
call sub.theme.disable
call sub.color.disable
call sub.font.disable
call sub.codesize.disable
call sub.bwidth.disable
call sub.bheight.disable
}
END
// test for the vignette tab
// -----------------------------------------------------------------------------
PROGRAM vintest
BEGIN
// drop other source files
// -----------------------
if vignette.sourceFile.isneq("") {
main.sourceFile.iseq("")
sub.sourceFile.iseq("")
}
// activate the linesize
// ----------------------
*call vignette.linesize.disable
*if vignette.activate.iseq(0) {
* call vignette.linesize.disable
*}
*if vignette.activate.iseq(1) {
* call vignette.linesize.enable
*}
// else if the markup is Markdown
if vignette.markup.iseq("markdown+smcl") | vignette.markup.iseq("markdown") {
call vignette.r1.enable
call vignette.r2.enable
call vignette.r3.enable
call vignette.r4.enable
call vignette.r5.enable
call vignette.r6.enable
call vignette.r7.enable
call vignette.master.disable
*call vignette.yamlgenerator.enable
// master defaults
// -------------------------------------------------------------------
if vignette.r6.iseq(1) | vignette.r3.iseq(1) {
call vignette.master.enable
}
else {
call vignette.master.disable
}
}
// else
if vignette.markup.iseq("smcl") {
call vignette.r2.disable
call vignette.r3.disable
call vignette.r4.disable
call vignette.r5.disable
call vignette.r6.disable
call vignette.r7.disable
call vignette.master.disable
*call vignette.yamlgenerator.disable
}
/*
if vignette.r1.iseq(1) {
call vignette.build.enable
call vignette.toc.disable
call vignette.style.disable
call vignette.template.disable
call vignette.title.disable
call vignette.author.disable
call vignette.affiliation.disable
call vignette.address.disable
call vignette.summary.disable
}
if vignette.r1.iseq(0) {
call vignette.toc.enable
call vignette.style.enable
call vignette.template.enable
call vignette.title.enable
call vignette.author.enable
call vignette.affiliation.enable
call vignette.address.enable
call vignette.summary.enable
call vignette.build.disable
}
*/
END
PROGRAM sub_yaml
BEGIN
call create CHILD yaml , //nomodal //AS markdoc_title
//call yaml
END
PROGRAM activate
BEGIN
*if main.activate.iseq(1) {
* call main.linesize.enable
*}
*else {
* call main.linesize.disable
*}
END
// -----------------------------------------------------------------------------
// FINAL MARKDOC COMMAND
// =============================================================================
PROGRAM command
BEGIN
// You must load a file!
if ! main.sourceFile & ! sub.sourceFile & ! vignette.sourceFile {
require main.sourceFile
}
if ((main.sourceFile & sub.sourceFile) | (main.sourceFile & vignette.sourceFile) | (sub.sourceFile & vignette.sourceFile)) {
stopbox stop "multiple source files are selected in different tabs." ///
"Reset the dialogbox or remove the source files in other tabs."
}
put "markdoc "
// Main Tab
// -------------------------------------------------------------------------
if main.sourceFile {
//call sub.sourceFile.setvalue ""
put `"""'
require main.sourceFile
put main.sourceFile
put `"" , "'
put "markup(" main.markup ") "
if main.r1 {
put "export(html) "
}
if main.r2 {
put "export(pdf) "
}
if main.r3 {
put "export(tex) "
}
if main.r4 {
put "export(docx) "
}
if main.r5 {
put "export(odt) "
}
if main.r6 {
put "export(md) "
}
option main.replace // replace
option main.install // install
option main.statax // Statax syntax highlighter
option main.toc // table of content
option main.date // table of date
option main.numbered // numbered
option main.master // master
option main.mini // mini mode
*put "export(" main.format ") "
if main.style {
put "style(" `"""' main.style `"""' ") "
}
if main.template {
put "template(" `"""' main.template `"""' ") "
}
if main.title {
put "title(" `"""' main.title `"""' ") "
}
if main.author {
put "author(" `"""' main.author `"""' ") "
}
if main.affiliation {
put "affiliation(" `"""' main.affiliation `"""' ") "
}
if main.address {
put "address(" `"""' main.address `"""' ") "
}
if main.summary {
put "summary(" `"""' main.summary `"""' ") "
}
*if main.linesize {
* put "linesize(" main.linesize ") "
*}
}
// SLIDE TAB
// -------------------------------------------------------------------------
if sub.sourceFile {
put `"""'
require sub.sourceFile
put sub.sourceFile
put `"" , "'
put "markup(" sub.markup ") "
if sub.r1 {
put "export(slide) "
}
if sub.r2 {
put "export(slidy) "
}
//if sub.r3 {
// put "export(dzslide) "
//}
option sub.replace // replace
option sub.install // install
option sub.numbered // numbered
option sub.master // master
option sub.noisily // noisily
*put "export(" main.format ") "
//if main.style {
// put "style(" `"""' main.style `"""' ") "
//}
if sub.template {
put "template(" `"""' sub.template `"""' ") "
}
if sub.title {
put "title(" `"""' sub.title `"""' ") "
}
if sub.subtitle {
put "subtitle(" `"""' sub.subtitle `"""' ") "
}
if sub.author {
put "author(" `"""' sub.author `"""' ") "
}
if sub.affiliation {
put "affiliation(" `"""' sub.affiliation `"""' ") "
}
*if sub.linesize {
* put "linesize(" sub.linesize ") "
*}
// Beamer Layout
if sub.theme {
put "btheme(" sub.theme ") "
}
if sub.color {
put "bcolor(" sub.color ") "
}
if sub.font {