openstax_kitchen 4.0.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/changelog.yml +24 -0
  3. data/.github/workflows/rubocop.yml +28 -0
  4. data/CHANGELOG.md +58 -0
  5. data/Gemfile.lock +15 -6
  6. data/README.md +16 -0
  7. data/codecov.yaml +1 -0
  8. data/docker/rubocop +22 -0
  9. data/lib/kitchen/book_document.rb +1 -1
  10. data/lib/kitchen/chapter_element.rb +2 -2
  11. data/lib/kitchen/composite_chapter_element_enumerator.rb +21 -0
  12. data/lib/kitchen/composite_page_element.rb +19 -2
  13. data/lib/kitchen/config.rb +7 -0
  14. data/lib/kitchen/directions/bake_appendix.rb +3 -1
  15. data/lib/kitchen/directions/bake_chapter_introductions.rb +22 -15
  16. data/lib/kitchen/directions/bake_chapter_introductions/chapter_introduction.xhtml.erb +0 -0
  17. data/lib/kitchen/directions/bake_chapter_key_concepts/v1.rb +1 -1
  18. data/lib/kitchen/directions/bake_chapter_references/main.rb +15 -0
  19. data/lib/kitchen/directions/bake_chapter_references/v1.rb +49 -0
  20. data/lib/kitchen/directions/bake_chapter_section_exercises/main.rb +2 -2
  21. data/lib/kitchen/directions/bake_chapter_section_exercises/v1.rb +2 -1
  22. data/lib/kitchen/directions/bake_chapter_solutions/main.rb +11 -0
  23. data/lib/kitchen/directions/bake_chapter_solutions/v1.rb +37 -0
  24. data/lib/kitchen/directions/bake_chapter_summary.rb +13 -6
  25. data/lib/kitchen/directions/bake_composite_chapters.rb +1 -1
  26. data/lib/kitchen/directions/bake_composite_pages.rb +1 -1
  27. data/lib/kitchen/directions/bake_equations.rb +1 -1
  28. data/lib/kitchen/directions/bake_example.rb +4 -1
  29. data/lib/kitchen/directions/bake_figure.rb +13 -0
  30. data/lib/kitchen/directions/bake_first_elements.rb +7 -1
  31. data/lib/kitchen/directions/bake_footnotes/main.rb +2 -2
  32. data/lib/kitchen/directions/bake_footnotes/v1.rb +11 -8
  33. data/lib/kitchen/directions/bake_further_research.rb +2 -0
  34. data/lib/kitchen/directions/bake_index/v1.rb +3 -14
  35. data/lib/kitchen/directions/bake_inline_lists.rb +22 -0
  36. data/lib/kitchen/directions/bake_notes/bake_numbered_notes/main.rb +43 -0
  37. data/lib/kitchen/directions/bake_notes/bake_numbered_notes/v1.rb +37 -0
  38. data/lib/kitchen/directions/bake_notes/bake_numbered_notes/v2.rb +25 -0
  39. data/lib/kitchen/directions/bake_notes/bake_numbered_notes/v3.rb +32 -0
  40. data/lib/kitchen/directions/bake_numbered_exercise/main.rb +3 -2
  41. data/lib/kitchen/directions/bake_numbered_exercise/v1.rb +10 -1
  42. data/lib/kitchen/directions/bake_numbered_table/bake_table_body.rb +29 -0
  43. data/lib/kitchen/directions/bake_numbered_table/main.rb +4 -0
  44. data/lib/kitchen/directions/bake_numbered_table/v1.rb +1 -24
  45. data/lib/kitchen/directions/bake_numbered_table/v2.rb +31 -0
  46. data/lib/kitchen/directions/bake_preface/main.rb +2 -2
  47. data/lib/kitchen/directions/bake_preface/v1.rb +3 -2
  48. data/lib/kitchen/directions/bake_references/main.rb +7 -0
  49. data/lib/kitchen/directions/bake_references/v2.rb +35 -0
  50. data/lib/kitchen/directions/bake_toc.rb +3 -1
  51. data/lib/kitchen/directions/book_answer_key_container/eob_answer_key_outer_container.xhtml.erb +9 -0
  52. data/lib/kitchen/directions/book_answer_key_container/main.rb +2 -2
  53. data/lib/kitchen/directions/book_answer_key_container/v1.rb +4 -3
  54. data/lib/kitchen/directions/chapter_review_container/chapter_review.xhtml.erb +3 -3
  55. data/lib/kitchen/directions/chapter_review_container/main.rb +2 -2
  56. data/lib/kitchen/directions/chapter_review_container/v1.rb +4 -2
  57. data/lib/kitchen/directions/eoc_section_title_link_snippet.rb +13 -0
  58. data/lib/kitchen/directions/move_exercises_to_eoc/main.rb +10 -0
  59. data/lib/kitchen/directions/move_exercises_to_eoc/v3.rb +49 -0
  60. data/lib/kitchen/directions/move_solutions_to_answer_key/main.rb +6 -2
  61. data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/default.rb +27 -0
  62. data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/precalculus.rb +84 -0
  63. data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/uphysics.rb +2 -2
  64. data/lib/kitchen/directions/move_solutions_to_answer_key/v1.rb +11 -7
  65. data/lib/kitchen/document.rb +19 -52
  66. data/lib/kitchen/element_base.rb +48 -12
  67. data/lib/kitchen/element_enumerator_base.rb +24 -1
  68. data/lib/kitchen/element_enumerator_factory.rb +19 -7
  69. data/lib/kitchen/exercise_element.rb +2 -2
  70. data/lib/kitchen/id_tracker.rb +68 -0
  71. data/lib/kitchen/oven.rb +5 -1
  72. data/lib/kitchen/page_element.rb +7 -5
  73. data/lib/kitchen/patches/i18n.rb +34 -0
  74. data/lib/kitchen/patches/integer.rb +24 -0
  75. data/lib/kitchen/patches/nokogiri.rb +62 -0
  76. data/lib/kitchen/patches/nokogiri_profiling.rb +60 -0
  77. data/lib/kitchen/search_query.rb +6 -0
  78. data/lib/kitchen/selector.rb +3 -2
  79. data/lib/kitchen/version.rb +1 -1
  80. data/lib/locales/en.yml +2 -1
  81. data/lib/locales/es.yml +33 -0
  82. data/lib/locales/pl.yml +4 -2
  83. data/lib/openstax_kitchen.rb +1 -5
  84. data/openstax_kitchen.gemspec +1 -0
  85. metadata +42 -7
  86. data/.github/config.yml +0 -14
  87. data/lib/kitchen/directions/bake_notes/bake_numbered_notes.rb +0 -51
  88. data/lib/kitchen/directions/book_answer_key_container/eob_solutions_container.xhtml.erb +0 -9
  89. data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/american_government.rb +0 -19
  90. data/lib/kitchen/transliterations.rb +0 -21
