muwu 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/muwu +5 -0
- data/lib/muwu.rb +38 -0
- data/lib/muwu/cli/cli.rb +143 -0
- data/lib/muwu/cli/cli_help.rb +28 -0
- data/lib/muwu/cli/help/compile +22 -0
- data/lib/muwu/cli/help/concat +8 -0
- data/lib/muwu/cli/help/heading +2 -0
- data/lib/muwu/cli/help/inspect +7 -0
- data/lib/muwu/cli/help/new +8 -0
- data/lib/muwu/cli/help/reset +14 -0
- data/lib/muwu/cli/help/summary +14 -0
- data/lib/muwu/controller/controller.rb +120 -0
- data/lib/muwu/controller/controller_interaction.rb +146 -0
- data/lib/muwu/default/default.rb +51 -0
- data/lib/muwu/destination/destination.rb +212 -0
- data/lib/muwu/destination_builder/destination_builder.rb +127 -0
- data/lib/muwu/helper/hash_helper.rb +37 -0
- data/lib/muwu/helper/html_href_helper.rb +101 -0
- data/lib/muwu/helper/outline_helper.rb +160 -0
- data/lib/muwu/helper/regexp_lib.rb +101 -0
- data/lib/muwu/helper/sanitizer_helper.rb +50 -0
- data/lib/muwu/manifest/manifest.rb +158 -0
- data/lib/muwu/manifest_builder/manifest_builder.rb +102 -0
- data/lib/muwu/manifest_task/contents.rb +42 -0
- data/lib/muwu/manifest_task/document_css.rb +25 -0
- data/lib/muwu/manifest_task/document_html.rb +69 -0
- data/lib/muwu/manifest_task/document_js.rb +25 -0
- data/lib/muwu/manifest_task/metadata.rb +35 -0
- data/lib/muwu/manifest_task/navigator.rb +29 -0
- data/lib/muwu/manifest_task/subcontents.rb +48 -0
- data/lib/muwu/manifest_task/text.rb +51 -0
- data/lib/muwu/manifest_task/text_item.rb +124 -0
- data/lib/muwu/manifest_task/title.rb +34 -0
- data/lib/muwu/manifest_task_builder/contents_builder.rb +88 -0
- data/lib/muwu/manifest_task_builder/document_css_builder.rb +63 -0
- data/lib/muwu/manifest_task_builder/document_html_builder.rb +210 -0
- data/lib/muwu/manifest_task_builder/document_js_builder.rb +69 -0
- data/lib/muwu/manifest_task_builder/metadata_builder.rb +118 -0
- data/lib/muwu/manifest_task_builder/navigator_builder.rb +78 -0
- data/lib/muwu/manifest_task_builder/subcontents_builder.rb +90 -0
- data/lib/muwu/manifest_task_builder/text_builder.rb +125 -0
- data/lib/muwu/manifest_task_builder/text_item_builder.rb +314 -0
- data/lib/muwu/manifest_task_builder/title_builder.rb +122 -0
- data/lib/muwu/project/project.rb +430 -0
- data/lib/muwu/project_builder/assets/config/css/base/html_elements.scss +138 -0
- data/lib/muwu/project_builder/assets/config/css/base/index.scss +11 -0
- data/lib/muwu/project_builder/assets/config/css/base/mixin_text_section_heading.scss +23 -0
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_contents.scss +58 -0
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_metadata.scss +17 -0
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_navigator.scss +13 -0
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_subcontents.scss +58 -0
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_text.scss +48 -0
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_title.scss +22 -0
- data/lib/muwu/project_builder/assets/config/css/colors/dark.scss +32 -0
- data/lib/muwu/project_builder/assets/config/css/colors/index.scss +1 -0
- data/lib/muwu/project_builder/assets/config/css/colors/light.scss +34 -0
- data/lib/muwu/project_builder/assets/config/css/extensions/index.scss +1 -0
- data/lib/muwu/project_builder/assets/config/css/index.scss +19 -0
- data/lib/muwu/project_builder/assets/config/css_debugger/debug_section_text.scss +27 -0
- data/lib/muwu/project_builder/project_reader.rb +144 -0
- data/lib/muwu/project_builder/project_reset_css.rb +95 -0
- data/lib/muwu/project_builder/project_starter.rb +27 -0
- data/lib/muwu/project_builder/project_validator.rb +157 -0
- data/lib/muwu/project_builder/project_writer.rb +127 -0
- data/lib/muwu/project_exception/css_manifest_file_not_found.rb +23 -0
- data/lib/muwu/project_exception/dry_output_recommended_with_multiple_documents.rb +19 -0
- data/lib/muwu/project_exception/metadata_file_not_found.rb +24 -0
- data/lib/muwu/project_exception/metadata_value_not_given.rb +42 -0
- data/lib/muwu/project_exception/multiple_documents_outlined_with_stdout.rb +18 -0
- data/lib/muwu/project_exception/multiple_formats_requested_with_stdout.rb +18 -0
- data/lib/muwu/project_exception/navigator_not_recommended_with_stdout.rb +23 -0
- data/lib/muwu/project_exception/navigators_will_be_generated_automatically.rb +23 -0
- data/lib/muwu/project_exception/option_key_not_understood.rb +23 -0
- data/lib/muwu/project_exception/option_not_validatable.rb +23 -0
- data/lib/muwu/project_exception/option_value_not_understood.rb +24 -0
- data/lib/muwu/project_exception/options_file_not_found.rb +24 -0
- data/lib/muwu/project_exception/outline_file_not_found.rb +24 -0
- data/lib/muwu/project_exception/outline_step_not_understood.rb +23 -0
- data/lib/muwu/project_exception/output_already_open.rb +18 -0
- data/lib/muwu/project_exception/output_not_open.rb +18 -0
- data/lib/muwu/project_exception/subcontents_will_be_generated_automatically copy.rb +23 -0
- data/lib/muwu/project_exception/target_project_folder_already_exists.rb +24 -0
- data/lib/muwu/project_exception/text_source_file_not_found.rb +26 -0
- data/lib/muwu/project_exception_handler/fatal.rb +39 -0
- data/lib/muwu/project_options/project_options.rb +54 -0
- data/lib/muwu/project_options_builder/project_option_validator.rb +37 -0
- data/lib/muwu/project_options_builder/project_option_validator_key.rb +56 -0
- data/lib/muwu/project_options_builder/project_option_validator_value.rb +300 -0
- data/lib/muwu/project_options_builder/project_options_reader.rb +80 -0
- data/lib/muwu/render_concat/render_concat.rb +80 -0
- data/lib/muwu/render_html/render_html.rb +101 -0
- data/lib/muwu/render_html/render_markup_to_html.rb +87 -0
- data/lib/muwu/render_html_builder/render_css_builder.rb +34 -0
- data/lib/muwu/render_html_builder/render_html_builder.rb +34 -0
- data/lib/muwu/render_html_builder/render_js_builder.rb +34 -0
- data/lib/muwu/render_html_partial/js_library/_init_bare.js +7 -0
- data/lib/muwu/render_html_partial/js_library/_zepto.min.js +2 -0
- data/lib/muwu/render_html_partial/js_library/init.js +10 -0
- data/lib/muwu/render_html_partial/js_library/navigation.js +140 -0
- data/lib/muwu/render_html_partial/render_contents.rb +369 -0
- data/lib/muwu/render_html_partial/render_document_css.rb +45 -0
- data/lib/muwu/render_html_partial/render_document_html.rb +397 -0
- data/lib/muwu/render_html_partial/render_document_js.rb +37 -0
- data/lib/muwu/render_html_partial/render_js_library.rb +54 -0
- data/lib/muwu/render_html_partial/render_metadata.rb +120 -0
- data/lib/muwu/render_html_partial/render_navigator.rb +136 -0
- data/lib/muwu/render_html_partial/render_subcontents.rb +374 -0
- data/lib/muwu/render_html_partial/render_text.rb +74 -0
- data/lib/muwu/render_html_partial/render_text_item.rb +230 -0
- data/lib/muwu/render_html_partial/render_title.rb +71 -0
- data/lib/muwu/render_html_partial_builder/render_contents_builder.rb +100 -0
- data/lib/muwu/render_html_partial_builder/render_document_css_builder.rb +46 -0
- data/lib/muwu/render_html_partial_builder/render_document_html_builder.rb +211 -0
- data/lib/muwu/render_html_partial_builder/render_document_js_builder.rb +52 -0
- data/lib/muwu/render_html_partial_builder/render_metadata_builder.rb +47 -0
- data/lib/muwu/render_html_partial_builder/render_navigator_builder.rb +74 -0
- data/lib/muwu/render_html_partial_builder/render_subcontents_builder.rb +85 -0
- data/lib/muwu/render_html_partial_builder/render_text_builder.rb +86 -0
- data/lib/muwu/render_html_partial_builder/render_text_item_builder.rb +274 -0
- data/lib/muwu/render_html_partial_builder/render_title_builder.rb +47 -0
- data/lib/muwu/render_inspector/render_inspector.rb +224 -0
- data/lib/muwu/var/deflistdiv.rb +239 -0
- data/lib/muwu_loader.rb +35 -0
- data/test/what_no_tests.md +5 -0
- metadata +251 -0
@@ -0,0 +1,54 @@
|
|
1
|
+
module Muwu
|
2
|
+
module RenderHtmlPartial
|
3
|
+
class JsLibrary
|
4
|
+
|
5
|
+
|
6
|
+
include Muwu
|
7
|
+
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
js_lib_folder = File.join(File.dirname(__FILE__), 'js_library')
|
11
|
+
@js_lib_path = File.absolute_path(js_lib_folder)
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
public
|
16
|
+
|
17
|
+
|
18
|
+
def file_init
|
19
|
+
read_js_lib_file('init.js')
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
def file_navigation
|
24
|
+
read_js_lib_file('navigation.js')
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
def find(symbol)
|
29
|
+
case symbol
|
30
|
+
when :init
|
31
|
+
file_init
|
32
|
+
when :navigation
|
33
|
+
file_navigation
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
|
42
|
+
def js_lib_filepath_to(filename)
|
43
|
+
File.absolute_path(File.join(@js_lib_path, filename))
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
def read_js_lib_file(filename)
|
48
|
+
File.read(js_lib_filepath_to(filename))
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
module Muwu
|
2
|
+
module RenderHtmlPartial
|
3
|
+
class Metadata
|
4
|
+
|
5
|
+
|
6
|
+
include Muwu
|
7
|
+
|
8
|
+
|
9
|
+
attr_accessor(
|
10
|
+
:destination,
|
11
|
+
:metadata
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
def render
|
16
|
+
@destination.margin_to_zero
|
17
|
+
@destination.padding_vertical(1) do
|
18
|
+
write_tag_div_open
|
19
|
+
render_dl
|
20
|
+
write_tag_div_close
|
21
|
+
end
|
22
|
+
@destination.margin_to_zero
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
def render_dl
|
27
|
+
@destination.margin_indent do
|
28
|
+
write_tag_dl_open
|
29
|
+
render_dl_metadata_div
|
30
|
+
write_tag_dl_close
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
def render_dl_metadata_div
|
36
|
+
@destination.margin_indent do
|
37
|
+
@metadata.each_pair do |key, value|
|
38
|
+
write_tag_div_metadata(key, value)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
def write_tag_div_close
|
45
|
+
@destination.write_line tag_div_close
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
def write_tag_div_open
|
50
|
+
@destination.write_line tag_div_open
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
def write_tag_dl_close
|
55
|
+
@destination.write_line tag_dl_close
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
def write_tag_dl_open
|
60
|
+
@destination.write_line tag_dl_open
|
61
|
+
end
|
62
|
+
|
63
|
+
|
64
|
+
def write_tag_div_metadata(key, value)
|
65
|
+
@destination.write_line tag_dl_div_open
|
66
|
+
@destination.margin_indent do
|
67
|
+
@destination.write_line tag_dt_key(key)
|
68
|
+
@destination.write_line tag_dd_value(value)
|
69
|
+
end
|
70
|
+
@destination.write_line tag_dl_div_close
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
private
|
76
|
+
|
77
|
+
|
78
|
+
def tag_dd_value(value)
|
79
|
+
"<dd>#{value}</dd>"
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
def tag_div_close
|
84
|
+
"</div>"
|
85
|
+
end
|
86
|
+
|
87
|
+
|
88
|
+
def tag_div_open
|
89
|
+
"<div class='metadata'>"
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
def tag_dl_close
|
94
|
+
"</dl>"
|
95
|
+
end
|
96
|
+
|
97
|
+
|
98
|
+
def tag_dl_div_close
|
99
|
+
tag_div_close
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
def tag_dl_div_open
|
104
|
+
"<div>"
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
def tag_dl_open
|
109
|
+
"<dl>"
|
110
|
+
end
|
111
|
+
|
112
|
+
|
113
|
+
def tag_dt_key(key)
|
114
|
+
"<dt>#{key}</dt>"
|
115
|
+
end
|
116
|
+
|
117
|
+
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,136 @@
|
|
1
|
+
module Muwu
|
2
|
+
module RenderHtmlPartial
|
3
|
+
class Navigator
|
4
|
+
|
5
|
+
|
6
|
+
attr_accessor(
|
7
|
+
:destination,
|
8
|
+
:heading,
|
9
|
+
:href_document_home,
|
10
|
+
:href_document_next,
|
11
|
+
:href_document_prev
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
def render
|
16
|
+
@destination.margin_to_zero
|
17
|
+
@destination.padding_vertical(1) do
|
18
|
+
write_tag_div_open
|
19
|
+
# render_heading
|
20
|
+
write_tag_nav_open
|
21
|
+
render_prev
|
22
|
+
render_home
|
23
|
+
render_next
|
24
|
+
write_tag_nav_close
|
25
|
+
write_tag_div_close
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
def render_heading
|
31
|
+
write_tag_heading
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
def render_prev
|
36
|
+
write_tag_a_prev
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
def render_home
|
41
|
+
write_tag_a_home
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
def render_next
|
46
|
+
write_tag_a_next
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
def write_tag_a_home
|
51
|
+
@destination.write_line tag_a_home
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
def write_tag_a_next
|
56
|
+
@destination.write_line tag_a_next
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
def write_tag_a_prev
|
61
|
+
@destination.write_line tag_a_prev
|
62
|
+
end
|
63
|
+
|
64
|
+
|
65
|
+
def write_tag_div_close
|
66
|
+
@destination.write_line tag_div_close
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
def write_tag_div_open
|
71
|
+
@destination.write_line tag_div_open
|
72
|
+
end
|
73
|
+
|
74
|
+
|
75
|
+
def write_tag_heading
|
76
|
+
@destination.write_line tag_heading
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
def write_tag_nav_open
|
81
|
+
@destination.write_line tag_nav_open
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
def write_tag_nav_close
|
86
|
+
@destination.write_line tag_nav_close
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
private
|
92
|
+
|
93
|
+
|
94
|
+
def tag_a_home
|
95
|
+
"<a class='document_link' href='#{@href_document_home}'>[home]</a>"
|
96
|
+
end
|
97
|
+
|
98
|
+
|
99
|
+
def tag_a_next
|
100
|
+
"<a class='document_link' href='#{@href_document_next}'>[next]</a>"
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
def tag_a_prev
|
105
|
+
"<a class='document_link' href='#{@href_document_prev}'>[prev]</a>"
|
106
|
+
end
|
107
|
+
|
108
|
+
|
109
|
+
def tag_div_close
|
110
|
+
"</div>"
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
def tag_div_open
|
115
|
+
"<div class='navigator'>"
|
116
|
+
end
|
117
|
+
|
118
|
+
|
119
|
+
def tag_heading
|
120
|
+
"<h1>#{@heading}</h1>"
|
121
|
+
end
|
122
|
+
|
123
|
+
|
124
|
+
def tag_nav_close
|
125
|
+
"</nav>"
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
def tag_nav_open
|
130
|
+
"<nav class='document_links'>"
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
@@ -0,0 +1,374 @@
|
|
1
|
+
module Muwu
|
2
|
+
module RenderHtmlPartial
|
3
|
+
class Subcontents
|
4
|
+
|
5
|
+
|
6
|
+
include Muwu
|
7
|
+
|
8
|
+
|
9
|
+
attr_accessor(
|
10
|
+
:destination,
|
11
|
+
:href_helper,
|
12
|
+
:html_attr_id,
|
13
|
+
:item_depth_max,
|
14
|
+
:project,
|
15
|
+
:sections,
|
16
|
+
:text_root_block,
|
17
|
+
:text_root_blocks,
|
18
|
+
:text_root_name,
|
19
|
+
:will_render_section_numbers
|
20
|
+
)
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
public
|
25
|
+
|
26
|
+
|
27
|
+
def render
|
28
|
+
@destination.margin_to_zero
|
29
|
+
@destination.padding_vertical(1) do
|
30
|
+
write_tag_div_open
|
31
|
+
render_project_title
|
32
|
+
@text_root_blocks.each do |text_root_block|
|
33
|
+
render_contents_element(text_root_block.sections)
|
34
|
+
end
|
35
|
+
write_tag_div_close
|
36
|
+
end
|
37
|
+
@destination.margin_to_zero
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
def render_contents_element(sections)
|
42
|
+
@destination.margin_indent do
|
43
|
+
case @will_render_section_numbers
|
44
|
+
when false
|
45
|
+
render_ol(sections)
|
46
|
+
when true
|
47
|
+
render_table(sections)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
def render_ol(sections)
|
54
|
+
write_tag_ol_open
|
55
|
+
@destination.margin_indent do
|
56
|
+
sections.each do |section|
|
57
|
+
render_ol_li(section)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
write_tag_ol_close
|
61
|
+
end
|
62
|
+
|
63
|
+
|
64
|
+
def render_ol_li(section)
|
65
|
+
if task_depth_is_within_range(section)
|
66
|
+
case section
|
67
|
+
when ManifestTask::TextReadfile
|
68
|
+
write_tag_li_open
|
69
|
+
render_ol_li_heading(section)
|
70
|
+
write_tag_li_close_inline
|
71
|
+
when ManifestTask::TextGroup
|
72
|
+
write_tag_li_open
|
73
|
+
@destination.margin_indent do
|
74
|
+
render_ol_li_heading_and_text_item(section)
|
75
|
+
end
|
76
|
+
write_tag_li_close_outline
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
|
82
|
+
def render_ol_li_heading(text_item)
|
83
|
+
render_tag_a_section_heading(text_item)
|
84
|
+
end
|
85
|
+
|
86
|
+
|
87
|
+
def render_ol_li_heading_and_text_item(text_item)
|
88
|
+
render_tag_a_section_heading(text_item, trailing_line_feed: true)
|
89
|
+
render_ol(text_item.sections)
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
def render_project_title
|
94
|
+
write_tag_h1_title
|
95
|
+
end
|
96
|
+
|
97
|
+
|
98
|
+
def render_table(sections)
|
99
|
+
write_tag_table_open
|
100
|
+
@destination.margin_indent do
|
101
|
+
sections.each do |section|
|
102
|
+
render_table_tr(section)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
write_tag_table_close
|
106
|
+
end
|
107
|
+
|
108
|
+
|
109
|
+
def render_table_tr(section)
|
110
|
+
if task_depth_is_within_range(section)
|
111
|
+
html_id = ['subcontents', @text_root_name, section.numbering.join('_')].join('_')
|
112
|
+
write_tag_tr_open(html_id)
|
113
|
+
@destination.margin_indent do
|
114
|
+
if section.is_parent_heading
|
115
|
+
render_table_tr_td_number(section)
|
116
|
+
render_table_tr_td_heading_and_text_item(section)
|
117
|
+
elsif section.is_not_parent_heading
|
118
|
+
render_table_tr_td_number(section)
|
119
|
+
render_table_tr_td_heading(section)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
write_tag_tr_close
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
|
127
|
+
def render_table_tr_td_heading(text_item)
|
128
|
+
write_tag_td_open(attr_list: "class='heading'")
|
129
|
+
render_tag_a_section_heading(text_item)
|
130
|
+
write_tag_td_close_inline
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
def render_table_tr_td_heading_and_text_item(text_item)
|
135
|
+
write_tag_td_open(attr_list: "class='heading'")
|
136
|
+
render_tag_a_section_heading(text_item, trailing_line_feed: true)
|
137
|
+
@destination.margin_indent do
|
138
|
+
render_table(text_item.sections)
|
139
|
+
end
|
140
|
+
write_tag_td_close_outline
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
def render_table_tr_td_number(text_item)
|
145
|
+
write_tag_td_open(attr_list: "class='number'")
|
146
|
+
render_tag_a_section_number(text_item, attr_list: "tabindex='-1'")
|
147
|
+
write_tag_td_close_inline
|
148
|
+
end
|
149
|
+
|
150
|
+
|
151
|
+
def render_tag_a_section_heading(text_item, trailing_line_feed: false)
|
152
|
+
href = @href_helper.to_text_item(text_item)
|
153
|
+
write_tag_a_open(href)
|
154
|
+
write_text_section_heading(text_item)
|
155
|
+
write_tag_a_close
|
156
|
+
if trailing_line_feed
|
157
|
+
write_lf
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
|
162
|
+
def render_tag_a_section_number(text_object, attr_list: nil)
|
163
|
+
href = @href_helper.to_text_item(text_object)
|
164
|
+
write_tag_a_open(href, attr_list: attr_list)
|
165
|
+
write_text_section_number(text_object)
|
166
|
+
write_tag_a_close
|
167
|
+
end
|
168
|
+
|
169
|
+
|
170
|
+
def write_lf
|
171
|
+
@destination.write_lf
|
172
|
+
end
|
173
|
+
|
174
|
+
|
175
|
+
def write_tag_a_close
|
176
|
+
@destination.write_inline tag_a_close
|
177
|
+
end
|
178
|
+
|
179
|
+
|
180
|
+
def write_tag_a_open(href_id, attr_list: nil)
|
181
|
+
@destination.write_inline tag_a_open(href_id, attr_list: attr_list)
|
182
|
+
end
|
183
|
+
|
184
|
+
|
185
|
+
def write_tag_div_close
|
186
|
+
@destination.write_line tag_div_close
|
187
|
+
end
|
188
|
+
|
189
|
+
|
190
|
+
def write_tag_div_open
|
191
|
+
@destination.write_line tag_div_open
|
192
|
+
end
|
193
|
+
|
194
|
+
|
195
|
+
def write_tag_h1_title
|
196
|
+
@destination.write_line tag_h1_title
|
197
|
+
end
|
198
|
+
|
199
|
+
|
200
|
+
def write_tag_li_close
|
201
|
+
write_tag_li_close_outline
|
202
|
+
end
|
203
|
+
|
204
|
+
|
205
|
+
def write_tag_li_close_inline
|
206
|
+
@destination.write_inline_end tag_li_close
|
207
|
+
end
|
208
|
+
|
209
|
+
|
210
|
+
def write_tag_li_close_outline
|
211
|
+
@destination.write_line tag_li_close
|
212
|
+
end
|
213
|
+
|
214
|
+
|
215
|
+
def write_tag_li_open
|
216
|
+
@destination.write_inline_indented tag_li_open
|
217
|
+
end
|
218
|
+
|
219
|
+
|
220
|
+
def write_tag_ol_close
|
221
|
+
@destination.write_line tag_ol_close
|
222
|
+
end
|
223
|
+
|
224
|
+
|
225
|
+
def write_tag_ol_open
|
226
|
+
@destination.write_line tag_ol_open
|
227
|
+
end
|
228
|
+
|
229
|
+
|
230
|
+
def write_tag_table_close
|
231
|
+
@destination.write_line tag_table_close
|
232
|
+
end
|
233
|
+
|
234
|
+
|
235
|
+
def write_tag_table_open
|
236
|
+
@destination.write_line tag_table_open
|
237
|
+
end
|
238
|
+
|
239
|
+
|
240
|
+
def write_tag_td_close
|
241
|
+
write_tag_td_close_outline
|
242
|
+
end
|
243
|
+
|
244
|
+
|
245
|
+
def write_tag_td_close_inline
|
246
|
+
@destination.write_inline_end tag_td_close
|
247
|
+
end
|
248
|
+
|
249
|
+
|
250
|
+
def write_tag_td_close_outline
|
251
|
+
@destination.write_line tag_td_close
|
252
|
+
end
|
253
|
+
|
254
|
+
|
255
|
+
def write_tag_td_open(attr_list: nil)
|
256
|
+
@destination.write_inline_indented tag_td_open(attr_list: attr_list)
|
257
|
+
end
|
258
|
+
|
259
|
+
|
260
|
+
def write_tag_tr_close
|
261
|
+
@destination.write_line tag_tr_close
|
262
|
+
end
|
263
|
+
|
264
|
+
|
265
|
+
def write_tag_tr_open(html_id)
|
266
|
+
@destination.write_line tag_tr_open(html_id)
|
267
|
+
end
|
268
|
+
|
269
|
+
|
270
|
+
def write_text_section_heading(text_item)
|
271
|
+
@destination.write_inline text_item.heading
|
272
|
+
end
|
273
|
+
|
274
|
+
|
275
|
+
def write_text_section_number(text_item)
|
276
|
+
@destination.write_inline text_item.numbering.join('.')
|
277
|
+
end
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
private
|
282
|
+
|
283
|
+
|
284
|
+
def tag_a_close
|
285
|
+
"</a>"
|
286
|
+
end
|
287
|
+
|
288
|
+
|
289
|
+
def tag_a_open(href_id, attr_list: nil)
|
290
|
+
["<a", "class='document_link'", "href='#{href_id}'", attr_list].compact.join(' ').concat('>')
|
291
|
+
end
|
292
|
+
|
293
|
+
|
294
|
+
def tag_div_close
|
295
|
+
"</div>"
|
296
|
+
end
|
297
|
+
|
298
|
+
|
299
|
+
def tag_div_open
|
300
|
+
"<div class='subcontents' data-text_root_name='#{@text_root_name}' id='#{@html_attr_id}'>"
|
301
|
+
end
|
302
|
+
|
303
|
+
|
304
|
+
def tag_h1_title
|
305
|
+
"<h1>#{@project.title}</h1>"
|
306
|
+
end
|
307
|
+
|
308
|
+
|
309
|
+
def tag_li_close
|
310
|
+
"</li>"
|
311
|
+
end
|
312
|
+
|
313
|
+
|
314
|
+
def tag_li_open
|
315
|
+
"<li>"
|
316
|
+
end
|
317
|
+
|
318
|
+
|
319
|
+
def tag_ol_close
|
320
|
+
"</ol>"
|
321
|
+
end
|
322
|
+
|
323
|
+
|
324
|
+
def tag_ol_open
|
325
|
+
"<ol>"
|
326
|
+
end
|
327
|
+
|
328
|
+
|
329
|
+
def tag_table_close
|
330
|
+
"</table>"
|
331
|
+
end
|
332
|
+
|
333
|
+
|
334
|
+
def tag_table_open
|
335
|
+
"<table class='document_links'>"
|
336
|
+
end
|
337
|
+
|
338
|
+
|
339
|
+
def tag_td_close
|
340
|
+
"</td>"
|
341
|
+
end
|
342
|
+
|
343
|
+
|
344
|
+
def tag_td_open(attr_list: nil)
|
345
|
+
["<td", attr_list].compact.join(' ').concat('>')
|
346
|
+
end
|
347
|
+
|
348
|
+
|
349
|
+
def tag_tr_close
|
350
|
+
"</tr>"
|
351
|
+
end
|
352
|
+
|
353
|
+
|
354
|
+
def tag_tr_open(html_id)
|
355
|
+
"<tr id='#{html_id}'>"
|
356
|
+
end
|
357
|
+
|
358
|
+
|
359
|
+
def task_depth_is_within_range(text_item)
|
360
|
+
result = nil
|
361
|
+
if @item_depth_max == nil
|
362
|
+
result = true
|
363
|
+
elsif text_item.section_depth <= @item_depth_max
|
364
|
+
result = true
|
365
|
+
elsif text_item.section_depth > @item_depth_max
|
366
|
+
result = false
|
367
|
+
end
|
368
|
+
result
|
369
|
+
end
|
370
|
+
|
371
|
+
|
372
|
+
end
|
373
|
+
end
|
374
|
+
end
|