docgenerator 1.0.4 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/creole/creole2doc.rb +777 -0
- data/lib/creole/creole_inclusion_and_plugins.rb +236 -0
- data/lib/creole/creole_placeholder.rb +74 -0
- data/lib/creole/creole_tabular.rb +170 -0
- data/lib/docgenerator.rb +15 -6
- data/lib/docgenerator_attribute.rb +2 -2
- data/lib/docgenerator_characters.rb +20 -4
- data/lib/docgenerator_document.rb +132 -42
- data/lib/docgenerator_element.rb +531 -524
- data/lib/docgenerator_elements.rb +408 -399
- data/lib/docgenerator_environments.rb +28 -2
- data/lib/docgenerator_footnote.rb +72 -79
- data/lib/docgenerator_sections.rb +1 -1
- data/lib/docgenerator_tabular.rb +8 -3
- data/lib/packages/docgenerator_beamer.rb +253 -0
- data/lib/packages/docgenerator_scrlettr2.rb +53 -9
- data/lib/templates/docgenerator_template_css.rb +4 -0
- data/lib/wiki2doc/wiki2docgenerator.rb +1087 -970
- data/lib/yaml2presentation/yaml2presentation.rb +1091 -0
- data/self_docgenerator.rb +8 -6
- data/unittest/Red_Flower.jpg +0 -0
- data/unittest/creole1.0test.txt +128 -0
- data/unittest/expected/beamer_01_doc.html +1 -1
- data/unittest/expected/beamer_02_doc.html +1 -1
- data/unittest/expected/beamer_doc_html_overview_with_detailpic_and_text_doc.html +34 -0
- data/unittest/expected/beamer_doc_html_overview_with_detailpic_doc.html +34 -0
- data/unittest/expected/beamer_doc_key_doc.html +1 -1
- data/unittest/expected/beamer_doc_note_doc.html +1 -1
- data/unittest/expected/beamer_doc_pic_bottom_doc.html +1 -1
- data/unittest/expected/beamer_doc_pic_doc.html +1 -1
- data/unittest/expected/beamer_doc_pic_left_doc.html +1 -1
- data/unittest/expected/beamer_doc_pic_right_doc.html +1 -1
- data/unittest/expected/beamer_doc_pic_top_doc.html +1 -1
- data/unittest/expected/test_footnote.html +2 -2
- data/unittest/expected/test_footnote.latex +1 -1
- data/unittest/expected/test_footnote_group.html +3 -3
- data/unittest/expected/test_footnote_group.latex +2 -2
- data/unittest/expected_creole/test_creole.html +3 -0
- data/unittest/expected_creole/test_creole_characters_all.html +10 -0
- data/unittest/expected_creole/test_creole_characters_all.latex +20 -0
- data/unittest/expected_creole/test_creole_characters_special.html +10 -0
- data/unittest/expected_creole/test_creole_characters_special.latex +18 -0
- data/unittest/expected_creole/test_creole_countdown.html +3 -0
- data/unittest/expected_creole/test_creole_countdown.latex +4 -0
- data/unittest/expected_creole/test_creole_creole1.0test.html +182 -0
- data/unittest/expected_creole/test_creole_creole1.0test.latex +253 -0
- data/unittest/expected_creole/test_creole_creole1.0test.text +160 -0
- data/unittest/expected_creole/test_creole_footnotes.html +9 -0
- data/unittest/expected_creole/test_creole_footnotes.latex +14 -0
- data/unittest/expected_creole/test_creole_footnotes_label.html +9 -0
- data/unittest/expected_creole/test_creole_headings.html +17 -0
- data/unittest/expected_creole/test_creole_headings.latex +19 -0
- data/unittest/expected_creole/test_creole_headings.text +48 -0
- data/unittest/expected_creole/test_creole_headings.wiki +37 -0
- data/unittest/expected_creole/test_creole_hr.html +7 -0
- data/unittest/expected_creole/test_creole_hr.latex +9 -0
- data/unittest/expected_creole/test_creole_hr.text +4 -0
- data/unittest/expected_creole/test_creole_inline.html +3 -0
- data/unittest/expected_creole/test_creole_inline.latex +4 -0
- data/unittest/expected_creole/test_creole_inline.text +2 -0
- data/unittest/expected_creole/test_creole_inline_ruby.html +12 -0
- data/unittest/expected_creole/test_creole_inline_ruby.latex +20 -0
- data/unittest/expected_creole/test_creole_inline_ruby_raw.html +6 -0
- data/unittest/expected_creole/test_creole_inline_ruby_raw.latex +8 -0
- data/unittest/expected_creole/test_creole_input.normsource +23 -0
- data/unittest/expected_creole/test_creole_label.html +12 -0
- data/unittest/expected_creole/test_creole_label.latex +15 -0
- data/unittest/expected_creole/test_creole_line_break.html +6 -0
- data/unittest/expected_creole/test_creole_line_break.latex +8 -0
- data/unittest/expected_creole/test_creole_links_explicit_internal.html +6 -0
- data/unittest/expected_creole/test_creole_links_explicit_internal.text +4 -0
- data/unittest/expected_creole/test_creole_links_explicit_with_em.html +3 -0
- data/unittest/expected_creole/test_creole_links_explicit_with_em.latex +4 -0
- data/unittest/expected_creole/test_creole_links_explicit_with_em.text +2 -0
- data/unittest/expected_creole/test_creole_links_external.html +6 -0
- data/unittest/expected_creole/test_creole_links_external.latex +8 -0
- data/unittest/expected_creole/test_creole_links_external.text +4 -0
- data/unittest/expected_creole/test_creole_links_external_implicit.html +9 -0
- data/unittest/expected_creole/test_creole_links_external_implicit.latex +12 -0
- data/unittest/expected_creole/test_creole_links_external_implicit.text +6 -0
- data/unittest/expected_creole/test_creole_links_file.html +6 -0
- data/unittest/expected_creole/test_creole_links_file.latex +8 -0
- data/unittest/expected_creole/test_creole_links_file.text +4 -0
- data/unittest/expected_creole/test_creole_list_ol.html +12 -0
- data/unittest/expected_creole/test_creole_list_ol.latex +22 -0
- data/unittest/expected_creole/test_creole_list_ol_after_ul.html +12 -0
- data/unittest/expected_creole/test_creole_list_ol_after_ul.latex +20 -0
- data/unittest/expected_creole/test_creole_list_ol_after_ul.text +6 -0
- data/unittest/expected_creole/test_creole_list_ol_ul.html +15 -0
- data/unittest/expected_creole/test_creole_list_ol_ul.latex +26 -0
- data/unittest/expected_creole/test_creole_list_ul.html +22 -0
- data/unittest/expected_creole/test_creole_list_ul.latex +40 -0
- data/unittest/expected_creole/test_creole_list_ul.normsource +83 -0
- data/unittest/expected_creole/test_creole_list_ul_too_much.html +24 -0
- data/unittest/expected_creole/test_creole_list_ul_too_much.latex +44 -0
- data/unittest/expected_creole/test_creole_newline.html +9 -0
- data/unittest/expected_creole/test_creole_newline.latex +11 -0
- data/unittest/expected_creole/test_creole_newline.text +7 -0
- data/unittest/expected_creole/test_creole_paragraphs.html +6 -0
- data/unittest/expected_creole/test_creole_paragraphs.latex +8 -0
- data/unittest/expected_creole/test_creole_paragraphs.normsource +27 -0
- data/unittest/expected_creole/test_creole_paragraphs.text +4 -0
- data/unittest/expected_creole/test_creole_paragraphs.wiki +4 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap.html +5 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap.latex +6 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap.text +4 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap.wiki +4 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.html +9 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.latex +11 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.text +7 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap0.wiki +7 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.html +5 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.latex +6 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.text +4 -0
- data/unittest/expected_creole/test_creole_paragraphs_wrap60.wiki +4 -0
- data/unittest/expected_creole/test_creole_picture_link.html +6 -0
- data/unittest/expected_creole/test_creole_pictures.html +10 -0
- data/unittest/expected_creole/test_creole_pictures.latex +13 -0
- data/unittest/expected_creole/test_creole_pictures_css.html +3 -0
- data/unittest/expected_creole/test_creole_pictures_css.latex +4 -0
- data/unittest/expected_creole/test_creole_pictures_imgclass.html +6 -0
- data/unittest/expected_creole/test_creole_pictures_imgclass.latex +8 -0
- data/unittest/expected_creole/test_creole_placeholders_html.html +7 -0
- data/unittest/expected_creole/test_creole_placeholders_html.latex +8 -0
- data/unittest/expected_creole/test_creole_placeholders_html.text +4 -0
- data/unittest/expected_creole/test_creole_placeholders_latex.html +6 -0
- data/unittest/expected_creole/test_creole_placeholders_latex.latex +9 -0
- data/unittest/expected_creole/test_creole_placeholders_latex.text +4 -0
- data/unittest/expected_creole/test_creole_tabular.html +20 -0
- data/unittest/expected_creole/test_creole_tabular.latex +22 -0
- data/unittest/expected_creole/test_creole_tabular_creole.html +18 -0
- data/unittest/expected_creole/test_creole_tabular_creole.latex +19 -0
- data/unittest/expected_creole/test_creole_tabular_css.html +20 -0
- data/unittest/expected_creole/test_creole_tabular_css.latex +22 -0
- data/unittest/expected_creole/test_creole_toc.html +11 -0
- data/unittest/expected_creole/test_creole_toc.latex +22 -0
- data/unittest/expected_creole/test_creole_toc.text +4 -0
- data/unittest/expected_creole/test_creole_toc_text.html +5 -0
- data/unittest/expected_creole/test_creole_toc_text.latex +5 -0
- data/unittest/expected_creole/test_creole_ul_multiple_line.html +7 -0
- data/unittest/expected_creole/test_creole_ul_multiple_line.latex +14 -0
- data/unittest/expected_creole/test_creole_ul_with_blank.html +11 -0
- data/unittest/expected_creole/test_creole_ul_with_blank.latex +20 -0
- data/unittest/expected_creole/test_creole_ul_with_bold.creole +0 -0
- data/unittest/expected_creole/test_creole_ul_with_bold.html +11 -0
- data/unittest/expected_creole/test_creole_ul_with_bold.latex +18 -0
- data/unittest/expected_creole/test_creole_ul_with_bold.text +7 -0
- data/unittest/expected_creole/test_creole_verbatim.html +25 -0
- data/unittest/expected_creole/test_creole_verbatim.latex +33 -0
- data/unittest/expected_creole/test_creole_verbatim.text +17 -0
- data/unittest/expected_creole/test_creole_verbatim_inline.html +6 -0
- data/unittest/expected_creole/test_creole_verbatim_inline.latex +8 -0
- data/unittest/expected_creole/test_creole_verbatim_inline_at_start.html +6 -0
- data/unittest/expected_creole/test_creole_verbatim_inline_at_start.latex +8 -0
- data/unittest/expected_privat/test_creole_test_document.html +6 -0
- data/unittest/{expected → expected_wiki}/test_wiki.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_amazon.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_description.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_description.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_description.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_description.wiki +0 -0
- data/unittest/expected_wiki/test_wiki_footnote.html +8 -0
- data/unittest/expected_wiki/test_wiki_footnote.latex +17 -0
- data/unittest/{expected → expected_wiki}/test_wiki_footnote.text +2 -4
- data/unittest/expected_wiki/test_wiki_footnote.wiki +10 -0
- data/unittest/expected_wiki/test_wiki_footnote_2.html +8 -0
- data/unittest/expected_wiki/test_wiki_footnote_groupid.html +21 -0
- data/unittest/{expected → expected_wiki}/test_wiki_html_code.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_html_code.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_html_code.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_html_code.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_inline.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_inline.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_inline.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_inline.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_label.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_link.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_link.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_link.log +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_link.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_after_ul.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_after_ul.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_after_ul.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_after_ul.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_ul.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_ul.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_ul.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ol_ul.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul_too_much.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul_too_much.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul_too_much.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_list_ul_too_much.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_picture.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_picture.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_picture_thumb.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_tab1.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_tab1.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_tab1.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_textformatting.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_textformatting.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_textformatting.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_textformatting.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_toc.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_toc.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_toc.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_toc.wiki +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_ul_multiple_line.html +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_ul_multiple_line.latex +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_ul_multiple_line.text +0 -0
- data/unittest/{expected → expected_wiki}/test_wiki_ul_multiple_line.wiki +0 -0
- data/unittest/test_docgenerator.rb +1 -2
- data/unittest/unittest_creole2doc.rb +1024 -0
- data/unittest/unittest_docgenerator.rb +17 -8
- data/unittest/unittest_wiki2doc.rb +92 -88
- data/unittest/unittest_yaml2pres.rb +336 -0
- metadata +202 -70
- data/unittest/expected/test_wiki_footnote.html +0 -8
- data/unittest/expected/test_wiki_footnote.latex +0 -15
- data/unittest/expected/test_wiki_footnote.wiki +0 -12
- data/unittest/expected/test_wiki_footnote_groupid.html +0 -21
@@ -1,4 +1,4 @@
|
|
1
|
-
#~ @attr
|
1
|
+
#~ @attr = {:short=> 1}
|
2
2
|
#~ puts "\title#{"[#{@attr[:short]}]" if @attr[:short]}"
|
3
3
|
#~ __END__
|
4
4
|
|
@@ -11,34 +11,34 @@
|
|
11
11
|
#Main document control.
|
12
12
|
#
|
13
13
|
Element.create( [:head], {}, true,
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
Element.create( [:body],
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
14
|
+
{ :htmltag => 'head',
|
15
|
+
:latex => '#{@content}',
|
16
|
+
:text => '#{@content}',
|
17
|
+
:wiki => '#{@content}',
|
18
|
+
} )
|
19
|
+
Element.create( [:body], {
|
20
|
+
:bgcolor => Attribute.create( [ :html ] ),
|
21
|
+
:text => Attribute.create( [ :html ] ),
|
22
|
+
:link => Attribute.create( [ :html ] ),
|
23
|
+
:vlink => Attribute.create( [ :html ] ),
|
24
|
+
:alink => Attribute.create( [ :html ] ),
|
25
|
+
}.update(HTML_ATTR_CORE.dup.update(HTML_ATTR_I18N)),
|
26
|
+
true,
|
27
|
+
{ :htmltag => 'body',
|
28
|
+
:latex => '#{@content}',
|
29
|
+
:text => '#{@content}',
|
30
|
+
:wiki => '#{@content}',
|
31
|
+
} )
|
32
32
|
|
33
33
|
Element.create( [:latexdummy, :latexonly ], {},true,
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
{ :htmltag => nil,
|
35
|
+
:html => '',
|
36
|
+
:latex => '#{@content}'
|
37
|
+
} )
|
38
38
|
Element.create( [:htmldummy, :htmlonly ], {},true,
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
{ :html => '#{@content}',
|
40
|
+
:latex => ''
|
41
|
+
} )
|
42
42
|
|
43
43
|
|
44
44
|
#
|
@@ -47,89 +47,96 @@ Element.create( [:htmldummy, :htmlonly ], {},true,
|
|
47
47
|
#This parameter are better set with Document.title.
|
48
48
|
#
|
49
49
|
class Title < Element
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
50
|
+
Element.add( [:title], Title)
|
51
|
+
add_attributes( {
|
52
|
+
:short => Attribute.create( [ :html ], nil, 1 )
|
53
|
+
}.update(HTML_ATTR_ALL)
|
54
|
+
)
|
55
|
+
#Unsaubere realisierung .. fixme
|
56
|
+
def shortoption( options = {} )
|
57
|
+
@attr[:short].content.compact! #delete nils.
|
58
|
+
return nil if ! @attr[:short].filled?
|
59
59
|
o = Docgenerator_logger.set_option_defaults(options)
|
60
60
|
o[:log].debug("enter shortoption") if o[:log].debug?
|
61
61
|
if o[:document]
|
62
|
-
|
63
|
-
|
64
|
-
|
62
|
+
if o[:document].template[:latex].template.include?('Beamer')
|
63
|
+
return "[#{@attr[:short].content}]"
|
64
|
+
end
|
65
65
|
else
|
66
66
|
o[:log].info("No related document for shortoption") if o[:log].info?
|
67
67
|
end
|
68
68
|
return nil
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
69
|
+
end
|
70
|
+
#Add shorttitle as a meta-tag.
|
71
|
+
def shorttitle_html()
|
72
|
+
return nil if ! @attr[:short].filled?
|
73
|
+
return element( :meta, {:name => 'shorttitle', :content => @attr[:short].content }).to_html
|
74
|
+
end
|
75
|
+
|
76
|
+
add_output( :latex, '#{linebreak(@crbefore)}\title#{shortoption(o)}{#{@content}}#{linebreak(@crmid)}\hypersetup{pdftitle={#{@content}}}#{linebreak(@crafter)}')
|
77
|
+
#~ add_output( :latex, '#{linebreak(@crbefore)}\title{#{@content}}#{linebreak(@crmid)}\hypersetup{pdftitle={#{@content}}}#{linebreak(@crafter)}')
|
78
|
+
add_output( :html, '#{linebreak(@crbefore)}<title>#{@content}</title>#{linebreak(@crmid) if shorttitle_html}#{shorttitle_html}#{linebreak(@crafter)}')
|
79
|
+
|
80
|
+
add_output( :text, "\n" + '#{linebreak(@crbefore)}#{@content}#{linebreak(@crafter)}' + "\n")
|
81
|
+
add_output( :wiki, '#{linebreak(@crbefore)}' + '=#{@content}=' + ' #{linebreak(@crafter)}')
|
75
82
|
end
|
76
83
|
Element.create( [:meta], {
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
#
|
85
|
-
|
84
|
+
:name => Attribute.create( [ :html, :required ], nil, 1 ),
|
85
|
+
:content => Attribute.create( [ :html, :required ], nil, 2 ),
|
86
|
+
}, ENDTAG,
|
87
|
+
{
|
88
|
+
:htmltag => 'meta',
|
89
|
+
#~ :html => '<meta name="#{@attr[:name]}" content="#{@attr[:content]}">',
|
90
|
+
:latex => '',
|
91
|
+
# :latex => '#{linebreak(@crbefore)}' + '\author{#{@content}}\hypersetup{pdfauthor={#{@content}}}' + ' #{linebreak(@crafter)}'
|
92
|
+
} )
|
86
93
|
#Like Meta, but not name...
|
87
94
|
Element.create( [:meta2], {
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
#
|
96
|
-
|
95
|
+
:'http-equiv' => Attribute.create( [ :html, :required ], nil, 1 ),
|
96
|
+
:content => Attribute.create( [ :html, :required ], nil, 2 ),
|
97
|
+
}, nil,
|
98
|
+
{
|
99
|
+
:htmltag => 'meta',
|
100
|
+
#~ :html => '<meta name="#{@attr[:name]}" content="#{@attr[:content]}">',
|
101
|
+
:latex => '',
|
102
|
+
# :latex => '#{linebreak(@crbefore)}' + '\author{#{@content}}\hypersetup{pdfauthor={#{@content}}}' + ' #{linebreak(@crafter)}'
|
103
|
+
} )
|
97
104
|
|
98
105
|
Element.create( [:author], {}, true,
|
99
|
-
|
100
|
-
|
101
|
-
|
106
|
+
{ :html => '<meta name="author" content="#{@content}">' + ' #{linebreak(@crafter)}',
|
107
|
+
:latex => '#{linebreak(@crbefore)}\author{#{@content}}#{linebreak(@crmid)}\hypersetup{pdfauthor={#{@content}}}#{linebreak(@crafter)}'
|
108
|
+
} )
|
102
109
|
Element.create( [:date], {}, true,
|
103
|
-
|
104
|
-
|
105
|
-
|
110
|
+
{ :html => '<meta name="creation-date" content="#{@content}">' + ' #{linebreak(@crafter)}',
|
111
|
+
:latex => '#{linebreak(@crbefore)}\date{#{@content}}#{linebreak(@crafter)}'
|
112
|
+
} )
|
106
113
|
Element.create( [:keywords], {}, true,
|
107
|
-
|
108
|
-
|
109
|
-
|
114
|
+
{ :html => '<meta name="keywords" content="#{@content}">' + ' #{linebreak(@crafter)}',
|
115
|
+
:latex => '#{linebreak(@crbefore)}\hypersetup{pdfkeywords={#{@content}}}#{linebreak(@crafter)}'
|
116
|
+
} )
|
110
117
|
Element.create( [:metadescription], {}, true,
|
111
|
-
|
112
|
-
|
113
|
-
|
118
|
+
{ :html => '<meta name="description" content="#{@content}">' + ' #{linebreak(@crafter)}',
|
119
|
+
:latex => '#{linebreak(@crbefore)}\hypersetup{pdfsubject={#{@content}}}#{linebreak(@crafter)}'
|
120
|
+
} )
|
114
121
|
Element.create( [:creator], {}, true,
|
115
|
-
|
116
|
-
|
117
|
-
|
122
|
+
{ :html => '<meta name="creator" content="#{@content}">' + ' #{linebreak(@crafter)}',
|
123
|
+
:latex => '#{linebreak(@crbefore)}\hypersetup{pdfcreator={#{@content}}}#{linebreak(@crafter)}'
|
124
|
+
} )
|
118
125
|
#~ Element.create( [:hypersetup], {}, true,
|
119
|
-
|
120
|
-
|
121
|
-
|
126
|
+
#~ { :html => '<meta name="description" content="#{@content}">',
|
127
|
+
#~ :latex => '#{linebreak(@crbefore)}' + '\pdfinfo{description=#{@content}}' + ' #{linebreak(@crafter)}'
|
128
|
+
#~ } )
|
122
129
|
|
123
130
|
Element.create( [:maketitle], {}, false,
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
131
|
+
{ :htmltag => 'span', #Empty span
|
132
|
+
:html => "<!-- maketitle -->\n",
|
133
|
+
:latex => '#{linebreak(@crbefore)}' + '\maketitle #{linebreak(@crafter)}'
|
134
|
+
} )
|
128
135
|
#~ Element.create( [:tableofcontents], {}, false,
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
136
|
+
#~ { :htmltag => 'span', #Empty span
|
137
|
+
#~ :html => '#{linebreak(@crbefore)}<!-- tableofcontents -->#{linebreak(@crafter)}',
|
138
|
+
#~ :latex => '#{linebreak(@crbefore)}' + '\tableofcontents ' + ' #{linebreak(@crafter)}'
|
139
|
+
#~ } )
|
133
140
|
|
134
141
|
#Build table of contents.
|
135
142
|
#
|
@@ -137,15 +144,15 @@ Element.create( [:maketitle], {}, false,
|
|
137
144
|
#
|
138
145
|
#For LaTeX \tableofcontents is created, with attribute :as_list you can create a list.
|
139
146
|
class Tableofcontents < Element
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
+
Element.add( [:tableofcontents], Tableofcontents)
|
148
|
+
add_attributes( {
|
149
|
+
:level => Attribute.create( [ :html, :latex ], [Fixnum], 1 ),
|
150
|
+
:pre => Attribute.create( [ :html, :latex ], nil, 2 ),
|
151
|
+
:post => Attribute.create( [ :html, :latex ], nil, 2 ),
|
152
|
+
:as_list => Attribute.create( [ :latex ], [true, false], 2 ),
|
153
|
+
}.update(HTML_ATTR_ALL)
|
147
154
|
)
|
148
|
-
def content?(); return false;
|
155
|
+
def content?(); return false; end
|
149
156
|
def to_doc( target, options = {} )
|
150
157
|
o = Docgenerator_logger.set_option_defaults(options)
|
151
158
|
o[:log].debug("enter to_doc(#{target}) for #{self.inspect}, options: #{options.keys.inspect}") if o[:log].debug?
|
@@ -192,124 +199,124 @@ class Tableofcontents < Element
|
|
192
199
|
end
|
193
200
|
end
|
194
201
|
Element.create( [:addcontentsline], {
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
+
:file => Attribute.create( [ :latex, :required ], [ 'toc', 'lof', 'lot' ] ),
|
203
|
+
:depth => Attribute.create( [ :latex, :required ], [ -1, 0,1,2,3,4,5,6] ),
|
204
|
+
}, true,
|
205
|
+
{ #:htmltag => 'span', #Empty span
|
206
|
+
#:html => "<!-- tableofcontents -->\n",
|
207
|
+
:latex => '#{linebreak(@crbefore)}' + '\addcontentsline{#{@attr[:file]}}{#{@attr[:depth]}}{#{@content}}' + ' #{linebreak(@crafter)}'
|
208
|
+
} )
|
202
209
|
Element.create( [:addtocontents], {
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
210
|
+
:file => Attribute.create( [ :latex, :required ], [ 'toc', 'lof', 'lot' ] ),
|
211
|
+
}, true,
|
212
|
+
{ #:htmltag => 'span', #Empty span
|
213
|
+
#:html => "<!-- tableofcontents -->\n",
|
214
|
+
:latex => '#{linebreak(@crbefore)}' + '\addtocontents{#{@attr[:file]}}{#{@content}}' + ' #{linebreak(@crafter)}'
|
215
|
+
} )
|
209
216
|
|
210
217
|
#
|
211
218
|
#Generell paragraph handling.
|
212
219
|
#
|
213
|
-
Element.create( [:par, :p],
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
#~ par.add_output( :html,
|
220
|
-
#~ par.add_output( :latex,
|
221
|
-
|
222
|
-
Element.create( [:nobr],
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
220
|
+
Element.create( [:par, :p], HTML_ATTR_ALL, true,
|
221
|
+
{ :htmltag => 'p',
|
222
|
+
:latex => "\n\n" + '#{@content}' + "\n\n",
|
223
|
+
:text => "\n" + '#{@content}' + "\n", #siehe experimente/textformat.rb
|
224
|
+
:wiki => "\n" + '#{@content}' + "\n",
|
225
|
+
} )
|
226
|
+
#~ par.add_output( :html, '<p>#{@attr[:content]}</p>')
|
227
|
+
#~ par.add_output( :latex, '#{@content}\par')
|
228
|
+
|
229
|
+
Element.create( [:nobr], HTML_ATTR_ALL, true,
|
230
|
+
{ :htmltag => 'nobr',
|
231
|
+
:latex => '#{linebreak(@crbefore)}\mbox{#{@content}}#{linebreak(@crafter)}'
|
232
|
+
#~ :text => "\n" + '#{@content}' + "\n",
|
233
|
+
} )
|
227
234
|
|
228
235
|
Element.create( [:br, 'br/', 'br', :newline], {
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
+
:clear=> Attribute.create( [ :html ], ['all'] ),
|
237
|
+
},ENDTAG,
|
238
|
+
{ :htmltag => 'br',
|
239
|
+
:latex => '#{linebreak(@crbefore)}\newline' + ' #{linebreak(@crafter)}',
|
240
|
+
:text => "\n",
|
241
|
+
:wiki => '{{newline}}#{linebreak(@crafter)}',
|
242
|
+
} )
|
236
243
|
Element.create( [:hr, 'hr/', 'hr', :hrulefill], {
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
+
:clear=> Attribute.create( [ :html ], ['all'] ),
|
245
|
+
},ENDTAG,
|
246
|
+
{ :htmltag => 'hr',
|
247
|
+
:wiki => '----',
|
248
|
+
:text => '-' * 25,
|
249
|
+
:latex => '#{linebreak(@crbefore)}' + '\hrulefill' + ' #{linebreak(@crafter)}'
|
250
|
+
} )
|
244
251
|
|
245
252
|
Element.create( [:vfill], {},false,
|
246
|
-
|
247
|
-
|
248
|
-
|
253
|
+
{ :htmltag => nil,
|
254
|
+
:latex => '#{linebreak(@crbefore)}\vfill #{linebreak(@crafter)}'
|
255
|
+
} )
|
249
256
|
Element.create( [:hfill], {},false,
|
250
|
-
|
251
|
-
|
252
|
-
|
257
|
+
{ :htmltag => nil,
|
258
|
+
:latex => '#{linebreak(@crbefore)}\hfill #{linebreak(@crafter)}'
|
259
|
+
} )
|
253
260
|
|
254
261
|
Element.create( [:relax], {},false,
|
255
|
-
|
256
|
-
|
257
|
-
|
262
|
+
{ :htmltag => nil,
|
263
|
+
:latex => '#{linebreak(@crbefore)}\relax #{linebreak(@crafter)}'
|
264
|
+
} )
|
258
265
|
|
259
266
|
#
|
260
267
|
#Grouping
|
261
268
|
#
|
262
|
-
Element.create( [:span, :group],
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
+
Element.create( [:span, :group], HTML_ATTR_CORE, true,
|
270
|
+
{ :htmltag => 'span',
|
271
|
+
:latex => '#{linebreak(@crbefore)}' +
|
272
|
+
'\bgroup ' + '#{linebreak(@crmid)}' +
|
273
|
+
'#{@content}' + '#{linebreak(@crmid)}' +
|
274
|
+
'\egroup ' + '#{linebreak(@crafter)}'
|
275
|
+
} )
|
269
276
|
|
270
277
|
divattr = { :align => HTML_ATTR_ALIGN}
|
271
278
|
divattr.update( HTML_ATTR_CORE )
|
272
|
-
Element.create( [:div, :Group],
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
279
|
+
Element.create( [:div, :Group], divattr, true,
|
280
|
+
{ :htmltag => 'div',
|
281
|
+
:latex => '#{linebreak(@crbefore)}' +
|
282
|
+
'\begingroup ' + '#{linebreak(@crmid)}' +
|
283
|
+
'#{@content}' + '#{linebreak(@crmid)}' +
|
284
|
+
'\endgroup ' + '#{linebreak(@crafter)}',
|
278
285
|
:text => '#{@content}',
|
279
286
|
:wiki => '#{@content}',
|
280
|
-
|
287
|
+
} )
|
281
288
|
|
282
289
|
|
283
290
|
#Make a separator lin in code
|
284
|
-
Element.create( [:sepline],
|
285
|
-
|
286
|
-
|
287
|
-
|
291
|
+
Element.create( [:sepline], {}, false,
|
292
|
+
{ :html => "\n<!--" + '-' * 50 + " -->\n",
|
293
|
+
:latex => "\n%" + '-' * 50 + "\n"
|
294
|
+
} )
|
288
295
|
#Make a comment in code
|
289
|
-
Element.create( [:comment],
|
290
|
-
|
291
|
-
|
292
|
-
|
296
|
+
Element.create( [:comment], {}, true,
|
297
|
+
{ :htmltag => '<!-- #{@content} -->',
|
298
|
+
:latex => '#{linebreak(@crbefore)}' + '% ------- #{@content} -------' + ' #{linebreak(@crafter)}'
|
299
|
+
} )
|
293
300
|
|
294
301
|
#
|
295
302
|
#Links
|
296
303
|
#
|
297
304
|
#Better: \hypertarget, hyperlink (pdf)
|
298
305
|
Element.create( [ :url ],
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
306
|
+
HTML_ATTR_ALL,
|
307
|
+
true,
|
308
|
+
{
|
309
|
+
:html => '#{linebreak(@crbefore)}<a href="#{@content}">#{@content}</a>#{linebreak(@crafter)}',
|
310
|
+
:latex => '#{linebreak(@crbefore)}\url{#{@content}}#{linebreak(@crafter)}',
|
311
|
+
} )
|
305
312
|
|
306
313
|
Element.create( [ :ensuremath ],
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
314
|
+
{},
|
315
|
+
true,
|
316
|
+
{
|
317
|
+
:html => '#{@content}',
|
318
|
+
:latex => '\ensuremath{#{@content}}',
|
319
|
+
} )
|
313
320
|
|
314
321
|
#
|
315
322
|
#Internal reference
|
@@ -318,286 +325,288 @@ Element.create( [ :ensuremath ],
|
|
318
325
|
#
|
319
326
|
#For external links use :href.
|
320
327
|
class Href < Element
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
328
|
+
Element.add( [:a, :href], Href)
|
329
|
+
add_attributes( {
|
330
|
+
:href => Attribute.create( [ :html, :required ], [String], 1 ),
|
331
|
+
:hreflang => ATTR_LANG,
|
332
|
+
:alt => Attribute.create( [ :html ], [String], 2 ),
|
333
|
+
:name => Attribute.create( [ :html ], [String] ),
|
334
|
+
:longdesc => Attribute.create( [ :html ], [String] ),
|
335
|
+
:value => Attribute.create( [ :html ] ),
|
336
|
+
:shape => Attribute.create( [ :html ] ),
|
337
|
+
:coords => Attribute.create( [ :html ] ),
|
338
|
+
:target => Attribute.create( [ :html ], [ '_blank', '_parent', '_self', '_top' ] ),
|
339
|
+
}.update(HTML_ATTR_ALL)
|
340
|
+
)
|
341
|
+
def htmltag(); 'a'; end
|
342
|
+
def to_wiki( options = {} )
|
343
|
+
"[#{@attr[:href].to_s} #{@content.to_doc(:wiki, options)}]"
|
344
|
+
end
|
345
|
+
def to_latex( options = {} )
|
339
346
|
cmd = linebreak(@crbefore)
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
347
|
+
reference = @attr[:href].to_s
|
348
|
+
if reference.sub!(/\#/, '') #Internal reference
|
349
|
+
cmd << "\\hyperlink{#{reference}}{#{@content.to_doc(:latex, options)}}"
|
350
|
+
else #external reference
|
351
|
+
cmd << "\\href{#{reference}}{#{@content.to_doc(:latex, options)}}"
|
352
|
+
end
|
346
353
|
cmd << linebreak(@crafter)
|
347
354
|
cmd
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
355
|
+
end
|
356
|
+
def to_text( options = {} )
|
357
|
+
if @attr[:href].to_s == @content
|
358
|
+
@content.to_doc(:text, options)
|
359
|
+
else
|
360
|
+
#~ "<#{@attr[:href].to_s} #{@content}>" --> Problem: Wird gerne als komplette URL interpreitert
|
361
|
+
"#{@content.to_doc(:text, options)} (#{@attr[:href].to_s})"
|
362
|
+
end
|
363
|
+
end
|
357
364
|
end
|
358
365
|
|
359
366
|
#~ Element.create( [ :a, :href ],
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
367
|
+
#~ { :href => Attribute.create( [ :html, :required ], [String], 1 ),
|
368
|
+
#~ :hreflang => ATTR_LANG,
|
369
|
+
#~ :alt => Attribute.create( [ :html ], [String], 2 ),
|
370
|
+
#~ :name => Attribute.create( [ :html ], [String] ),
|
371
|
+
#~ :longdesc => Attribute.create( [ :html ], [String] ),
|
372
|
+
#~ :value => Attribute.create( [ :html ] ),
|
373
|
+
#~ :shape => Attribute.create( [ :html ] ),
|
374
|
+
#~ :coords => Attribute.create( [ :html ] ),
|
375
|
+
#~ :target => Attribute.create( [ :html ], [ '_blank', '_parent', '_self', '_top' ] ),
|
376
|
+
#~ }.update( HTML_ATTR_ALL ),
|
377
|
+
#~ true,
|
378
|
+
#~ {
|
379
|
+
#~ :htmltag => 'a',
|
380
|
+
#~ :latex => '\href{#{@attr[:href]}}{#{@content}}',
|
381
|
+
#~ } )
|
375
382
|
|
376
383
|
Element.create( [ :label ],
|
377
|
-
|
378
|
-
:name
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
384
|
+
{
|
385
|
+
:name => Attribute.create( [ :html, :latex, :required ] ),
|
386
|
+
}.update( HTML_ATTR_ALL ),
|
387
|
+
true,
|
388
|
+
{
|
389
|
+
#~ :htmltag => 'a',
|
390
|
+
:html => '#{linebreak(@crbefore)}<a name="#{@attr[:name]}">#{linebreak(@crmid)}#{@content}</a>#{linebreak(@crafter)}',
|
391
|
+
:latex => '#{linebreak(@crbefore)}\label{#{@attr[:name]}}#{linebreak(@crmid)}\hypertarget{#{@attr[:name]}}{#{@content}}#{linebreak(@crafter)}',
|
385
392
|
:text => '(#{@attr[:name]}) #{@content}',
|
386
393
|
:wiki => '#{linebreak(@crbefore)}[[??#{@attr[:name]}]]#{@content}#{linebreak(@crafter)}', #fixme wrong
|
387
|
-
|
394
|
+
} )
|
388
395
|
|
389
396
|
Element.create( [ :hypertarget ],
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
397
|
+
{ :href => Attribute.create( [ :html, :required ] ),
|
398
|
+
:alt => Attribute.create( [ :html ] ),
|
399
|
+
:longdesc => Attribute.create( [ :html ] ),
|
400
|
+
:value => Attribute.create( [ :html ] ),
|
401
|
+
:shape => Attribute.create( [ :html ] ),
|
402
|
+
:coords => Attribute.create( [ :html ] ),
|
403
|
+
}.update( HTML_ATTR_ALL ),
|
404
|
+
true,
|
405
|
+
{
|
406
|
+
#~ :htmltag => 'a',
|
407
|
+
:latex => '#{linebreak(@crbefore)}\hypertarget{#{@attr[:href]}}{#{@content}}#{linebreak(@crafter)}',
|
408
|
+
} )
|
402
409
|
|
403
410
|
Element.create( [ :link ],
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
411
|
+
{ :href => Attribute.create( [ :html, :required ], nil, 1 ),
|
412
|
+
:rel => Attribute.create( [ :html ], [String], 2 ),
|
413
|
+
:title => Attribute.create( [ :html ], nil, 3 ),
|
414
|
+
:type => Attribute.create( [ :html ], nil, 4 ),
|
415
|
+
}.update( HTML_ATTR_ALL ),
|
416
|
+
ENDTAG,
|
417
|
+
{
|
418
|
+
:htmltag => 'link',
|
419
|
+
#~ :latex => '',
|
420
|
+
} )
|
414
421
|
|
415
422
|
#
|
416
423
|
|
417
424
|
#
|
418
|
-
#TeX-Makro usepackage.
|
419
|
-
#
|
425
|
+
#Add a TeX-Makro usepackage.
|
426
|
+
#
|
427
|
+
#This method tries to load the package specific definitions in a file
|
428
|
+
# docgenerator_<<packagename>>
|
420
429
|
#
|
421
430
|
class Usepackage < Element
|
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
|
-
end
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
#~ :em
|
459
|
-
#~ :code
|
431
|
+
#Make the key known to the complete key-list of elements.
|
432
|
+
Element.add( [:usepackage], Usepackage)
|
433
|
+
#~ add_attributes( HTML_ATTR_ALL )
|
434
|
+
add_attributes( { :option => Attribute.create( ) } )
|
435
|
+
|
436
|
+
#With usepackage additional command may be defined.
|
437
|
+
#Here we load this special commands/elements if available.
|
438
|
+
def << ( content )
|
439
|
+
@content << content
|
440
|
+
#Load new makros if available
|
441
|
+
makrodefinitions = 'docgenerator_' + content + '.rb'
|
442
|
+
begin
|
443
|
+
require makrodefinitions
|
444
|
+
rescue LoadError
|
445
|
+
end
|
446
|
+
end
|
447
|
+
|
448
|
+
#Redefine standard output.
|
449
|
+
#Options are given, if an option is available.
|
450
|
+
#~ add_output( :latex, '\usepackage[#{@attr[:option]}]{#{@content}}' )
|
451
|
+
def to_latex( options = {} )
|
452
|
+
cmd = linebreak(@crbefore)
|
453
|
+
cmd << '\usepackage'
|
454
|
+
opt = @attr[:option].content
|
455
|
+
cmd << '[' + opt.join(',') + ']' if opt.size > 0
|
456
|
+
cmd << "{#{@content}}"
|
457
|
+
cmd << linebreak(@crafter)
|
458
|
+
return cmd
|
459
|
+
end
|
460
|
+
def to_html( options = {} )
|
461
|
+
return ''
|
462
|
+
end
|
463
|
+
end #Usepackage
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
#~ :em => {}, #complete it
|
468
|
+
#~ :code => {}, #complete it
|
460
469
|
Element.create( [:font], {
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
470
|
+
:size => Attribute.create([:html], [ Fixnum ]),
|
471
|
+
},true,
|
472
|
+
{ :htmltag => 'font',
|
473
|
+
#~ :latex => '\tiny ' #+ ' #{linebreak(@crafter)}'
|
474
|
+
} )
|
466
475
|
#Fixme: Jeweils :tinytex f�r ungeklammerte
|
467
476
|
Element.create( [:tiny ], {},true,
|
468
|
-
|
469
|
-
|
470
|
-
|
477
|
+
{ :html => '<span style="font-size:xx-small">#{@content}</span>',
|
478
|
+
:latex => '#{linebreak(@crbefore)}{\tiny #{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
479
|
+
} )
|
471
480
|
Element.create( [:scriptsize ], {},true,
|
472
|
-
|
473
|
-
|
474
|
-
|
481
|
+
{ :html => '<span style="font-size:x-small">#{@content}</span>',
|
482
|
+
:latex => '#{linebreak(@crbefore)}{\scriptsize #{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
483
|
+
} )
|
475
484
|
Element.create( [:footnotesize ], {},true,
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
#fixme \small oder {\small ..}
|
485
|
+
{ :html => '<span style="font-size:x-small">#{@content}</span>',
|
486
|
+
:latex => '#{linebreak(@crbefore)}{\footnotesize #{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
487
|
+
} )
|
488
|
+
#fixme \small oder {\small ..}
|
480
489
|
Element.create( [:small ], {},true,
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
490
|
+
{ #:html => '<span style="font-size:small">#{@content}</span>',
|
491
|
+
:htmltag => 'small',
|
492
|
+
:latex => '#{linebreak(@crbefore)}{\small #{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
493
|
+
} )
|
485
494
|
Element.create( [:normalsize ], {},true,
|
486
|
-
|
487
|
-
|
488
|
-
|
495
|
+
{ :html => '<span style="font-size:medium">#{@content}</span>',
|
496
|
+
:latex => '#{linebreak(@crbefore)}{\normalsize #{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
497
|
+
} )
|
489
498
|
Element.create( [:large ], {},true,
|
490
|
-
|
491
|
-
|
492
|
-
|
499
|
+
{ :html => '<span style="font-size:large">#{@content}</span>',
|
500
|
+
:latex => '#{linebreak(@crbefore)}{\large #{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
501
|
+
} )
|
493
502
|
Element.create( [:Large ], {},true,
|
494
|
-
|
495
|
-
|
496
|
-
|
503
|
+
{ :html => '<span style="font-size:x-large">#{@content}</span>',
|
504
|
+
:latex => '#{linebreak(@crbefore)}{\Large #{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
505
|
+
} )
|
497
506
|
Element.create( [:huge ], {},true,
|
498
|
-
|
499
|
-
|
500
|
-
|
507
|
+
{ :html => '<span style="font-size:xx-large">#{@content}</span>',
|
508
|
+
:latex => '#{linebreak(@crbefore)}{\huge #{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
509
|
+
} )
|
501
510
|
Element.create( [:Huge ], {},true,
|
502
|
-
|
503
|
-
|
504
|
-
|
511
|
+
{ :html => '<span style="font-size:xx-large">#{@content}</span>',
|
512
|
+
:latex => '#{linebreak(@crbefore)}{\Huge #{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
513
|
+
} )
|
505
514
|
|
506
515
|
Element.create( [:textbf, :strong ], {},true,
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
516
|
+
{ :htmltag => 'strong',
|
517
|
+
:latex => '#{linebreak(@crbefore)}\textbf{#{@content}}#{linebreak(@crafter)}',
|
518
|
+
:wiki => %q|#{linebreak(@crbefore)}'''#{@content}'''#{linebreak(@crafter)}|,
|
519
|
+
:text => '#{linebreak(@crbefore)}#{@content}#{linebreak(@crafter)}',
|
520
|
+
} )
|
512
521
|
Element.create( [:emph ], {},true,
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
522
|
+
{ :htmltag => 'em',
|
523
|
+
:latex => '#{linebreak(@crbefore)}\emph{#{@content}}#{linebreak(@crafter)}',
|
524
|
+
:wiki => '#{linebreak(@crbefore)}''#{@content}''#{linebreak(@crafter)}',
|
525
|
+
:text => '#{linebreak(@crbefore)}#{@content}#{linebreak(@crafter)}',
|
526
|
+
} )
|
518
527
|
|
519
528
|
Element.create( [:stroke ], {},true,
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
529
|
+
{ #:html => '<span style="font-size:small">#{@content}</span>',
|
530
|
+
:htmltag => 's',
|
531
|
+
#~ :latex => '#{linebreak(@crbefore)}{\stroke #{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
532
|
+
} )
|
524
533
|
|
525
534
|
Element.create( [:underline ], {},true,
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
535
|
+
{ #:html => '<span style="font-size:small">#{@content}</span>',
|
536
|
+
:htmltag => 'undeline',
|
537
|
+
:latex => '#{linebreak(@crbefore)}{\underline#{@content}}#{linebreak(@crafter)}' #+ ' #{linebreak(@crafter)}'
|
538
|
+
} )
|
530
539
|
|
531
540
|
Element.create( [:sup, :textsuperscript ], {}.update(HTML_ATTR_ALL),true,
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
541
|
+
{ :htmltag => 'sup',
|
542
|
+
:latex => '#{linebreak(@crbefore)}\textsuperscript{#{@content}}#{linebreak(@crafter)}',
|
543
|
+
:wiki => '#{linebreak(@crbefore)}^#{@content}^#{linebreak(@crafter)}',
|
544
|
+
:text => '#{linebreak(@crbefore)}^#{@content}^#{linebreak(@crafter)}'
|
545
|
+
} )
|
537
546
|
|
538
547
|
#
|
539
548
|
#Math function: sup
|
540
549
|
#~ Element.create( [:latexsup ], {}.update(HTML_ATTR_ALL),false,
|
541
|
-
|
542
|
-
|
543
|
-
|
550
|
+
#~ { :html => 'sup',
|
551
|
+
#~ :latex => '#{linebreak(@crbefore)}\sup}#{linebreak(@crafter)}'
|
552
|
+
#~ } )
|
544
553
|
|
545
554
|
Element.create( [:sub ], {}.update(HTML_ATTR_ALL),true,
|
546
|
-
|
547
|
-
|
548
|
-
|
555
|
+
{ :htmltag => 'sub',
|
556
|
+
#:latex => '\emph{#{@content}}'
|
557
|
+
} )
|
549
558
|
|
550
|
-
|
559
|
+
|
551
560
|
Element.create( [:newpage ], {},false,
|
552
|
-
|
553
|
-
|
554
|
-
|
561
|
+
{ #:htmltag => '',
|
562
|
+
:latex => '#{linebreak(@crbefore)}\newpage #{linebreak(@crafter)}'
|
563
|
+
} )
|
555
564
|
Element.create( [:clearpage ], {},false,
|
556
|
-
|
557
|
-
|
558
|
-
|
565
|
+
{ #:htmltag => '',
|
566
|
+
:latex => '#{linebreak(@crbefore)}' + '\clearpage ' + ' #{linebreak(@crafter)}'
|
567
|
+
} )
|
559
568
|
Element.create( [:twocolumn ], {},false,
|
560
|
-
|
561
|
-
|
562
|
-
|
569
|
+
{ #:htmltag => '',
|
570
|
+
:latex => '#{linebreak(@crbefore)}' + '\twocolumn ' + ' #{linebreak(@crafter)}'
|
571
|
+
} )
|
563
572
|
#fixme: TeX kein content, HTML hat content
|
564
573
|
Element.create( [:centering ], {},false,
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
#~ :link
|
570
|
-
#~ :center
|
571
|
-
#~ :map
|
572
|
-
#~ :area
|
574
|
+
{ :htmltag => 'center',
|
575
|
+
:latex => '\centering ' + ' #{linebreak(@crafter)}'
|
576
|
+
} )
|
577
|
+
|
578
|
+
#~ :link => {}, #complete it
|
579
|
+
#~ :center => {}, #complete it
|
580
|
+
#~ :map => all.update({}), #complete it
|
581
|
+
#~ :area => all.update({}), #complete it
|
573
582
|
#~ :option=> {:value=>nil}, #complete it
|
574
583
|
#~ :select=> events.update({}), #complete it
|
575
584
|
|
576
585
|
Element.create( :input, {}, true, {
|
577
|
-
|
586
|
+
:latex => '#{linebreak(@crbefore)}\input{#{@content}}#{linebreak(@crafter)}'
|
578
587
|
} )
|
579
588
|
Element.create( :include, {}, true, {
|
580
|
-
|
589
|
+
:latex => '#{linebreak(@crbefore)}\include{#{@content}}#{linebreak(@crafter)}'
|
581
590
|
} )
|
582
591
|
|
583
592
|
|
584
593
|
Element.create( [:img, :includegraphics],
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
594
|
+
{
|
595
|
+
:src => Attribute.create([:html, :latex, :required], [ String ], 1),
|
596
|
+
:alt => Attribute.create([:html], [String], 2 ),
|
597
|
+
:style => Attribute.create([:html], [String] ),
|
598
|
+
:width => Attribute.create([:texkeyval], [Integer, String] ), #String for \textwidth... for HTML use CSS
|
599
|
+
:height => Attribute.create([:texkeyval], [Integer, String] ), #String for \textwidth... for HTML use CSS
|
600
|
+
:border => Attribute.create([:html], [Integer] ),
|
601
|
+
:longdesc => Attribute.create([:html], [String] ),
|
602
|
+
:usemap => Attribute.create([:html], [String] ),
|
603
|
+
:name => Attribute.create([:html], [String] ),
|
604
|
+
:angle => Attribute.create([:texkeyval], [Integer] ), #Rotation angle.
|
605
|
+
:align => HTML_ATTR_ALIGN,
|
606
|
+
}.update(HTML_ATTR_CORE), ENDTAG,
|
607
|
+
{ #:html => '<span style="font-size:xx-small">#{@content}</span>',
|
608
|
+
:htmltag => 'img',
|
609
|
+
:latex => '#{linebreak(@crbefore)}\includegraphics[#{texkeyval}]{#{@attr[:src]}}#{linebreak(@crafter)}'
|
610
|
+
}
|
602
611
|
)
|
603
612
|
|