@@ -7,7 +7,8 @@ module Kitchen
7
7
  attr_reader :name
8
8
 
9
9
  def self.named(name)
10
- new(name) { |config| config.selectors.send(name) }
10
+ @instances ||= {}
11
+ @instances[name] ||= new(name) { |config| config.selectors.send(name) }
11
12
  end
12
13
 
13
14
  def initialize(name, &block)
@@ -18,7 +19,7 @@ module Kitchen
18
19
  def matches?(node, config:)
19
20
  # This may not be incredibly efficient as it does a search of this node's
20
21
  # ancestors to see if the node is in the results. Watch the performance.
21
- node.matches?(call(config))
22
+ node.quick_matches?(call(config))
22
23
  end
23
24
  end
24
25
  end
@@ -3,5 +3,5 @@
3
3
  # A library for modifying the structure of OpenStax book XML.
4
4
  #
5
5
  module Kitchen
6
- VERSION = '4.0.0'
6
+ VERSION = '6.1.0'
7
7
  end
data/lib/locales/en.yml CHANGED
@@ -16,12 +16,13 @@ en:
16
16
  learning_objectives: Learning Objectives
17
17
  stepwise_step_label: Step
18
18
  references: References
19
+ answer_key_title: Answer Key
19
20
  eoc_chapter_review: Chapter Review
20
21
  eoc_key_terms_title: Key Terms
21
22
  eoc_summary_title: Summary
22
23
  eoc_exercises_title: Exercises
23
24
  eoc_composite_metadata_title: Chapter Review
24
- eoc_answer_key_title: Answer Key
25
+ eoc_solutions_title: Solutions
25
26
  eoc_key_concepts: Key Concepts
