muwu 3.0.0.beta → 3.0.0.beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/muwu.rb +1 -1
- data/lib/muwu/cli/cli.rb +5 -5
- data/lib/muwu/cli/help/compile +4 -4
- data/lib/muwu/cli/help/summary +1 -3
- data/lib/muwu/cli/help/sync +21 -11
- data/lib/muwu/cli/help/view +1 -2
- data/lib/muwu/controller/controller.rb +4 -4
- data/lib/muwu/controller/controller_interaction.rb +66 -44
- data/lib/muwu/default/default.rb +3 -1
- data/lib/muwu/project/project.rb +14 -21
- data/lib/muwu/project_builder/assets/config/css/base/html_elements.scss +19 -15
- data/lib/muwu/project_builder/assets/config/css/base/mixin_text_section_heading.scss +0 -24
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_contents.scss +5 -5
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_metadata.scss +2 -4
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_navigator.scss +3 -4
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_subcontents.scss +5 -5
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_text.scss +16 -15
- data/lib/muwu/project_builder/assets/config/css/base/section_muwu_title.scss +9 -6
- data/lib/muwu/project_builder/project_reset_compiled.rb +9 -2
- data/lib/muwu/project_builder/project_starter.rb +7 -7
- data/lib/muwu/project_builder/project_writer.rb +1 -1
- data/lib/muwu/project_options/project_options.rb +2 -1
- data/lib/muwu/project_options_builder/project_option_validator.rb +12 -12
- data/lib/muwu/project_options_builder/project_option_validator_value.rb +7 -1
- data/lib/muwu/render_concat/render_concat.rb +26 -27
- data/lib/muwu/render_html/render_html.rb +0 -3
- data/lib/muwu/sync/sync.rb +23 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 004b5b4bcff5064b7e92494afb02f04b34947f44d139c92bb9ad329d4ca5abfb
|
4
|
+
data.tar.gz: 2f1e3a3d6c973488921ed9904b1afdd698a251b21ec88639a514960e32f5955b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2ad7a17cbbf04131c7a2377d032df0e0def82349b7dcb64ec07e79846f500fb792c3452882235acf8a34b7be91f75a7ab617e41e3c0c2fbc681e5c88875a31b
|
7
|
+
data.tar.gz: e3da5b0145e28f1bf7a944900e11c5f33b6b5f9c40739f72557154ce90221ed457a9474cf230da6ba0b7caa7176009227e044e2509d39ab2401c17001cf42bf3
|
data/lib/muwu.rb
CHANGED
data/lib/muwu/cli/cli.rb
CHANGED
@@ -137,7 +137,7 @@ module Muwu
|
|
137
137
|
|
138
138
|
|
139
139
|
def evaluate_command_publish
|
140
|
-
Controller.new(@current_working_directory).publish(@args[1
|
140
|
+
Controller.new(@current_working_directory).publish(@args[1..-1])
|
141
141
|
end
|
142
142
|
|
143
143
|
|
@@ -164,10 +164,10 @@ module Muwu
|
|
164
164
|
|
165
165
|
else
|
166
166
|
case @args[1]
|
167
|
-
when '
|
168
|
-
Controller.new(@current_working_directory).
|
169
|
-
when '
|
170
|
-
Controller.new(@current_working_directory).
|
167
|
+
when 'pull'
|
168
|
+
Controller.new(@current_working_directory).sync_pull(@args[2..-1])
|
169
|
+
when 'push'
|
170
|
+
Controller.new(@current_working_directory).sync_push(@args[2..-1])
|
171
171
|
else
|
172
172
|
puts CliHelp.new(:sync).message
|
173
173
|
end
|
data/lib/muwu/cli/help/compile
CHANGED
@@ -14,9 +14,9 @@
|
|
14
14
|
number of a document.
|
15
15
|
|
16
16
|
- muwu compile js
|
17
|
-
- Compile only the
|
17
|
+
- Compile only the Javascript library (if applicable) for the project.
|
18
18
|
|
19
19
|
* Compiling a project will overwrite any previous output files without
|
20
|
-
any warning.
|
21
|
-
|
22
|
-
*
|
20
|
+
any warning.
|
21
|
+
|
22
|
+
* Specify output filenames in `options.yml`.
|
data/lib/muwu/cli/help/summary
CHANGED
@@ -9,10 +9,8 @@ Command line:
|
|
9
9
|
muwu publish publish to a remote server (requires rsync)
|
10
10
|
muwu reset compiled reset the `compiled/` subdirectory
|
11
11
|
muwu reset css reset the default CSS files
|
12
|
-
muwu sync
|
12
|
+
muwu sync synchronize from/to a remote location (requires rsync)
|
13
13
|
muwu view view a compiled project (requires lynx)
|
14
14
|
|
15
|
-
All commands operate within the current working directory.
|
16
|
-
|
17
15
|
For more detailed instructions:
|
18
16
|
muwu help [command]
|
data/lib/muwu/cli/help/sync
CHANGED
@@ -1,18 +1,28 @@
|
|
1
|
-
- muwu sync
|
2
|
-
- Synchronize project from/to a remote location using rsync. Rsync must
|
3
|
-
installed on the local system.
|
1
|
+
- muwu sync (pull/push) [options]
|
2
|
+
- Synchronize the project from/to a remote location using rsync. Rsync must
|
3
|
+
be installed on the local system.
|
4
4
|
|
5
|
-
- muwu sync
|
5
|
+
- muwu sync pull
|
6
6
|
- Use rsync to download the project from a remote host.
|
7
7
|
|
8
|
-
- muwu sync
|
9
|
-
- Use rsync to upload
|
8
|
+
- muwu sync push
|
9
|
+
- Use rsync to upload the project to a remote host.
|
10
10
|
|
11
11
|
- [options]
|
12
|
-
-
|
13
|
-
|
12
|
+
- Muwu will pass any further command-line arguments to rsync. See the rsync
|
13
|
+
man page for more information about valid rsync options.
|
14
14
|
|
15
|
-
|
15
|
+
- Muwu will automatically include the following options:
|
16
|
+
--itemize-changes
|
17
|
+
--recursive
|
18
|
+
--verbose
|
19
|
+
|
20
|
+
- Other useful options: (verify against the rsync man page before using)
|
21
|
+
--delete Delete files from the target host that aren't present on the
|
22
|
+
source host.
|
23
|
+
--dry-run Show which changes would be made, but don't perform them.
|
24
|
+
--update Only update the files on the target host that have older
|
25
|
+
timestamps than on the source; do not change files on the
|
26
|
+
target host that have newer timestamps.
|
16
27
|
|
17
|
-
*
|
18
|
-
'-v' to give a verbose description
|
28
|
+
* Specify the remote host in 'options.yml' using the 'remote_sync' value.
|
data/lib/muwu/cli/help/view
CHANGED
@@ -124,22 +124,22 @@ module Muwu
|
|
124
124
|
end
|
125
125
|
|
126
126
|
|
127
|
-
def
|
127
|
+
def sync_pull(args)
|
128
128
|
@project = read_project_from_current_working_directory
|
129
129
|
if @project.does_not_have_crucial_files
|
130
130
|
reply_folder_does_not_have_valid_project
|
131
131
|
else
|
132
|
-
Sync.new(@project, args: args).
|
132
|
+
Sync.new(@project, args: args).pull
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
136
|
|
137
|
-
def
|
137
|
+
def sync_push(args)
|
138
138
|
@project = read_project_from_current_working_directory
|
139
139
|
if @project.does_not_have_crucial_files
|
140
140
|
reply_folder_does_not_have_valid_project
|
141
141
|
else
|
142
|
-
Sync.new(@project, args: args).
|
142
|
+
Sync.new(@project, args: args).push
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
@@ -8,12 +8,24 @@ module Muwu
|
|
8
8
|
def initialize
|
9
9
|
@slug = ''
|
10
10
|
end
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
|
12
|
+
|
13
|
+
|
14
14
|
public
|
15
|
-
|
16
|
-
|
15
|
+
|
16
|
+
|
17
|
+
def confirm_reset_compiled(project)
|
18
|
+
render_reset_compiled_heading
|
19
|
+
render_reset_compiled_prompt
|
20
|
+
@answer = $stdin.gets.chomp.strip.downcase
|
21
|
+
if @answer == 'y'
|
22
|
+
return true
|
23
|
+
else
|
24
|
+
return false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
|
17
29
|
def confirm_reset_css(project)
|
18
30
|
render_reset_css_heading(project)
|
19
31
|
render_reset_css_prompt
|
@@ -24,21 +36,21 @@ module Muwu
|
|
24
36
|
return false
|
25
37
|
end
|
26
38
|
end
|
27
|
-
|
28
|
-
|
39
|
+
|
40
|
+
|
29
41
|
def request_metadata
|
30
42
|
request_metadata_phase_1_render_heading
|
31
43
|
request_metadata_phase_2_request_and_set_slug
|
32
44
|
{ slug: @slug }
|
33
45
|
end
|
34
|
-
|
35
|
-
|
46
|
+
|
47
|
+
|
36
48
|
def request_metadata_phase_1_render_heading
|
37
49
|
render_new_project_heading
|
38
50
|
render_lf
|
39
51
|
end
|
40
|
-
|
41
|
-
|
52
|
+
|
53
|
+
|
42
54
|
def request_metadata_phase_2_request_and_set_slug
|
43
55
|
render_slug_heading
|
44
56
|
while @slug == ''
|
@@ -52,13 +64,13 @@ module Muwu
|
|
52
64
|
end
|
53
65
|
render_lf
|
54
66
|
end
|
55
|
-
|
56
|
-
|
57
|
-
|
67
|
+
|
68
|
+
|
69
|
+
|
58
70
|
private
|
59
|
-
|
60
|
-
|
61
|
-
|
71
|
+
|
72
|
+
|
73
|
+
|
62
74
|
def determine_reset_css_files(project)
|
63
75
|
[
|
64
76
|
File.join(project.path_css_base),
|
@@ -68,75 +80,85 @@ module Muwu
|
|
68
80
|
File.join(project.path_css, 'index.scss'),
|
69
81
|
]
|
70
82
|
end
|
71
|
-
|
83
|
+
|
72
84
|
|
73
85
|
def render_lf
|
74
86
|
puts "\n"
|
75
87
|
end
|
76
|
-
|
77
|
-
|
88
|
+
|
89
|
+
|
78
90
|
def render_new_project_heading
|
79
91
|
puts '# Muwu'
|
80
92
|
puts '# New Project'
|
81
93
|
end
|
82
|
-
|
83
|
-
|
94
|
+
|
95
|
+
|
96
|
+
def render_reset_compiled_heading
|
97
|
+
puts '# Muwu'
|
98
|
+
puts '# Reset `compiled/`'
|
99
|
+
puts '- This will remove all contents of the `compiled/` folder.'
|
100
|
+
puts '- This action cannot be undone.'
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
def render_reset_compiled_prompt
|
105
|
+
print '> Continue resetting the `compiled/` folder? (y/N) '
|
106
|
+
end
|
107
|
+
|
108
|
+
|
84
109
|
def render_reset_css_heading(project)
|
85
110
|
puts '# Muwu'
|
86
111
|
puts '# Reset CSS'
|
87
|
-
puts
|
88
112
|
puts '- This will reset the following files and folders to their original state:'
|
89
|
-
puts
|
90
113
|
determine_reset_css_files(project).each do |file|
|
91
|
-
puts "
|
114
|
+
puts " * #{file}"
|
92
115
|
end
|
93
|
-
puts
|
94
|
-
puts "* If #{project.path_css_extensions} does not exist, it will be created."
|
116
|
+
puts "- If #{project.path_css_extensions} does not exist, it will be created."
|
95
117
|
puts ' Otherwise, its existing contents will remain unchanged.'
|
96
|
-
puts
|
118
|
+
puts '- This action cannot be undone'
|
97
119
|
end
|
98
|
-
|
99
|
-
|
120
|
+
|
121
|
+
|
100
122
|
def render_reset_css_prompt
|
101
123
|
print '> Continue with CSS reset? (y/N) '
|
102
124
|
end
|
103
|
-
|
104
|
-
|
125
|
+
|
126
|
+
|
105
127
|
def render_slug_heading
|
106
128
|
puts '# Project Directory Name'
|
107
129
|
puts '- Word characters `[a-zA-Z0-9_]` only; non-word characters will be removed.'
|
108
130
|
end
|
109
|
-
|
110
|
-
|
131
|
+
|
132
|
+
|
111
133
|
def render_slug_prompt
|
112
134
|
print '> Directory Name for project: '
|
113
135
|
end
|
114
|
-
|
115
|
-
|
136
|
+
|
137
|
+
|
116
138
|
def render_slug_can_not_be_blank
|
117
139
|
puts '- Directory Name can not be blank.'
|
118
140
|
end
|
119
|
-
|
120
|
-
|
141
|
+
|
142
|
+
|
121
143
|
def render_slug_was_sanitized(result: nil)
|
122
144
|
puts '- Directory Name contained non-word characters that were removed.'
|
123
145
|
if result
|
124
146
|
puts " - Modified Directory Name: `#{result}`"
|
125
147
|
end
|
126
148
|
end
|
127
|
-
|
128
|
-
|
149
|
+
|
150
|
+
|
129
151
|
def render_title_heading
|
130
152
|
puts "\n"
|
131
153
|
puts '# Project Title'
|
132
154
|
end
|
133
|
-
|
134
|
-
|
155
|
+
|
156
|
+
|
135
157
|
def render_title_prompt
|
136
158
|
print '> Title of project: '
|
137
159
|
end
|
138
|
-
|
139
|
-
|
160
|
+
|
161
|
+
|
140
162
|
def render_title_can_not_be_blank
|
141
163
|
puts '- Title can not be blank.'
|
142
164
|
end
|
data/lib/muwu/default/default.rb
CHANGED
@@ -21,7 +21,9 @@ module Muwu
|
|
21
21
|
|
22
22
|
|
23
23
|
PROJECT_OPTIONS = {
|
24
|
-
|
24
|
+
# TODO: this was probably an anti-pattern
|
25
|
+
# compile_all_resets_compiled_folder: true,
|
26
|
+
contents_section_numbers_receive_link: true,
|
25
27
|
generate_navigators_automatically: true,
|
26
28
|
generate_subcontents_automatically: false,
|
27
29
|
html_head_includes_metadata_tags: true,
|
data/lib/muwu/project/project.rb
CHANGED
@@ -27,17 +27,6 @@ module Muwu
|
|
27
27
|
end
|
28
28
|
|
29
29
|
|
30
|
-
def inspect
|
31
|
-
["#{self.to_s}", "{", inspect_instance_variables, "}"].join(' ')
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
def inspect_instance_variables
|
36
|
-
self.instance_variables.map { |v| "#{v}=#<#{instance_variable_get(v).class}>" }.join(", ")
|
37
|
-
end
|
38
|
-
|
39
|
-
|
40
|
-
|
41
30
|
public
|
42
31
|
|
43
32
|
|
@@ -65,13 +54,6 @@ module Muwu
|
|
65
54
|
end
|
66
55
|
|
67
56
|
|
68
|
-
# def does_not_have_crucial_files
|
69
|
-
# exceptions_include?(ProjectException::MetadataFileNotFound) &&
|
70
|
-
# exceptions_include?(ProjectException::OptionsFileNotFound) &&
|
71
|
-
# exceptions_include?(ProjectException::OutlineFileNotFound)
|
72
|
-
# end
|
73
|
-
|
74
|
-
|
75
57
|
def does_not_have_crucial_files
|
76
58
|
metadata_file_does_not_exist &&
|
77
59
|
options_file_does_not_exist &&
|
@@ -108,6 +90,16 @@ module Muwu
|
|
108
90
|
end
|
109
91
|
|
110
92
|
|
93
|
+
def inspect
|
94
|
+
["#{self.to_s}", "{", inspect_instance_variables, "}"].join(' ')
|
95
|
+
end
|
96
|
+
|
97
|
+
|
98
|
+
def inspect_instance_variables
|
99
|
+
self.instance_variables.map { |v| "#{v}=#<#{instance_variable_get(v).class}>" }.join(", ")
|
100
|
+
end
|
101
|
+
|
102
|
+
|
111
103
|
def js_basename
|
112
104
|
if @options.output_file_js_basename.to_s == ''
|
113
105
|
SanitizerHelper::sanitize_destination_file_basename(slug).downcase
|
@@ -295,9 +287,10 @@ module Muwu
|
|
295
287
|
end
|
296
288
|
|
297
289
|
|
298
|
-
|
299
|
-
|
300
|
-
|
290
|
+
# DEPRECATED
|
291
|
+
# def path_images
|
292
|
+
# File.absolute_path(File.join(@working_directory, 'images'))
|
293
|
+
# end
|
301
294
|
|
302
295
|
|
303
296
|
def path_outline
|
@@ -17,16 +17,19 @@
|
|
17
17
|
// proportional, while the content box could shrink). An HTML document with
|
18
18
|
// adequately-defined heirarchial organization has no need for `padding-box`
|
19
19
|
// sizing, and a layout editor working with a mindset of variable-size media
|
20
|
-
// can successfully rely on `content-box` sizing.
|
20
|
+
// can successfully rely on `content-box` sizing.
|
21
21
|
//
|
22
22
|
|
23
|
+
$muwu-root-font-size: 1rem;
|
24
|
+
$muwu-root-line-height: ($muwu-root-font-size * 1.16667);
|
25
|
+
|
23
26
|
* {
|
24
27
|
box-sizing: content-box;
|
25
|
-
|
28
|
+
font-size: $muwu-root-font-size;
|
29
|
+
line-height: $muwu-root-line-height;
|
26
30
|
margin: 0;
|
27
31
|
padding: 0;
|
28
32
|
text-indent: 0;
|
29
|
-
font-size: 1rem;
|
30
33
|
}
|
31
34
|
|
32
35
|
|
@@ -41,16 +44,16 @@ body {
|
|
41
44
|
}
|
42
45
|
|
43
46
|
blockquote {
|
44
|
-
margin:
|
47
|
+
margin: $muwu-root-line-height 2rem;
|
45
48
|
}
|
46
49
|
|
47
50
|
code {
|
48
|
-
font-size:
|
51
|
+
font-size: $muwu-root-font-size;
|
49
52
|
padding: 0rem 0.15rem;
|
50
53
|
}
|
51
54
|
|
52
55
|
dl {
|
53
|
-
margin:
|
56
|
+
margin: $muwu-root-line-height 0;
|
54
57
|
div {
|
55
58
|
dt {
|
56
59
|
display: list-item;
|
@@ -63,7 +66,7 @@ dl {
|
|
63
66
|
dd {
|
64
67
|
display: list-item;
|
65
68
|
list-style-type: none;
|
66
|
-
p {
|
69
|
+
p {
|
67
70
|
display: inline;
|
68
71
|
}
|
69
72
|
}
|
@@ -77,30 +80,31 @@ img {
|
|
77
80
|
}
|
78
81
|
|
79
82
|
h1, h2, h3, h4, h5, h6 {
|
80
|
-
font-size: 1.
|
83
|
+
font-size: ($muwu-root-font-size * 1.125);
|
84
|
+
margin: $muwu-root-line-height 0rem;
|
81
85
|
}
|
82
86
|
|
83
87
|
hr {
|
84
|
-
margin:
|
88
|
+
margin: $muwu-root-line-height 0;
|
85
89
|
border-width: 0;
|
86
90
|
}
|
87
91
|
|
88
92
|
ol {
|
89
|
-
margin:
|
93
|
+
margin: $muwu-root-line-height;
|
90
94
|
ol, ul {
|
91
95
|
margin: 0rem 1rem;
|
92
96
|
}
|
93
97
|
}
|
94
98
|
|
95
99
|
p {
|
96
|
-
margin:
|
100
|
+
margin: $muwu-root-line-height 0rem;
|
97
101
|
}
|
98
102
|
|
99
103
|
pre {
|
100
|
-
font-size: 0.
|
101
|
-
margin:
|
104
|
+
font-size: ($muwu-root-font-size * 0.9);
|
105
|
+
margin: $muwu-root-line-height 0;
|
102
106
|
>code {
|
103
|
-
font-size: 0.
|
107
|
+
font-size: ($muwu-root-font-size * 0.8);
|
104
108
|
padding: 0rem 0rem;
|
105
109
|
}
|
106
110
|
}
|
@@ -110,7 +114,7 @@ q {
|
|
110
114
|
}
|
111
115
|
|
112
116
|
ul {
|
113
|
-
margin:
|
117
|
+
margin: $muwu-root-line-height;
|
114
118
|
ol, ul {
|
115
119
|
margin: 0rem 1rem;
|
116
120
|
}
|
@@ -1,27 +1,3 @@
|
|
1
|
-
// @mixin text_section_heading($font-size, $margin-bottom) {
|
2
|
-
// >.section_number {
|
3
|
-
// font-size: $font-size;
|
4
|
-
// & + h1:first-of-type,
|
5
|
-
// & + h2:first-of-type,
|
6
|
-
// & + h3:first-of-type,
|
7
|
-
// & + h4:first-of-type,
|
8
|
-
// & + h5:first-of-type,
|
9
|
-
// & + h6:first-of-type {
|
10
|
-
// font-size: $font-size;
|
11
|
-
// margin-bottom: $margin-bottom;
|
12
|
-
// }
|
13
|
-
// }
|
14
|
-
// >h1:first-child,
|
15
|
-
// >h2:first-child,
|
16
|
-
// >h3:first-child,
|
17
|
-
// >h4:first-child,
|
18
|
-
// >h5:first-child,
|
19
|
-
// >h6:first-child {
|
20
|
-
// font-size: $font-size;
|
21
|
-
// margin-bottom: $margin-bottom;
|
22
|
-
// }
|
23
|
-
// }
|
24
|
-
|
25
1
|
@mixin text_section_heading($font-size, $margin-bottom) {
|
26
2
|
>h1:first-child,
|
27
3
|
>h2:first-child,
|
@@ -1,8 +1,8 @@
|
|
1
1
|
body >div.contents {
|
2
|
-
margin:
|
2
|
+
margin: ($muwu-root-line-height * 4) 0;
|
3
3
|
>h1 {
|
4
|
-
font-size: 1.
|
5
|
-
margin: 0 0
|
4
|
+
font-size: ($muwu-root-font-size * 1.25);
|
5
|
+
margin: 0 0 ($muwu-root-line-height * 2) 0;
|
6
6
|
text-align: left;
|
7
7
|
}
|
8
8
|
.compiler_warning {
|
@@ -33,7 +33,7 @@ body >div.contents {
|
|
33
33
|
}
|
34
34
|
td.heading {
|
35
35
|
text-align: left;
|
36
|
-
}
|
36
|
+
}
|
37
37
|
td.number {
|
38
38
|
text-align: right;
|
39
39
|
}
|
@@ -44,7 +44,7 @@ body >div.contents {
|
|
44
44
|
display: block;
|
45
45
|
margin: 0rem;
|
46
46
|
li {
|
47
|
-
margin: 0.
|
47
|
+
margin: ($muwu-root-line-height * 0.5) 0rem;
|
48
48
|
a {
|
49
49
|
display: inline;
|
50
50
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
body >div.metadata {
|
2
|
-
margin:
|
2
|
+
margin: ($muwu-root-line-height * 4) 0;
|
3
3
|
dl {
|
4
4
|
div {
|
5
|
-
margin:
|
5
|
+
margin: $muwu-root-line-height 0;
|
6
6
|
dt {
|
7
7
|
font-weight: bold;
|
8
8
|
display: block;
|
@@ -13,5 +13,3 @@ body >div.metadata {
|
|
13
13
|
}
|
14
14
|
}
|
15
15
|
}
|
16
|
-
|
17
|
-
|
@@ -1,13 +1,12 @@
|
|
1
1
|
body >div.navigator {
|
2
|
-
margin: 0.
|
2
|
+
margin: ($muwu-root-line-height * 0.5) 0;
|
3
3
|
nav.document_links {
|
4
4
|
width: 100%;
|
5
5
|
display: flex;
|
6
6
|
justify-content: space-around;
|
7
7
|
a.document_link {
|
8
|
-
font-size: 0.
|
9
|
-
padding: 0.
|
8
|
+
font-size: ($muwu-root-font-size * 0.8);
|
9
|
+
padding: ($muwu-root-line-height * 0.5);
|
10
10
|
}
|
11
11
|
}
|
12
12
|
}
|
13
|
-
|
@@ -1,8 +1,8 @@
|
|
1
1
|
body >div.subcontents {
|
2
|
-
margin:
|
2
|
+
margin: ($muwu-root-line-height * 4) 0;
|
3
3
|
>h1 {
|
4
|
-
font-size: 1.
|
5
|
-
margin: 0 0
|
4
|
+
font-size: ($muwu-root-font-size * 1.75);
|
5
|
+
margin: 0 0 ($muwu-root-line-height * 2) 0;
|
6
6
|
text-align: left;
|
7
7
|
}
|
8
8
|
.compiler_warning {
|
@@ -33,7 +33,7 @@ body >div.subcontents {
|
|
33
33
|
}
|
34
34
|
td.heading {
|
35
35
|
text-align: left;
|
36
|
-
}
|
36
|
+
}
|
37
37
|
td.number {
|
38
38
|
text-align: right;
|
39
39
|
}
|
@@ -44,7 +44,7 @@ body >div.subcontents {
|
|
44
44
|
display: block;
|
45
45
|
margin: 0rem 0.5rem;
|
46
46
|
li {
|
47
|
-
margin: 0.
|
47
|
+
margin: ($muwu-root-line-height * 0.5) 0rem;
|
48
48
|
a {
|
49
49
|
display: inline;
|
50
50
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
@import 'mixin_text_section_heading';
|
2
2
|
|
3
3
|
body >div.text {
|
4
|
-
margin:
|
4
|
+
margin: ($muwu-root-line-height * 6) 0rem;
|
5
5
|
ol {
|
6
6
|
padding-left: 1rem;
|
7
7
|
}
|
@@ -9,40 +9,41 @@ body >div.text {
|
|
9
9
|
padding-left: 1rem;
|
10
10
|
}
|
11
11
|
|
12
|
-
section[data-section_depth] {
|
12
|
+
section[data-section_depth] {
|
13
13
|
>.section_number {
|
14
14
|
font-weight: bold;
|
15
15
|
display: block;
|
16
|
+
margin-bottom: none;
|
16
17
|
text-decoration: none;
|
17
18
|
}
|
18
19
|
nav.document_links {
|
19
20
|
width: 100%;
|
20
|
-
margin:
|
21
|
+
margin: ($muwu-root-line-height * 2) 0rem ($muwu-root-line-height * 4) 0rem;
|
21
22
|
text-align: right;
|
22
23
|
a.document_link {
|
23
|
-
font-size: 0.
|
24
|
+
font-size: ($muwu-root-font-size * 0.75);
|
24
25
|
margin: 0rem 0.5rem
|
25
26
|
}
|
26
27
|
}
|
27
28
|
}
|
28
|
-
|
29
|
+
|
29
30
|
section[data-section_depth='1'] {
|
30
|
-
margin:
|
31
|
-
@include text_section_heading(1.
|
31
|
+
margin: ($muwu-root-line-height * 6) 0;
|
32
|
+
@include text_section_heading(($muwu-root-font-size * 1.5), ($muwu-root-line-height * 2));
|
32
33
|
}
|
33
|
-
|
34
|
+
|
34
35
|
section[data-section_depth='2'] {
|
35
|
-
margin:
|
36
|
-
@include text_section_heading(1.
|
36
|
+
margin: ($muwu-root-line-height * 4) 0;
|
37
|
+
@include text_section_heading(($muwu-root-font-size * 1.375), ($muwu-root-line-height * 1.5));
|
37
38
|
}
|
38
39
|
|
39
40
|
section[data-section_depth='3'] {
|
40
|
-
margin:
|
41
|
-
@include text_section_heading(1.
|
41
|
+
margin: ($muwu-root-line-height * 2) 0;
|
42
|
+
@include text_section_heading(($muwu-root-font-size * 1.25), ($muwu-root-line-height * 1.5));
|
42
43
|
section[data-section_depth] {
|
43
|
-
margin:
|
44
|
-
@include text_section_heading(
|
44
|
+
margin: ($muwu-root-line-height * 2) 0;
|
45
|
+
@include text_section_heading(($muwu-root-font-size * 1), ($muwu-root-line-height * 1.5));
|
45
46
|
}
|
46
47
|
}
|
47
48
|
|
48
|
-
}
|
49
|
+
}
|
@@ -1,20 +1,23 @@
|
|
1
1
|
body >div.title {
|
2
|
-
margin:
|
2
|
+
margin: ($muwu-root-line-height * 4) 0;
|
3
3
|
text-align: left;
|
4
4
|
h1 {
|
5
5
|
display: block;
|
6
6
|
font-weight: bold;
|
7
|
-
margin: 0.
|
7
|
+
margin: ($muwu-root-line-height * 0.5) 0;
|
8
8
|
}
|
9
9
|
[data-metadata_key='title'] {
|
10
|
-
font-size: 2
|
10
|
+
font-size: ($muwu-root-font-size * 2);
|
11
|
+
line-height: ($muwu-root-line-height * 2);
|
11
12
|
}
|
12
13
|
[data-metadata_key='subtitle'] {
|
13
|
-
font-size: 1.
|
14
|
+
font-size: ($muwu-root-font-size * 1.5);
|
15
|
+
line-height: ($muwu-root-line-height * 1.5);
|
14
16
|
}
|
15
17
|
[data-metadata_key='author'] {
|
16
|
-
|
17
|
-
|
18
|
+
font-size: ($muwu-root-font-size * 1.25);
|
19
|
+
line-height: ($muwu-root-line-height * 1.25);
|
20
|
+
margin: ($muwu-root-line-height * 2) 0rem;
|
18
21
|
}
|
19
22
|
h1:first-child {
|
20
23
|
margin-top: 0;
|
@@ -13,10 +13,17 @@ module Muwu
|
|
13
13
|
end
|
14
14
|
|
15
15
|
|
16
|
+
public
|
17
|
+
|
18
|
+
|
16
19
|
def reset_compiled
|
17
20
|
puts "- Resetting #{@project.path_compiled}"
|
18
|
-
|
19
|
-
|
21
|
+
begin
|
22
|
+
FileUtils.remove_entry_secure(@project.path_compiled)
|
23
|
+
rescue Errno::ENOENT
|
24
|
+
ensure
|
25
|
+
FileUtils.mkdir(@project.path_compiled)
|
26
|
+
end
|
20
27
|
end
|
21
28
|
|
22
29
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Muwu
|
2
2
|
class ProjectStarter
|
3
|
-
|
4
|
-
|
3
|
+
|
4
|
+
|
5
5
|
include Muwu
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
|
8
8
|
def initialize(current_working_directory, metadata)
|
9
9
|
@current_working_directory = File.absolute_path(current_working_directory)
|
10
10
|
@metadata = metadata
|
@@ -21,7 +21,7 @@ module Muwu
|
|
21
21
|
project.working_directory = File.absolute_path(File.join(@current_working_directory, @metadata[:slug]))
|
22
22
|
project
|
23
23
|
end
|
24
|
-
|
25
|
-
|
24
|
+
|
25
|
+
|
26
26
|
end
|
27
|
-
end
|
27
|
+
end
|
@@ -50,7 +50,7 @@ module Muwu
|
|
50
50
|
def phase_2_make_project_subfolders
|
51
51
|
announce_and_execute_dir_mkdir(@project.path_compiled)
|
52
52
|
announce_and_execute_dir_mkdir(@project.path_config)
|
53
|
-
announce_and_execute_dir_mkdir(@project.path_images)
|
53
|
+
# announce_and_execute_dir_mkdir(@project.path_images) # DEPRECATED
|
54
54
|
announce_and_execute_dir_mkdir(@project.path_text)
|
55
55
|
end
|
56
56
|
|
@@ -1,26 +1,26 @@
|
|
1
1
|
module Muwu
|
2
2
|
class ProjectOptionValidator
|
3
|
-
|
4
|
-
|
3
|
+
|
4
|
+
|
5
5
|
include Muwu
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
|
8
8
|
attr_reader(
|
9
9
|
:key,
|
10
10
|
:value
|
11
11
|
)
|
12
|
-
|
13
|
-
|
12
|
+
|
13
|
+
|
14
14
|
def initialize(key, value, project)
|
15
15
|
key_validator = ProjectOptionValidatorKey.new(key, value, project)
|
16
16
|
@key = key_validator.validated_key
|
17
17
|
@value = key_validator.validated_value
|
18
18
|
end
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
|
20
|
+
|
21
|
+
|
22
22
|
protected
|
23
|
-
|
23
|
+
|
24
24
|
|
25
25
|
def self.new_if_valid_key(key, value, project)
|
26
26
|
option_validator = new(key, value, project)
|
@@ -32,6 +32,6 @@ module Muwu
|
|
32
32
|
end
|
33
33
|
|
34
34
|
|
35
|
-
|
35
|
+
|
36
36
|
end
|
37
|
-
end
|
37
|
+
end
|
@@ -106,7 +106,13 @@ module Muwu
|
|
106
106
|
end
|
107
107
|
|
108
108
|
|
109
|
-
|
109
|
+
# TODO: this was probably an anti-pattern
|
110
|
+
# def validate_option_compile_all_resets_compiled_folder
|
111
|
+
# return validate_option_boolean
|
112
|
+
# end
|
113
|
+
|
114
|
+
|
115
|
+
def validate_option_contents_section_numbers_receive_link
|
110
116
|
return validate_option_boolean
|
111
117
|
end
|
112
118
|
|
@@ -1,20 +1,21 @@
|
|
1
1
|
module Muwu
|
2
2
|
class RenderConcat
|
3
|
-
|
4
|
-
|
3
|
+
|
4
|
+
|
5
5
|
def initialize(project)
|
6
|
-
@output_path = project.
|
6
|
+
@output_path = project.path_compiled
|
7
7
|
@output_filename = project.html_basename + '.md'
|
8
8
|
@project = project
|
9
9
|
@manifest = project.manifest
|
10
10
|
end
|
11
|
-
|
12
|
-
|
11
|
+
|
12
|
+
|
13
13
|
public
|
14
|
-
|
15
|
-
|
14
|
+
|
15
|
+
|
16
16
|
def render
|
17
17
|
destination = File.join(@output_path, @output_filename)
|
18
|
+
puts "- Writing `#{@output_filename}`"
|
18
19
|
File.open(destination, 'w') do |f|
|
19
20
|
@manifest.text_blocks.each do |text|
|
20
21
|
text.sections.each do |text_item|
|
@@ -23,15 +24,15 @@ module Muwu
|
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
26
|
-
|
27
|
-
|
27
|
+
|
28
|
+
|
28
29
|
def render_text_item(f, text_item)
|
29
30
|
render_text_item_head(f, text_item)
|
30
31
|
render_text_item_source(f, text_item)
|
31
32
|
render_text_item_sections(f, text_item)
|
32
33
|
end
|
33
|
-
|
34
|
-
|
34
|
+
|
35
|
+
|
35
36
|
def render_text_item_head(f, text_item)
|
36
37
|
f.puts '# ' + text_item.numbering.join('.')
|
37
38
|
if heading_origin_is_basename_or_outline(text_item)
|
@@ -39,8 +40,8 @@ module Muwu
|
|
39
40
|
f.puts "\n"
|
40
41
|
end
|
41
42
|
end
|
42
|
-
|
43
|
-
|
43
|
+
|
44
|
+
|
44
45
|
def render_text_item_sections(f, text_item)
|
45
46
|
if text_item.does_have_child_sections
|
46
47
|
text_item.sections.each do |ti|
|
@@ -49,32 +50,30 @@ module Muwu
|
|
49
50
|
render_text_item_spacer(f, text_item)
|
50
51
|
end
|
51
52
|
end
|
52
|
-
|
53
|
-
|
53
|
+
|
54
|
+
|
54
55
|
def render_text_item_source(f, text_item)
|
55
56
|
if text_item.source_file_does_exist
|
56
57
|
f.puts text_item.source.strip
|
57
58
|
end
|
58
59
|
render_text_item_spacer(f, text_item)
|
59
60
|
end
|
60
|
-
|
61
|
-
|
61
|
+
|
62
|
+
|
62
63
|
def render_text_item_spacer(f, text_item)
|
63
64
|
f.puts "\n\n\n\n"
|
64
65
|
end
|
65
|
-
|
66
|
-
|
67
|
-
|
66
|
+
|
67
|
+
|
68
|
+
|
68
69
|
private
|
69
|
-
|
70
|
-
|
70
|
+
|
71
|
+
|
71
72
|
def heading_origin_is_basename_or_outline(text_item)
|
72
73
|
[:basename, :outline].include?(text_item.heading_origin)
|
73
74
|
end
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
|
76
|
+
|
77
|
+
|
78
78
|
end
|
79
79
|
end
|
80
|
-
|
data/lib/muwu/sync/sync.rb
CHANGED
@@ -9,50 +9,48 @@ module Muwu
|
|
9
9
|
@path_local = project.working_directory + File::SEPARATOR
|
10
10
|
@path_remote = project.options.remote_sync
|
11
11
|
@project = project
|
12
|
-
|
13
|
-
switches = ['i','r','v']
|
14
|
-
@args = args.map { |a| a.to_s.downcase }
|
15
|
-
if @args.include?('dry-run')
|
16
|
-
@dry_run = true
|
17
|
-
switches << 'n'
|
18
|
-
end
|
19
|
-
@switches = switches.sort.join
|
12
|
+
@switches = args.push('--itemize-changes', '--recursive', '--verbose').sort.join(' ')
|
20
13
|
end
|
21
14
|
|
22
15
|
|
23
16
|
public
|
24
17
|
|
25
18
|
|
26
|
-
def
|
19
|
+
def pull
|
27
20
|
if @project.exceptions_include?(ProjectException::OptionRemoteSyncValueNil)
|
28
21
|
raise ProjectExceptionHandler::Fatal.new(ProjectException::OptionRemoteSyncValueNil.new)
|
29
22
|
else
|
30
|
-
|
23
|
+
sync(source: @path_remote, target: @path_local)
|
31
24
|
end
|
32
25
|
end
|
33
26
|
|
34
27
|
|
35
|
-
def
|
28
|
+
def push
|
36
29
|
if @project.exceptions_include?(ProjectException::OptionRemoteSyncValueNil)
|
37
30
|
raise ProjectExceptionHandler::Fatal.new(ProjectException::OptionRemoteSyncValueNil.new)
|
38
31
|
else
|
39
|
-
|
32
|
+
sync(source: @path_local, target: @path_remote)
|
40
33
|
end
|
41
34
|
end
|
42
35
|
|
43
36
|
|
37
|
+
def sync(source: nil, target: nil)
|
38
|
+
if source && target
|
39
|
+
exec_rsync(source: source, target: target)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
44
43
|
|
45
44
|
private
|
46
45
|
|
47
46
|
|
48
|
-
def
|
47
|
+
def exec_rsync(source: nil, target: nil)
|
49
48
|
if source && target
|
50
49
|
puts "source: #{source.inspect}"
|
51
50
|
puts "target: #{target.inspect}"
|
52
|
-
puts "
|
53
|
-
puts "switches: -#{@switches}"
|
51
|
+
puts "switches: #{@switches}"
|
54
52
|
begin
|
55
|
-
system "rsync
|
53
|
+
system "rsync #{@switches} #{source} #{target}", exception: true
|
56
54
|
rescue Errno::ENOENT
|
57
55
|
raise ProjectExceptionHandler::Fatal.new(ProjectException::RsyncNotAvailable.new)
|
58
56
|
end
|
@@ -60,6 +58,15 @@ module Muwu
|
|
60
58
|
end
|
61
59
|
|
62
60
|
|
61
|
+
def exec_rsync_demo(source: nil, target: nil)
|
62
|
+
if source && target
|
63
|
+
puts "source: #{source.inspect}"
|
64
|
+
puts "target: #{target.inspect}"
|
65
|
+
puts "switches: -#{@switches}"
|
66
|
+
puts "command: rsync #{@switches} #{source} #{target}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
63
70
|
|
64
71
|
end
|
65
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muwu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eli Harrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commonmarker
|