openstax_kitchen 2.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.devcontainer/devcontainer.json +37 -17
- data/.github/config.yml +14 -0
- data/.github/workflows/tests.yml +5 -15
- data/.gitignore +2 -2
- data/.inch.yml +6 -0
- data/.rubocop.yml +65 -0
- data/CHANGELOG.md +85 -1
- data/Gemfile +5 -3
- data/Gemfile.lock +65 -17
- data/README.md +65 -11
- data/Rakefile +5 -3
- data/bin/console +4 -3
- data/docker/Dockerfile +36 -0
- data/docker/Dockerfile.ci +10 -0
- data/docker/bash +5 -1
- data/docker/build +10 -0
- data/docker/ci +15 -0
- data/docker/run +9 -0
- data/docker/tag_and_push_latest +17 -0
- data/lefthook.yml +6 -0
- data/lib/kitchen/ancestor.rb +38 -1
- data/lib/kitchen/book_document.rb +20 -2
- data/lib/kitchen/book_element.rb +40 -5
- data/lib/kitchen/book_element_enumerator.rb +4 -0
- data/lib/kitchen/book_recipe.rb +15 -1
- data/lib/kitchen/chapter_element.rb +43 -6
- data/lib/kitchen/chapter_element_enumerator.rb +9 -1
- data/lib/kitchen/clipboard.rb +35 -4
- data/lib/kitchen/composite_chapter_element.rb +21 -6
- data/lib/kitchen/composite_page_element.rb +35 -7
- data/lib/kitchen/composite_page_element_enumerator.rb +9 -1
- data/lib/kitchen/config.rb +20 -6
- data/lib/kitchen/counter.rb +9 -2
- data/lib/kitchen/debug/print_recipe_error.rb +53 -35
- data/lib/kitchen/directions/.rubocop.yml +22 -0
- data/lib/kitchen/directions/bake_appendix.rb +4 -4
- data/lib/kitchen/directions/bake_chapter_glossary/main.rb +18 -0
- data/lib/kitchen/directions/bake_chapter_glossary/v1.rb +30 -0
- data/lib/kitchen/directions/bake_chapter_introductions.rb +7 -7
- data/lib/kitchen/directions/bake_chapter_key_concepts/main.rb +16 -0
- data/lib/kitchen/directions/bake_chapter_key_concepts/v1.rb +35 -0
- data/lib/kitchen/directions/bake_chapter_key_equations.rb +30 -20
- data/lib/kitchen/directions/bake_chapter_references/main.rb +16 -0
- data/lib/kitchen/directions/bake_chapter_references/v1.rb +35 -0
- data/lib/kitchen/directions/bake_chapter_section_exercises/main.rb +11 -0
- data/lib/kitchen/directions/bake_chapter_section_exercises/v1.rb +28 -0
- data/lib/kitchen/directions/bake_chapter_summary.rb +45 -36
- data/lib/kitchen/directions/bake_chapter_title/main.rb +11 -0
- data/lib/kitchen/directions/bake_chapter_title/v1.rb +24 -0
- data/lib/kitchen/directions/bake_checkpoint.rb +44 -0
- data/lib/kitchen/directions/bake_composite_chapters.rb +14 -0
- data/lib/kitchen/directions/bake_composite_pages.rb +2 -2
- data/lib/kitchen/directions/bake_equations.rb +37 -0
- data/lib/kitchen/directions/bake_example.rb +39 -11
- data/lib/kitchen/directions/bake_figure.rb +8 -5
- data/lib/kitchen/directions/bake_first_elements.rb +16 -0
- data/lib/kitchen/directions/bake_footnotes/main.rb +2 -2
- data/lib/kitchen/directions/bake_footnotes/v1.rb +6 -5
- data/lib/kitchen/directions/bake_free_response/free_response.xhtml.erb +10 -0
- data/lib/kitchen/directions/bake_free_response/main.rb +11 -0
- data/lib/kitchen/directions/bake_free_response/v1.rb +29 -0
- data/lib/kitchen/directions/bake_further_research.rb +59 -0
- data/lib/kitchen/directions/bake_index/main.rb +2 -2
- data/lib/kitchen/directions/bake_index/v1.rb +46 -18
- data/lib/kitchen/directions/bake_link_placeholders.rb +24 -0
- data/lib/kitchen/directions/bake_math_in_paragraph.rb +5 -3
- data/lib/kitchen/directions/bake_non_introduction_pages.rb +26 -0
- data/lib/kitchen/directions/bake_notes/bake_autotitled_notes.rb +29 -0
- data/lib/kitchen/directions/bake_notes/bake_note_subtitle.rb +22 -0
- data/lib/kitchen/directions/bake_notes/bake_numbered_notes.rb +51 -0
- data/lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb +30 -0
- data/lib/kitchen/directions/bake_numbered_exercise/main.rb +15 -0
- data/lib/kitchen/directions/bake_numbered_exercise/v1.rb +47 -0
- data/lib/kitchen/directions/bake_numbered_table/main.rb +4 -4
- data/lib/kitchen/directions/bake_numbered_table/v1.rb +37 -18
- data/lib/kitchen/directions/bake_page_abstracts.rb +30 -0
- data/lib/kitchen/directions/bake_preface/main.rb +11 -0
- data/lib/kitchen/directions/bake_preface/v1.rb +18 -0
- data/lib/kitchen/directions/bake_references/main.rb +16 -0
- data/lib/kitchen/directions/bake_references/v1.rb +48 -0
- data/lib/kitchen/directions/bake_stepwise.rb +8 -12
- data/lib/kitchen/directions/bake_suggested_reading.rb +31 -0
- data/lib/kitchen/directions/bake_theorem/main.rb +11 -0
- data/lib/kitchen/directions/bake_theorem/v1.rb +28 -0
- data/lib/kitchen/directions/bake_toc.rb +49 -22
- data/lib/kitchen/directions/bake_unit_title/main.rb +11 -0
- data/lib/kitchen/directions/bake_unit_title/v1.rb +23 -0
- data/lib/kitchen/directions/bake_unnumbered_tables.rb +7 -5
- data/lib/kitchen/directions/book_answer_key_container/eob_solutions_container.xhtml.erb +9 -0
- data/lib/kitchen/directions/book_answer_key_container/main.rb +11 -0
- data/lib/kitchen/directions/book_answer_key_container/v1.rb +13 -0
- data/lib/kitchen/directions/chapter_review_container/chapter_review.xhtml.erb +9 -0
- data/lib/kitchen/directions/chapter_review_container/main.rb +11 -0
- data/lib/kitchen/directions/chapter_review_container/v1.rb +13 -0
- data/lib/kitchen/directions/eoc_section_title_link_snippet.rb +20 -0
- data/lib/kitchen/directions/move_exercises_to_eoc/main.rb +27 -0
- data/lib/kitchen/directions/move_exercises_to_eoc/v1.rb +36 -0
- data/lib/kitchen/directions/move_exercises_to_eoc/v2.rb +49 -0
- data/lib/kitchen/directions/move_solutions_to_answer_key/main.rb +14 -0
- data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/american_government.rb +19 -0
- data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/calculus.rb +41 -0
- data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/uphysics.rb +63 -0
- data/lib/kitchen/directions/move_solutions_to_answer_key/v1.rb +34 -0
- data/lib/kitchen/directions/move_title_text_into_span.rb +2 -2
- data/lib/kitchen/document.rb +83 -13
- data/lib/kitchen/element.rb +20 -3
- data/lib/kitchen/element_base.rb +373 -63
- data/lib/kitchen/element_enumerator.rb +8 -0
- data/lib/kitchen/element_enumerator_base.rb +297 -28
- data/lib/kitchen/element_enumerator_factory.rb +64 -53
- data/lib/kitchen/element_factory.rb +27 -12
- data/lib/kitchen/errors.rb +5 -0
- data/lib/kitchen/example_element.rb +21 -6
- data/lib/kitchen/example_element_enumerator.rb +9 -1
- data/lib/kitchen/exercise_element.rb +42 -0
- data/lib/kitchen/exercise_element_enumerator.rb +21 -0
- data/lib/kitchen/figure_element.rb +36 -5
- data/lib/kitchen/figure_element_enumerator.rb +9 -1
- data/lib/kitchen/metadata_element.rb +34 -0
- data/lib/kitchen/metadata_element_enumerator.rb +21 -0
- data/lib/kitchen/mixins/block_error_if.rb +24 -4
- data/lib/kitchen/note_element.rb +48 -20
- data/lib/kitchen/note_element_enumerator.rb +9 -1
- data/lib/kitchen/oven.rb +66 -15
- data/lib/kitchen/page_element.rb +84 -14
- data/lib/kitchen/page_element_enumerator.rb +9 -1
- data/lib/kitchen/pantry.rb +28 -1
- data/lib/kitchen/patches/nokogiri.rb +59 -2
- data/lib/kitchen/patches/renderable.rb +9 -3
- data/lib/kitchen/patches/string.rb +8 -0
- data/lib/kitchen/recipe.rb +69 -32
- data/lib/kitchen/reference_element.rb +27 -0
- data/lib/kitchen/references_element_enumerator.rb +20 -0
- data/lib/kitchen/search_history.rb +43 -4
- data/lib/kitchen/search_query.rb +106 -0
- data/lib/kitchen/selector.rb +24 -0
- data/lib/kitchen/selectors/base.rb +65 -0
- data/lib/kitchen/selectors/standard_1.rb +21 -0
- data/lib/kitchen/table_element.rb +55 -7
- data/lib/kitchen/table_element_enumerator.rb +9 -1
- data/lib/kitchen/templates/eob_section_title_template.xhtml.erb +10 -0
- data/lib/kitchen/templates/eoc_section_title_template.xhtml.erb +10 -0
- data/lib/kitchen/term_element.rb +15 -4
- data/lib/kitchen/term_element_enumerator.rb +9 -1
- data/lib/kitchen/transliterations.rb +7 -5
- data/lib/kitchen/type_casting_element_enumerator.rb +17 -1
- data/lib/kitchen/unit_element.rb +45 -0
- data/lib/kitchen/unit_element_enumerator.rb +20 -0
- data/lib/kitchen/utils.rb +10 -13
- data/lib/kitchen/version.rb +5 -1
- data/lib/locales/en.yml +18 -7
- data/lib/locales/pl.yml +24 -0
- data/lib/openstax_kitchen.rb +44 -42
- data/openstax_kitchen.gemspec +26 -20
- data/tutorials/00/solution1.rb +9 -0
- data/tutorials/00/solution2.rb +8 -0
- data/tutorials/01/solution1.rb +18 -0
- data/tutorials/01/solution2.rb +26 -0
- data/tutorials/02/solution1.rb +31 -0
- data/tutorials/03/{solution_1.rb → solution1.rb} +6 -4
- data/tutorials/03/solution2.rb +18 -0
- data/tutorials/04/{solution_1.rb → solution1.rb} +4 -2
- data/tutorials/04/{solution_2.rb → solution2.rb} +6 -4
- data/tutorials/05/solution1.rb +11 -0
- data/tutorials/check_it +16 -15
- data/tutorials/setup_my_recipes +7 -6
- metadata +149 -24
- data/Dockerfile +0 -19
- data/docker-compose.yml +0 -12
- data/docker/entrypoint +0 -9
- data/lib/kitchen/directions/bake_chapter_glossary.rb +0 -34
- data/lib/kitchen/directions/bake_exercises.rb +0 -164
- data/lib/kitchen/directions/bake_notes.rb +0 -58
- data/tutorials/00/solution_1.rb +0 -7
- data/tutorials/00/solution_2.rb +0 -6
- data/tutorials/01/solution_1.rb +0 -16
- data/tutorials/01/solution_2.rb +0 -24
- data/tutorials/02/solution_1.rb +0 -29
- data/tutorials/03/solution_2.rb +0 -15
- data/tutorials/05/solution_1.rb +0 -9
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstax_kitchen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: i18n
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rainbow
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: inch
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -122,6 +122,62 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-rake
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop-rspec
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: yard
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
125
181
|
description: OpenStax content baking library
|
126
182
|
email:
|
127
183
|
- jpslav@gmail.com
|
@@ -130,13 +186,15 @@ extensions: []
|
|
130
186
|
extra_rdoc_files: []
|
131
187
|
files:
|
132
188
|
- ".devcontainer/devcontainer.json"
|
189
|
+
- ".github/config.yml"
|
133
190
|
- ".github/workflows/tests.yml"
|
134
191
|
- ".gitignore"
|
192
|
+
- ".inch.yml"
|
135
193
|
- ".rspec"
|
194
|
+
- ".rubocop.yml"
|
136
195
|
- ".solargraph.yml"
|
137
196
|
- CHANGELOG.md
|
138
197
|
- CODE_OF_CONDUCT.md
|
139
|
-
- Dockerfile
|
140
198
|
- Gemfile
|
141
199
|
- Gemfile.lock
|
142
200
|
- LICENSE.txt
|
@@ -145,9 +203,14 @@ files:
|
|
145
203
|
- bin/console
|
146
204
|
- bin/setup
|
147
205
|
- codecov.yaml
|
148
|
-
- docker
|
206
|
+
- docker/Dockerfile
|
207
|
+
- docker/Dockerfile.ci
|
149
208
|
- docker/bash
|
150
|
-
- docker/
|
209
|
+
- docker/build
|
210
|
+
- docker/ci
|
211
|
+
- docker/run
|
212
|
+
- docker/tag_and_push_latest
|
213
|
+
- lefthook.yml
|
151
214
|
- lib/kitchen/ancestor.rb
|
152
215
|
- lib/kitchen/book_document.rb
|
153
216
|
- lib/kitchen/book_element.rb
|
@@ -162,27 +225,76 @@ files:
|
|
162
225
|
- lib/kitchen/config.rb
|
163
226
|
- lib/kitchen/counter.rb
|
164
227
|
- lib/kitchen/debug/print_recipe_error.rb
|
228
|
+
- lib/kitchen/directions/.rubocop.yml
|
165
229
|
- lib/kitchen/directions/bake_appendix.rb
|
166
|
-
- lib/kitchen/directions/bake_chapter_glossary.rb
|
230
|
+
- lib/kitchen/directions/bake_chapter_glossary/main.rb
|
231
|
+
- lib/kitchen/directions/bake_chapter_glossary/v1.rb
|
167
232
|
- lib/kitchen/directions/bake_chapter_introductions.rb
|
233
|
+
- lib/kitchen/directions/bake_chapter_key_concepts/main.rb
|
234
|
+
- lib/kitchen/directions/bake_chapter_key_concepts/v1.rb
|
168
235
|
- lib/kitchen/directions/bake_chapter_key_equations.rb
|
236
|
+
- lib/kitchen/directions/bake_chapter_references/main.rb
|
237
|
+
- lib/kitchen/directions/bake_chapter_references/v1.rb
|
238
|
+
- lib/kitchen/directions/bake_chapter_section_exercises/main.rb
|
239
|
+
- lib/kitchen/directions/bake_chapter_section_exercises/v1.rb
|
169
240
|
- lib/kitchen/directions/bake_chapter_summary.rb
|
241
|
+
- lib/kitchen/directions/bake_chapter_title/main.rb
|
242
|
+
- lib/kitchen/directions/bake_chapter_title/v1.rb
|
243
|
+
- lib/kitchen/directions/bake_checkpoint.rb
|
244
|
+
- lib/kitchen/directions/bake_composite_chapters.rb
|
170
245
|
- lib/kitchen/directions/bake_composite_pages.rb
|
246
|
+
- lib/kitchen/directions/bake_equations.rb
|
171
247
|
- lib/kitchen/directions/bake_example.rb
|
172
|
-
- lib/kitchen/directions/bake_exercises.rb
|
173
248
|
- lib/kitchen/directions/bake_figure.rb
|
249
|
+
- lib/kitchen/directions/bake_first_elements.rb
|
174
250
|
- lib/kitchen/directions/bake_footnotes/main.rb
|
175
251
|
- lib/kitchen/directions/bake_footnotes/v1.rb
|
252
|
+
- lib/kitchen/directions/bake_free_response/free_response.xhtml.erb
|
253
|
+
- lib/kitchen/directions/bake_free_response/main.rb
|
254
|
+
- lib/kitchen/directions/bake_free_response/v1.rb
|
255
|
+
- lib/kitchen/directions/bake_further_research.rb
|
176
256
|
- lib/kitchen/directions/bake_index/main.rb
|
177
257
|
- lib/kitchen/directions/bake_index/v1.rb
|
178
258
|
- lib/kitchen/directions/bake_index/v1.xhtml.erb
|
259
|
+
- lib/kitchen/directions/bake_link_placeholders.rb
|
179
260
|
- lib/kitchen/directions/bake_math_in_paragraph.rb
|
180
|
-
- lib/kitchen/directions/
|
261
|
+
- lib/kitchen/directions/bake_non_introduction_pages.rb
|
262
|
+
- lib/kitchen/directions/bake_notes/bake_autotitled_notes.rb
|
263
|
+
- lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
|
264
|
+
- lib/kitchen/directions/bake_notes/bake_numbered_notes.rb
|
265
|
+
- lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
|
266
|
+
- lib/kitchen/directions/bake_numbered_exercise/main.rb
|
267
|
+
- lib/kitchen/directions/bake_numbered_exercise/v1.rb
|
181
268
|
- lib/kitchen/directions/bake_numbered_table/main.rb
|
182
269
|
- lib/kitchen/directions/bake_numbered_table/v1.rb
|
270
|
+
- lib/kitchen/directions/bake_page_abstracts.rb
|
271
|
+
- lib/kitchen/directions/bake_preface/main.rb
|
272
|
+
- lib/kitchen/directions/bake_preface/v1.rb
|
273
|
+
- lib/kitchen/directions/bake_references/main.rb
|
274
|
+
- lib/kitchen/directions/bake_references/v1.rb
|
183
275
|
- lib/kitchen/directions/bake_stepwise.rb
|
276
|
+
- lib/kitchen/directions/bake_suggested_reading.rb
|
277
|
+
- lib/kitchen/directions/bake_theorem/main.rb
|
278
|
+
- lib/kitchen/directions/bake_theorem/v1.rb
|
184
279
|
- lib/kitchen/directions/bake_toc.rb
|
280
|
+
- lib/kitchen/directions/bake_unit_title/main.rb
|
281
|
+
- lib/kitchen/directions/bake_unit_title/v1.rb
|
185
282
|
- lib/kitchen/directions/bake_unnumbered_tables.rb
|
283
|
+
- lib/kitchen/directions/book_answer_key_container/eob_solutions_container.xhtml.erb
|
284
|
+
- lib/kitchen/directions/book_answer_key_container/main.rb
|
285
|
+
- lib/kitchen/directions/book_answer_key_container/v1.rb
|
286
|
+
- lib/kitchen/directions/chapter_review_container/chapter_review.xhtml.erb
|
287
|
+
- lib/kitchen/directions/chapter_review_container/main.rb
|
288
|
+
- lib/kitchen/directions/chapter_review_container/v1.rb
|
289
|
+
- lib/kitchen/directions/eoc_section_title_link_snippet.rb
|
290
|
+
- lib/kitchen/directions/move_exercises_to_eoc/main.rb
|
291
|
+
- lib/kitchen/directions/move_exercises_to_eoc/v1.rb
|
292
|
+
- lib/kitchen/directions/move_exercises_to_eoc/v2.rb
|
293
|
+
- lib/kitchen/directions/move_solutions_to_answer_key/main.rb
|
294
|
+
- lib/kitchen/directions/move_solutions_to_answer_key/strategies/american_government.rb
|
295
|
+
- lib/kitchen/directions/move_solutions_to_answer_key/strategies/calculus.rb
|
296
|
+
- lib/kitchen/directions/move_solutions_to_answer_key/strategies/uphysics.rb
|
297
|
+
- lib/kitchen/directions/move_solutions_to_answer_key/v1.rb
|
186
298
|
- lib/kitchen/directions/move_title_text_into_span.rb
|
187
299
|
- lib/kitchen/document.rb
|
188
300
|
- lib/kitchen/element.rb
|
@@ -194,8 +306,12 @@ files:
|
|
194
306
|
- lib/kitchen/errors.rb
|
195
307
|
- lib/kitchen/example_element.rb
|
196
308
|
- lib/kitchen/example_element_enumerator.rb
|
309
|
+
- lib/kitchen/exercise_element.rb
|
310
|
+
- lib/kitchen/exercise_element_enumerator.rb
|
197
311
|
- lib/kitchen/figure_element.rb
|
198
312
|
- lib/kitchen/figure_element_enumerator.rb
|
313
|
+
- lib/kitchen/metadata_element.rb
|
314
|
+
- lib/kitchen/metadata_element_enumerator.rb
|
199
315
|
- lib/kitchen/mixins/block_error_if.rb
|
200
316
|
- lib/kitchen/note_element.rb
|
201
317
|
- lib/kitchen/note_element_enumerator.rb
|
@@ -207,43 +323,52 @@ files:
|
|
207
323
|
- lib/kitchen/patches/renderable.rb
|
208
324
|
- lib/kitchen/patches/string.rb
|
209
325
|
- lib/kitchen/recipe.rb
|
326
|
+
- lib/kitchen/reference_element.rb
|
327
|
+
- lib/kitchen/references_element_enumerator.rb
|
210
328
|
- lib/kitchen/search_history.rb
|
329
|
+
- lib/kitchen/search_query.rb
|
330
|
+
- lib/kitchen/selector.rb
|
211
331
|
- lib/kitchen/selectors/base.rb
|
212
332
|
- lib/kitchen/selectors/standard_1.rb
|
213
333
|
- lib/kitchen/table_element.rb
|
214
334
|
- lib/kitchen/table_element_enumerator.rb
|
335
|
+
- lib/kitchen/templates/eob_section_title_template.xhtml.erb
|
336
|
+
- lib/kitchen/templates/eoc_section_title_template.xhtml.erb
|
215
337
|
- lib/kitchen/term_element.rb
|
216
338
|
- lib/kitchen/term_element_enumerator.rb
|
217
339
|
- lib/kitchen/transliterations.rb
|
218
340
|
- lib/kitchen/type_casting_element_enumerator.rb
|
341
|
+
- lib/kitchen/unit_element.rb
|
342
|
+
- lib/kitchen/unit_element_enumerator.rb
|
219
343
|
- lib/kitchen/utils.rb
|
220
344
|
- lib/kitchen/version.rb
|
221
345
|
- lib/locales/en.yml
|
346
|
+
- lib/locales/pl.yml
|
222
347
|
- lib/notes.md
|
223
348
|
- lib/openstax_kitchen.rb
|
224
349
|
- openstax_kitchen.gemspec
|
225
350
|
- tutorials/00/expected_baked.html
|
226
351
|
- tutorials/00/raw.html
|
227
|
-
- tutorials/00/
|
228
|
-
- tutorials/00/
|
352
|
+
- tutorials/00/solution1.rb
|
353
|
+
- tutorials/00/solution2.rb
|
229
354
|
- tutorials/01/expected_baked.html
|
230
355
|
- tutorials/01/raw.html
|
231
|
-
- tutorials/01/
|
232
|
-
- tutorials/01/
|
356
|
+
- tutorials/01/solution1.rb
|
357
|
+
- tutorials/01/solution2.rb
|
233
358
|
- tutorials/02/expected_baked.html
|
234
359
|
- tutorials/02/raw.html
|
235
|
-
- tutorials/02/
|
360
|
+
- tutorials/02/solution1.rb
|
236
361
|
- tutorials/03/expected_baked.html
|
237
362
|
- tutorials/03/raw.html
|
238
|
-
- tutorials/03/
|
239
|
-
- tutorials/03/
|
363
|
+
- tutorials/03/solution1.rb
|
364
|
+
- tutorials/03/solution2.rb
|
240
365
|
- tutorials/04/expected_baked.html
|
241
366
|
- tutorials/04/raw.html
|
242
|
-
- tutorials/04/
|
243
|
-
- tutorials/04/
|
367
|
+
- tutorials/04/solution1.rb
|
368
|
+
- tutorials/04/solution2.rb
|
244
369
|
- tutorials/05/expected_baked.html
|
245
370
|
- tutorials/05/raw.html
|
246
|
-
- tutorials/05/
|
371
|
+
- tutorials/05/solution1.rb
|
247
372
|
- tutorials/check_it
|
248
373
|
- tutorials/setup_my_recipes
|
249
374
|
homepage: https://github.com/openstax/kitchen
|
@@ -262,7 +387,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
262
387
|
requirements:
|
263
388
|
- - ">="
|
264
389
|
- !ruby/object:Gem::Version
|
265
|
-
version: 2.
|
390
|
+
version: 2.4.0
|
266
391
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
392
|
requirements:
|
268
393
|
- - ">="
|
data/Dockerfile
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
FROM ruby:2.6-slim
|
2
|
-
|
3
|
-
RUN apt-get update && \
|
4
|
-
apt-get install -y --no-install-recommends \
|
5
|
-
git \
|
6
|
-
build-essential \
|
7
|
-
&& rm -rf /var/lib/apt/lists/*
|
8
|
-
|
9
|
-
WORKDIR /code
|
10
|
-
COPY . /code/
|
11
|
-
|
12
|
-
RUN gem install bundler
|
13
|
-
RUN bundle install
|
14
|
-
|
15
|
-
# Install other things that make development good
|
16
|
-
RUN gem install solargraph
|
17
|
-
RUN bundle exec yard gems
|
18
|
-
|
19
|
-
ENTRYPOINT ["/code/docker/entrypoint"]
|
data/docker-compose.yml
DELETED
data/docker/entrypoint
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
module Kitchen
|
2
|
-
module Directions
|
3
|
-
module BakeChapterGlossary
|
4
|
-
|
5
|
-
def self.v1(chapter:, metadata_source:)
|
6
|
-
metadata_elements = metadata_source.search(%w(.authors .publishers .print-style
|
7
|
-
.permissions [data-type='subject'])).copy
|
8
|
-
|
9
|
-
definitions = chapter.glossaries.search("dl").cut
|
10
|
-
definitions.sort_by! do |definition|
|
11
|
-
[definition.first("dt").text.downcase, definition.first("dd").text.downcase]
|
12
|
-
end
|
13
|
-
|
14
|
-
chapter.glossaries.trash
|
15
|
-
|
16
|
-
chapter.append(child:
|
17
|
-
<<~HTML
|
18
|
-
<div class="os-eoc os-glossary-container" data-type="composite-page" data-uuid-key="glossary">
|
19
|
-
<h2 data-type="document-title">
|
20
|
-
<span class="os-text">#{I18n.t(:eoc_key_terms_title)}</span>
|
21
|
-
</h2>
|
22
|
-
<div data-type="metadata" style="display: none;">
|
23
|
-
<h1 data-type="document-title" itemprop="name">#{I18n.t(:eoc_key_terms_title)}</h1>
|
24
|
-
#{metadata_elements.paste}
|
25
|
-
</div>
|
26
|
-
#{definitions.paste}
|
27
|
-
</div>
|
28
|
-
HTML
|
29
|
-
) unless definitions.none?
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,164 +0,0 @@
|
|
1
|
-
module Kitchen
|
2
|
-
module Directions
|
3
|
-
module BakeExercises
|
4
|
-
|
5
|
-
def self.v1(book:)
|
6
|
-
metadata_elements = book.metadata.search(%w(.authors .publishers .print-style
|
7
|
-
.permissions [data-type='subject'])).copy
|
8
|
-
|
9
|
-
solutions_clipboards = []
|
10
|
-
|
11
|
-
book.chapters.each do |chapter|
|
12
|
-
exercise_clipboard = Clipboard.new
|
13
|
-
solution_clipboard = Clipboard.new
|
14
|
-
solutions_clipboards.push(solution_clipboard)
|
15
|
-
|
16
|
-
chapter.pages("$:not(.introduction)").each do |page|
|
17
|
-
exercise_section = page.exercises
|
18
|
-
exercise_section.first("[data-type='title']")&.trash
|
19
|
-
exercise_section_title = page.title.copy
|
20
|
-
exercise_section_title.name = "h3"
|
21
|
-
exercise_section_title.replace_children(with: <<~HTML
|
22
|
-
<span class="os-number">#{chapter.count_in(:book)}.#{page.count_in(:chapter)}</span>
|
23
|
-
<span class="os-divider"> </span>
|
24
|
-
<span class="os-text" data-type="" itemprop="">#{exercise_section_title.children}</span>
|
25
|
-
HTML
|
26
|
-
)
|
27
|
-
|
28
|
-
exercise_section.prepend(child:
|
29
|
-
<<~HTML
|
30
|
-
<a href="##{page.title.id}">
|
31
|
-
#{exercise_section_title.paste}
|
32
|
-
</a>
|
33
|
-
HTML
|
34
|
-
)
|
35
|
-
|
36
|
-
exercise_section.search("[data-type='exercise']").each do |exercise|
|
37
|
-
exercise.document.pantry(name: :link_text).store(
|
38
|
-
"#{I18n.t(:exercise_label)} #{chapter.count_in(:book)}.#{exercise.count_in(:chapter)}",
|
39
|
-
label: exercise.id
|
40
|
-
)
|
41
|
-
|
42
|
-
bake_exercise_in_place(exercise: exercise)
|
43
|
-
exercise.first("[data-type='solution']")&.cut(to: solution_clipboard)
|
44
|
-
end
|
45
|
-
|
46
|
-
exercise_section.cut(to: exercise_clipboard)
|
47
|
-
end
|
48
|
-
|
49
|
-
chapter.append(child:
|
50
|
-
<<~HTML
|
51
|
-
<div class="os-eoc os-exercises-container" data-type="composite-page" data-uuid-key=".exercises">
|
52
|
-
<h2 data-type="document-title">
|
53
|
-
<span class="os-text">#{I18n.t(:eoc_exercises_title)}</span>
|
54
|
-
</h2>
|
55
|
-
<div data-type="metadata" style="display: none;">
|
56
|
-
<h1 data-type="document-title" itemprop="name">#{I18n.t(:eoc_exercises_title)}</h1>
|
57
|
-
#{metadata_elements.paste}
|
58
|
-
</div>
|
59
|
-
#{exercise_clipboard.paste}
|
60
|
-
</div>
|
61
|
-
HTML
|
62
|
-
) unless exercise_clipboard.none?
|
63
|
-
end
|
64
|
-
|
65
|
-
# Store a paste here to use at end so that uniquifyied IDs match legacy baking
|
66
|
-
eob_metadata = metadata_elements.paste
|
67
|
-
|
68
|
-
solutions = solutions_clipboards.map.with_index do |solution_clipboard, index|
|
69
|
-
<<~HTML
|
70
|
-
<div class="os-eob os-solution-container " data-type="composite-page" data-uuid-key=".solution#{index+1}">
|
71
|
-
<h2 data-type="document-title">
|
72
|
-
<span class="os-text">#{index+1}</span>
|
73
|
-
</h2>
|
74
|
-
<div data-type="metadata" style="display: none;">
|
75
|
-
<h1 data-type="document-title" itemprop="name">#{index+1}</h1>
|
76
|
-
#{metadata_elements.paste}
|
77
|
-
</div>
|
78
|
-
#{solution_clipboard.paste}
|
79
|
-
</div>
|
80
|
-
HTML
|
81
|
-
end
|
82
|
-
|
83
|
-
book.first("body").append(child:
|
84
|
-
<<~HTML
|
85
|
-
<div class="os-eob os-solution-container " data-type="composite-chapter" data-uuid-key=".solution">
|
86
|
-
<h1 data-type="document-title" id="composite-chapter-1">
|
87
|
-
<span class="os-text">#{I18n.t(:eoc_answer_key_title)}</span>
|
88
|
-
</h1>
|
89
|
-
<div data-type="metadata" style="display: none;">
|
90
|
-
<h1 data-type="document-title" itemprop="name">#{I18n.t(:eoc_answer_key_title)}</h1>
|
91
|
-
#{eob_metadata}
|
92
|
-
</div>
|
93
|
-
#{solutions.join("\n")}
|
94
|
-
</div>
|
95
|
-
HTML
|
96
|
-
) unless solutions.none?
|
97
|
-
end
|
98
|
-
|
99
|
-
def self.bake_exercise_in_place(exercise:)
|
100
|
-
# Bake an exercise in place going from:
|
101
|
-
#
|
102
|
-
# <div data-type="exercise" id="exerciseId">
|
103
|
-
# <div data-type="problem" id="problemId">
|
104
|
-
# Problem Content
|
105
|
-
# </div>
|
106
|
-
# <div data-type="solution" id="solutionId">
|
107
|
-
# Solution Content
|
108
|
-
# </div>
|
109
|
-
# </div>
|
110
|
-
#
|
111
|
-
# to
|
112
|
-
#
|
113
|
-
# <div data-type="exercise" id="exerciseId" class="os-hasSolution">
|
114
|
-
# <div data-type="problem" id="problemId">
|
115
|
-
# <a class="os-number" href="#exerciseId-solution">1</a>
|
116
|
-
# <span class="os-divider">. </span>
|
117
|
-
# <div class="os-problem-container ">
|
118
|
-
# Problem Content
|
119
|
-
# </div>
|
120
|
-
# </div>
|
121
|
-
# <div data-type="solution" id="exerciseId-solution">
|
122
|
-
# <a class="os-number" href="#exerciseId">1</a>
|
123
|
-
# <span class="os-divider">. </span>
|
124
|
-
# <div class="os-solution-container ">
|
125
|
-
# Solution Content
|
126
|
-
# </div>
|
127
|
-
# </div>
|
128
|
-
# </div>
|
129
|
-
#
|
130
|
-
# If there is no solution, don't add the 'os-hasSolution' class and don't
|
131
|
-
# link the number.
|
132
|
-
|
133
|
-
problem = exercise.first("[data-type='problem']")
|
134
|
-
solution = exercise.first("[data-type='solution']")
|
135
|
-
|
136
|
-
problem_number = "<span class='os-number'>#{exercise.count_in(:chapter)}</span>"
|
137
|
-
|
138
|
-
if solution.present?
|
139
|
-
solution.id = "#{exercise.id}-solution"
|
140
|
-
|
141
|
-
exercise.add_class("os-hasSolution")
|
142
|
-
problem_number = "<a href='##{solution.id}' class='os-number' >#{exercise.count_in(:chapter)}</a>"
|
143
|
-
|
144
|
-
solution.replace_children(with:
|
145
|
-
<<~HTML
|
146
|
-
<a class="os-number" href="##{exercise.id}">#{exercise.count_in(:chapter)}</a>
|
147
|
-
<span class="os-divider">. </span>
|
148
|
-
<div class="os-solution-container ">#{solution.children}</div>
|
149
|
-
HTML
|
150
|
-
)
|
151
|
-
end
|
152
|
-
|
153
|
-
problem.replace_children(with:
|
154
|
-
<<~HTML
|
155
|
-
#{problem_number}
|
156
|
-
<span class="os-divider">. </span>
|
157
|
-
<div class="os-problem-container ">#{problem.children}</div>
|
158
|
-
HTML
|
159
|
-
)
|
160
|
-
end
|
161
|
-
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|