26
27
  eoc_key_equations: Key Equations
27
28
  eoc_suggested_reading: Suggestions for Further Study
@@ -0,0 +1,33 @@
1
+ es:
2
+ figure: Figura
3
+ table_label: Tabla
4
+ appendix: Apéndice
5
+ theorem: Teorema
6
+ solution: Solución
7
+ chapter_outline: Esquema Del Capitulo
8
+ toc_title: Contenido
9
+ example_label: Ejemplo
10
+ exercise_label: Ejercicio
11
+ equation: Ecuación
12
+ chapter: Capítulo
13
+ unit: Unidad
14
+ checkpoint: Punto De Control
15
+ chapter_review: Revisión Del Capítulo
16
+ learning_objectives: Objetivos De Aprendizaje
17
+ stepwise_step_label: Paso
18
+ references: Referencias
19
+ answer_key_title: Respuestas Clave
20
+ eoc_chapter_review: Revisión Del Capítulo
21
+ eoc_key_terms_title: Términos Clave
22
+ eoc_summary_title: Resumen
23
+ eoc_exercises_title: Ejercicios
24
+ eoc_composite_metadata_title: Revisión Del Capítulo
25
+ eoc_solutions_title: Soluciones
26
+ eoc_key_concepts: Conceptos Clave
27
+ eoc_key_equations: Ecuaciones Clave
28
+ eoc_suggested_reading: Sugerencias Para Estudios Adicionales
29
+ eoc_further_research_title: Investigación Adicional
30
+ eob_index_title: Índice
31
+ eob_index_symbols_group: Símbolos
32
+ review_exercises: Ejercicios De Repaso
33
+ section_exercises: ! 'Sección %{number} Ejercicios'
data/lib/locales/pl.yml CHANGED
@@ -14,11 +14,13 @@ pl:
14
14
  chapter_review: Podsumowanie rozdziału
15
15
  learning_objectives: Cel dydaktyczny
16
16
  stepwise_step_label: Krok
17
+ answer_key_title: Rozwiązania zadań
17
18
  eoc_chapter_review: Podsumowanie rozdziału
18
- eoc_key_terms_title: Kluczowe pojęcia
19
+ key_terms_title: Kluczowe pojęcia
20
+ eoc_solutions_title: Rozwiązania
19
21
  eoc_summary_title: Podsumowanie
20
- eoc_answer_key_title: Rozwiązania zadań
21
22
  eoc_key_equations: Najważniejsze wzory
22
23
  eob_index_title: Skorowidz rzeczowy
23
24
  eob_index_symbols_group: Symbole
25
+ references: Bibliografia
24
26
 
@@ -25,7 +25,6 @@ require 'kitchen/selectors/base'
25
25
  require_all('kitchen/selectors')
26
26
 
27
27
  require 'kitchen/utils'
28
- require 'kitchen/transliterations'
29
28
  require 'kitchen/errors'
30
29
  require 'kitchen/ancestor'
31
30
  require 'kitchen/search_query'
@@ -41,6 +40,7 @@ require 'kitchen/clipboard'
41
40
  require 'kitchen/pantry'
42
41
  require 'kitchen/counter'
43
42
  require 'kitchen/selector'
43
+ require 'kitchen/id_tracker'
44
44
 
45
45
  require 'kitchen/element_enumerator_base'
46
46
  require 'kitchen/element_enumerator_factory'
@@ -53,7 +53,3 @@ require 'kitchen/element_factory'
53
53
  require_all('kitchen/directions')
54
54
 
55
55
  I18n.backend.load_translations(file_glob('/locales/*.yml'))
56
-
57
- I18n.available_locales.each do |available_locale|
58
- I18n.backend.store_translations(available_locale, Kitchen::TRANSLITERATIONS)
59
- end
@@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_dependency 'i18n'
34
34
  spec.add_dependency 'nokogiri'
35
35
  spec.add_dependency 'rainbow'
36
+ spec.add_dependency 'twitter_cldr'
36
37
 
37
38
  spec.add_development_dependency 'byebug'
38
39
  spec.add_development_dependency 'inch'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_kitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 6.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: 2021-05-19 00:00:00.000000000 Z
11
+ date: 2021-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: twitter_cldr
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: byebug
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -186,7 +200,8 @@ extensions: []
186
200
  extra_rdoc_files: []
187
201
  files:
188
202
  - ".devcontainer/devcontainer.json"
189
- - ".github/config.yml"
203
+ - ".github/workflows/changelog.yml"
204
+ - ".github/workflows/rubocop.yml"
190
205
  - ".github/workflows/tests.yml"
191
206
  - ".gitignore"
192
207
  - ".inch.yml"
@@ -208,6 +223,7 @@ files:
208
223
  - docker/bash
209
224
  - docker/build
210
225
  - docker/ci
226
+ - docker/rubocop
211
227
  - docker/run
212
228
  - docker/tag_and_push_latest
213
229
  - lefthook.yml
@@ -220,6 +236,7 @@ files:
220
236
  - lib/kitchen/chapter_element_enumerator.rb
221
237
  - lib/kitchen/clipboard.rb
222
238
  - lib/kitchen/composite_chapter_element.rb
239
+ - lib/kitchen/composite_chapter_element_enumerator.rb
223
240
  - lib/kitchen/composite_page_element.rb
224
241
  - lib/kitchen/composite_page_element_enumerator.rb
225
242
  - lib/kitchen/config.rb
@@ -230,11 +247,16 @@ files:
230
247
  - lib/kitchen/directions/bake_chapter_glossary/main.rb
231
248
  - lib/kitchen/directions/bake_chapter_glossary/v1.rb
232
249
  - lib/kitchen/directions/bake_chapter_introductions.rb
250
+ - lib/kitchen/directions/bake_chapter_introductions/chapter_introduction.xhtml.erb
233
251
  - lib/kitchen/directions/bake_chapter_key_concepts/main.rb
234
252
  - lib/kitchen/directions/bake_chapter_key_concepts/v1.rb
235
253
  - lib/kitchen/directions/bake_chapter_key_equations.rb
254
+ - lib/kitchen/directions/bake_chapter_references/main.rb
255
+ - lib/kitchen/directions/bake_chapter_references/v1.rb
236
256
  - lib/kitchen/directions/bake_chapter_section_exercises/main.rb
237
257
  - lib/kitchen/directions/bake_chapter_section_exercises/v1.rb
258
+ - lib/kitchen/directions/bake_chapter_solutions/main.rb
259
+ - lib/kitchen/directions/bake_chapter_solutions/v1.rb
238
260
  - lib/kitchen/directions/bake_chapter_summary.rb
239
261
  - lib/kitchen/directions/bake_chapter_title/main.rb
240
262
  - lib/kitchen/directions/bake_chapter_title/v1.rb
@@ -254,22 +276,29 @@ files:
254
276
  - lib/kitchen/directions/bake_index/main.rb
255
277
  - lib/kitchen/directions/bake_index/v1.rb
256
278
  - lib/kitchen/directions/bake_index/v1.xhtml.erb
279
+ - lib/kitchen/directions/bake_inline_lists.rb
257
280
  - lib/kitchen/directions/bake_link_placeholders.rb
258
281
  - lib/kitchen/directions/bake_math_in_paragraph.rb
259
282
  - lib/kitchen/directions/bake_non_introduction_pages.rb
260
283
  - lib/kitchen/directions/bake_notes/bake_autotitled_notes.rb
261
284
  - lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
262
- - lib/kitchen/directions/bake_notes/bake_numbered_notes.rb
285
+ - lib/kitchen/directions/bake_notes/bake_numbered_notes/main.rb
286
+ - lib/kitchen/directions/bake_notes/bake_numbered_notes/v1.rb
287
+ - lib/kitchen/directions/bake_notes/bake_numbered_notes/v2.rb
288
+ - lib/kitchen/directions/bake_notes/bake_numbered_notes/v3.rb
263
289
  - lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
264
290
  - lib/kitchen/directions/bake_numbered_exercise/main.rb
265
291
  - lib/kitchen/directions/bake_numbered_exercise/v1.rb
292
+ - lib/kitchen/directions/bake_numbered_table/bake_table_body.rb
266
293
  - lib/kitchen/directions/bake_numbered_table/main.rb
267
294
  - lib/kitchen/directions/bake_numbered_table/v1.rb
295
+ - lib/kitchen/directions/bake_numbered_table/v2.rb
268
296
  - lib/kitchen/directions/bake_page_abstracts.rb
269
297
  - lib/kitchen/directions/bake_preface/main.rb
270
298
  - lib/kitchen/directions/bake_preface/v1.rb
271
299
  - lib/kitchen/directions/bake_references/main.rb
272
300
  - lib/kitchen/directions/bake_references/v1.rb
301
+ - lib/kitchen/directions/bake_references/v2.rb
273
302
  - lib/kitchen/directions/bake_stepwise.rb
274
303
  - lib/kitchen/directions/bake_suggested_reading.rb
275
304
  - lib/kitchen/directions/bake_theorem/main.rb
@@ -278,7 +307,7 @@ files:
278
307
  - lib/kitchen/directions/bake_unit_title/main.rb
279
308
  - lib/kitchen/directions/bake_unit_title/v1.rb
280
309
  - lib/kitchen/directions/bake_unnumbered_tables.rb
281
- - lib/kitchen/directions/book_answer_key_container/eob_solutions_container.xhtml.erb
310
+ - lib/kitchen/directions/book_answer_key_container/eob_answer_key_outer_container.xhtml.erb
282
311
  - lib/kitchen/directions/book_answer_key_container/main.rb
283
312
  - lib/kitchen/directions/book_answer_key_container/v1.rb
284
313
  - lib/kitchen/directions/chapter_review_container/chapter_review.xhtml.erb
@@ -288,9 +317,11 @@ files:
288
317
  - lib/kitchen/directions/move_exercises_to_eoc/main.rb
289
318
  - lib/kitchen/directions/move_exercises_to_eoc/v1.rb
290
319
  - lib/kitchen/directions/move_exercises_to_eoc/v2.rb
320
+ - lib/kitchen/directions/move_exercises_to_eoc/v3.rb
291
321
  - lib/kitchen/directions/move_solutions_to_answer_key/main.rb
292
- - lib/kitchen/directions/move_solutions_to_answer_key/strategies/american_government.rb
293
322
  - lib/kitchen/directions/move_solutions_to_answer_key/strategies/calculus.rb
323
+ - lib/kitchen/directions/move_solutions_to_answer_key/strategies/default.rb
324
+ - lib/kitchen/directions/move_solutions_to_answer_key/strategies/precalculus.rb
294
325
  - lib/kitchen/directions/move_solutions_to_answer_key/strategies/uphysics.rb
295
326
  - lib/kitchen/directions/move_solutions_to_answer_key/v1.rb
296
327
  - lib/kitchen/directions/move_title_text_into_span.rb
@@ -308,6 +339,7 @@ files:
308
339
  - lib/kitchen/exercise_element_enumerator.rb
309
340
  - lib/kitchen/figure_element.rb
310
341
  - lib/kitchen/figure_element_enumerator.rb
342
+ - lib/kitchen/id_tracker.rb
311
343
  - lib/kitchen/metadata_element.rb
312
344
  - lib/kitchen/metadata_element_enumerator.rb
313
345
  - lib/kitchen/mixins/block_error_if.rb
@@ -317,7 +349,10 @@ files:
317
349
  - lib/kitchen/page_element.rb
318
350
  - lib/kitchen/page_element_enumerator.rb
319
351
  - lib/kitchen/pantry.rb
352
+ - lib/kitchen/patches/i18n.rb
353
+ - lib/kitchen/patches/integer.rb
320
354
  - lib/kitchen/patches/nokogiri.rb
355
+ - lib/kitchen/patches/nokogiri_profiling.rb
321
356
  - lib/kitchen/patches/renderable.rb
322
357
  - lib/kitchen/patches/string.rb
323
358
  - lib/kitchen/recipe.rb
@@ -334,13 +369,13 @@ files:
334
369
  - lib/kitchen/templates/eoc_section_title_template.xhtml.erb
335
370
  - lib/kitchen/term_element.rb
336
371
  - lib/kitchen/term_element_enumerator.rb
337
- - lib/kitchen/transliterations.rb
338
372
  - lib/kitchen/type_casting_element_enumerator.rb
339
373
  - lib/kitchen/unit_element.rb
340
374
  - lib/kitchen/unit_element_enumerator.rb
341
375
  - lib/kitchen/utils.rb
342
376
  - lib/kitchen/version.rb
343
377
  - lib/locales/en.yml
378
+ - lib/locales/es.yml
344
379
  - lib/locales/pl.yml
345
380
  - lib/notes.md
346
381
  - lib/openstax_kitchen.rb
data/.github/config.yml DELETED
@@ -1,14 +0,0 @@
1
- # See https://github.com/openstax/staxly#plugins for more options for this file
2
- changelog:
3
- # See https://github.com/mikz/probot-changelog for details
4
-
5
- # The filename of the CHANGELOG that needs to be updated in every PullRequest
6
- filename: CHANGELOG.md
7
-
8
- # (optional) when files matching these patterns are changed then disallow merging
9
- # until the CHANGELOG is updated.
10
- # If this pattern is not included then **all** Pull Requests require an edit to
11
- # the CHANGELOG file
12
-
13
- # include:
14
- # - /^src\//
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kitchen
4
- module Directions
5
- module BakeNumberedNotes
6
- def self.v1(book:, classes:)
7
- classes.each do |klass|
8
- book.chapters.notes("$.#{klass}").each do |note|
9
- bake_note(note: note)
10
- note.exercises.each do |exercise|
11
- bake_note_exercise(note: note, exercise: exercise)
12
- end
13
- end
14
- end
15
- end
16
-
17
- def self.bake_note(note:)
18
- note.wrap_children(class: 'os-note-body')
19
-
20
- chapter_count = note.ancestor(:chapter).count_in(:book)
21
- note_count = note.count_in(:chapter)
22
- note.prepend(child:
23
- <<~HTML
24
- <h3 class="os-title">
25
- <span class="os-title-label">#{note.autogenerated_title}</span>
26
- <span class="os-number">#{chapter_count}.#{note_count}</span>
27
- <span class="os-divider"> </span>
28
- </h3>
29
- HTML
30
- )
31
-
32
- return unless note['use-subtitle']
33
-
34
- BakeNoteSubtitle.v1(note: note)
35
- end
36
-
37
- def self.bake_note_exercise(note:, exercise:)
38
- exercise.add_class('unnumbered')
39
- # bake problem
40
- exercise.problem.wrap_children('div', class: 'os-problem-container')
41
- exercise.problem.first('strong')&.trash
42
- exercise.search('[data-type="commentary"]').each(&:trash)
43
- return unless exercise.solution
44
-
45
- # bake solution in place
46
- BakeNumberedExercise.bake_solution_v1(
47
- exercise: exercise, number: note.first('.os-number').text, divider: ' ')
48
- end
49
- end
50
- end
51
- end
@@ -1,9 +0,0 @@
1
- <div class="os-eob os-solutions-container" data-type="composite-chapter" data-uuid-key=".solutions">
2
- <h1 data-type="document-title">
3
- <span class="os-text"><%= I18n.t(:eoc_answer_key_title) %></span>
4
- </h1>
5
- <div data-type="metadata" style="display: none;">
6
- <h1 data-type="document-title" itemprop="name"><%= I18n.t(:eoc_answer_key_title) %></h1>
7
- <%= @metadata.paste %>
8
- </div>
9
- </div>
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kitchen::Directions::MoveSolutionsToAnswerKey
4
- module Strategies
5
- class AmericanGovernment
6
- def bake(chapter:, append_to:)
7
- bake_section(chapter: chapter, append_to: append_to, klass: 'review-questions')
8
- end
9
-
10
- protected
11
-
12
- def bake_section(chapter:, append_to:, klass:)
13
- chapter.search(".#{klass} [data-type='solution']").each do |solution|
14
- append_to.add_child(solution.cut.to_s)
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kitchen
4
- # These are added to every translation locale, including the `test` locale
5
- # set by `stub_locales`. When we sort strings with accent marks, we use
6
- # `ActiveSupport::Inflector.transliterate` to ensure that the sorting is
7
- # sensible. This method does not know about Greek characters by default so
8
- # we teach it about them by adding the rules below to the i18n configuration.
9
- #
10
- TRANSLITERATIONS = {
11
- i18n: {
12
- transliterate: {
13
- rule: {
14
- σ: 'σ',
15
- Δ: 'Δ',
16
- π: 'π'
17
- }
18
- }
19
- }
20
- }.freeze
21
- end