openstax_kitchen 3.1.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/CHANGELOG.md +64 -0
  4. data/Gemfile.lock +20 -14
  5. data/README.md +16 -0
  6. data/codecov.yaml +1 -0
  7. data/docker/ci +0 -1
  8. data/lib/kitchen/book_document.rb +1 -1
  9. data/lib/kitchen/book_element.rb +16 -2
  10. data/lib/kitchen/chapter_element.rb +10 -13
  11. data/lib/kitchen/chapter_element_enumerator.rb +1 -1
  12. data/lib/kitchen/composite_chapter_element.rb +7 -11
  13. data/lib/kitchen/composite_chapter_element_enumerator.rb +21 -0
  14. data/lib/kitchen/composite_page_element.rb +15 -10
  15. data/lib/kitchen/composite_page_element_enumerator.rb +1 -1
  16. data/lib/kitchen/config.rb +14 -0
  17. data/lib/kitchen/directions/bake_chapter_glossary/main.rb +18 -0
  18. data/lib/kitchen/directions/bake_chapter_glossary/v1.rb +30 -0
  19. data/lib/kitchen/directions/bake_chapter_introductions.rb +1 -1
  20. data/lib/kitchen/directions/bake_chapter_key_concepts/main.rb +7 -2
  21. data/lib/kitchen/directions/bake_chapter_key_concepts/v1.rb +12 -7
  22. data/lib/kitchen/directions/bake_chapter_key_equations.rb +26 -21
  23. data/lib/kitchen/directions/bake_chapter_references/main.rb +16 -0
  24. data/lib/kitchen/directions/bake_chapter_references/v1.rb +35 -0
  25. data/lib/kitchen/directions/bake_chapter_summary.rb +48 -42
  26. data/lib/kitchen/directions/bake_composite_chapters.rb +1 -1
  27. data/lib/kitchen/directions/bake_composite_pages.rb +1 -1
  28. data/lib/kitchen/directions/bake_equations.rb +14 -4
  29. data/lib/kitchen/directions/bake_example.rb +5 -1
  30. data/lib/kitchen/directions/bake_figure.rb +1 -1
  31. data/lib/kitchen/directions/bake_first_elements.rb +22 -0
  32. data/lib/kitchen/directions/bake_footnotes/v1.rb +2 -1
  33. data/lib/kitchen/directions/bake_free_response/free_response.xhtml.erb +10 -0
  34. data/lib/kitchen/directions/bake_free_response/main.rb +11 -0
  35. data/lib/kitchen/directions/bake_free_response/v1.rb +29 -0
  36. data/lib/kitchen/directions/bake_further_research.rb +59 -0
  37. data/lib/kitchen/directions/bake_index/v1.rb +36 -26
  38. data/lib/kitchen/directions/bake_link_placeholders.rb +1 -1
  39. data/lib/kitchen/directions/bake_notes/bake_note_subtitle.rb +4 -0
  40. data/lib/kitchen/directions/bake_notes/bake_numbered_notes.rb +9 -21
  41. data/lib/kitchen/directions/bake_numbered_exercise/main.rb +6 -2
  42. data/lib/kitchen/directions/bake_numbered_exercise/v1.rb +25 -12
  43. data/lib/kitchen/directions/bake_numbered_table/v1.rb +1 -8
  44. data/lib/kitchen/directions/bake_page_abstracts.rb +1 -1
  45. data/lib/kitchen/directions/bake_references/main.rb +16 -0
  46. data/lib/kitchen/directions/bake_references/v1.rb +48 -0
  47. data/lib/kitchen/directions/bake_suggested_reading.rb +5 -0
  48. data/lib/kitchen/directions/bake_toc.rb +4 -2
  49. data/lib/kitchen/directions/{bake_book_answer_key → book_answer_key_container}/eob_solutions_container.xhtml.erb +0 -0
  50. data/lib/kitchen/directions/{bake_book_answer_key → book_answer_key_container}/main.rb +1 -1
  51. data/lib/kitchen/directions/{bake_book_answer_key → book_answer_key_container}/v1.rb +2 -2
  52. data/lib/kitchen/directions/{bake_chapter_review → chapter_review_container}/chapter_review.xhtml.erb +0 -0
  53. data/lib/kitchen/directions/{bake_chapter_review → chapter_review_container}/main.rb +1 -1
  54. data/lib/kitchen/directions/{bake_chapter_review → chapter_review_container}/v1.rb +2 -2
  55. data/lib/kitchen/directions/eoc_section_title_link_snippet.rb +1 -1
  56. data/lib/kitchen/directions/move_exercises_to_eoc/main.rb +27 -0
  57. data/lib/kitchen/directions/{bake_chapter_review_exercises → move_exercises_to_eoc}/v1.rb +8 -10
  58. data/lib/kitchen/directions/{bake_chapter_review_exercises → move_exercises_to_eoc}/v2.rb +8 -9
  59. data/lib/kitchen/directions/{bake_chapter_answer_key → move_solutions_to_answer_key}/main.rb +1 -1
  60. data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/american_government.rb +19 -0
  61. data/lib/kitchen/directions/{bake_chapter_answer_key → move_solutions_to_answer_key}/strategies/calculus.rb +1 -1
  62. data/lib/kitchen/directions/{bake_chapter_answer_key → move_solutions_to_answer_key}/strategies/uphysics.rb +7 -5
  63. data/lib/kitchen/directions/{bake_chapter_answer_key → move_solutions_to_answer_key}/v1.rb +3 -1
  64. data/lib/kitchen/document.rb +20 -42
  65. data/lib/kitchen/element.rb +9 -3
  66. data/lib/kitchen/element_base.rb +93 -21
  67. data/lib/kitchen/element_enumerator_base.rb +33 -2
  68. data/lib/kitchen/element_enumerator_factory.rb +28 -12
  69. data/lib/kitchen/element_factory.rb +3 -3
  70. data/lib/kitchen/example_element.rb +8 -11
  71. data/lib/kitchen/example_element_enumerator.rb +1 -1
  72. data/lib/kitchen/exercise_element.rb +7 -10
  73. data/lib/kitchen/exercise_element_enumerator.rb +1 -1
  74. data/lib/kitchen/figure_element.rb +8 -11
  75. data/lib/kitchen/figure_element_enumerator.rb +1 -1
  76. data/lib/kitchen/id_tracker.rb +68 -0
  77. data/lib/kitchen/metadata_element.rb +8 -2
  78. data/lib/kitchen/metadata_element_enumerator.rb +1 -1
  79. data/lib/kitchen/note_element.rb +8 -11
  80. data/lib/kitchen/note_element_enumerator.rb +1 -1
  81. data/lib/kitchen/oven.rb +5 -1
  82. data/lib/kitchen/page_element.rb +25 -9
  83. data/lib/kitchen/page_element_enumerator.rb +1 -1
  84. data/lib/kitchen/patches/i18n.rb +34 -0
  85. data/lib/kitchen/patches/nokogiri.rb +55 -0
  86. data/lib/kitchen/patches/nokogiri_profiling.rb +60 -0
  87. data/lib/kitchen/reference_element.rb +27 -0
  88. data/lib/kitchen/references_element_enumerator.rb +20 -0
  89. data/lib/kitchen/search_query.rb +31 -3
  90. data/lib/kitchen/selector.rb +25 -0
  91. data/lib/kitchen/selectors/base.rb +39 -0
  92. data/lib/kitchen/selectors/standard_1.rb +13 -0
  93. data/lib/kitchen/table_element.rb +8 -11
  94. data/lib/kitchen/table_element_enumerator.rb +1 -1
  95. data/lib/kitchen/templates/eob_section_title_template.xhtml.erb +10 -0
  96. data/lib/kitchen/templates/eoc_section_title_template.xhtml.erb +10 -0
  97. data/lib/kitchen/term_element.rb +5 -8
  98. data/lib/kitchen/term_element_enumerator.rb +1 -1
  99. data/lib/kitchen/unit_element.rb +13 -7
  100. data/lib/kitchen/unit_element_enumerator.rb +1 -1
  101. data/lib/kitchen/version.rb +1 -1
  102. data/lib/locales/en.yml +3 -0
  103. data/lib/locales/es.yml +32 -0
  104. data/lib/openstax_kitchen.rb +2 -5
  105. data/openstax_kitchen.gemspec +1 -0
  106. metadata +51 -23
  107. data/lib/kitchen/directions/bake_chapter_glossary.rb +0 -39
  108. data/lib/kitchen/directions/bake_chapter_key_concepts/key_concepts.xhtml.erb +0 -16
  109. data/lib/kitchen/directions/bake_chapter_review_exercises/main.rb +0 -15
  110. data/lib/kitchen/directions/bake_chapter_review_exercises/review_exercises.xhtml.erb +0 -10
  111. data/lib/kitchen/directions/bake_exercises/main.rb +0 -12
  112. data/lib/kitchen/directions/bake_exercises/v1.rb +0 -169
  113. data/lib/kitchen/directions/bake_notes/bake_notes.rb +0 -48
  114. data/lib/kitchen/directions/bake_problem_first_elements.rb +0 -16
  115. data/lib/kitchen/transliterations.rb +0 -21
@@ -11,7 +11,7 @@ module Kitchen
11
11
  #
12
12
  def self.factory
13
13
  ElementEnumeratorFactory.new(
14
- default_css_or_xpath: 'table', # TODO: get from config?
14
+ default_css_or_xpath: Selector.named(:table),
15
15
  sub_element_class: TableElement,
16
16
  enumerator_class: self
17
17
  )
@@ -0,0 +1,10 @@
1
+ <div class="os-eob os-<%=@klass%>-container" data-type="composite-page" data-uuid-key="<%=@uuid_prefix%><%=@klass%>">
2
+ <h1 data-type="document-title">
3
+ <span class="os-text"><%= @title %></span>
4
+ </h1>
5
+ <div data-type="metadata" style="display: none;">
6
+ <h1 data-type="document-title" itemprop="name"><%= @title %></h1>
7
+ <%= @metadata.paste %>
8
+ </div>
9
+ <%= @content %>
10
+ </div>
@@ -0,0 +1,10 @@
1
+ <div class="os-eoc os-<%=@klass%>-container" data-type="composite-page" data-uuid-key="<%=@uuid_prefix%><%=@klass%>">
2
+ <<%= @in_composite_chapter ? 'h3' : 'h2' %> data-type="<%= @in_composite_chapter ? 'title' : 'document-title' %>">
3
+ <span class="os-text"><%= @title %></span>
4
+ </<%= @in_composite_chapter ? 'h3' : 'h2' %>>
5
+ <div data-type="metadata" style="display: none;">
6
+ <h1 data-type="document-title" itemprop="name"><%= @in_composite_chapter ? I18n.t(:eoc_composite_metadata_title) : @title %></h1>
7
+ <%= @metadata.paste %>
8
+ </div>
9
+ <%= @content %>
10
+ </div>
@@ -13,17 +13,14 @@ module Kitchen
13
13
  def initialize(node:, document: nil)
14
14
  super(node: node,
15
15
  document: document,
16
- enumerator_class: TermElementEnumerator,
17
- short_type: :term)
16
+ enumerator_class: TermElementEnumerator)
18
17
  end
19
18
 
20
- # Returns true if this class represents the element for the given node
19
+ # Returns the short type
20
+ # @return [Symbol]
21
21
  #
22
- # @param node [Nokogiri::XML::Node] the underlying node
23
- # @return [Boolean]
24
- #
25
- def self.is_the_element_class_for?(node)
26
- node['data-type'] == 'term'
22
+ def self.short_type
23
+ :term
27
24
  end
28
25
 
29
26
  end
@@ -11,7 +11,7 @@ module Kitchen
11
11
  #
12
12
  def self.factory
13
13
  ElementEnumeratorFactory.new(
14
- default_css_or_xpath: "span[data-type='term']", # TODO: get from config?
14
+ default_css_or_xpath: Selector.named(:term),
15
15
  sub_element_class: TermElement,
16
16
  enumerator_class: self
17
17
  )
@@ -13,8 +13,14 @@ module Kitchen
13
13
  def initialize(node:, document: nil)
14
14
  super(node: node,
15
15
  document: document,
16
- enumerator_class: UnitElementEnumerator,
17
- short_type: :unit)
16
+ enumerator_class: UnitElementEnumerator)
17
+ end
18
+
19
+ # Returns the short type
20
+ # @return [Symbol]
21
+ #
22
+ def self.short_type
23
+ :unit
18
24
  end
19
25
 
20
26
  # Get the title in the immediate children, not the one in the metadata. Could use
@@ -27,13 +33,13 @@ module Kitchen
27
33
  first!("./*[@data-type = 'document-title']")
28
34
  end
29
35
 
30
- # Returns true if this class represents the element for the given node
36
+ # Returns the title's text regardless of whether the title has been baked
31
37
  #
32
- # @param node [Nokogiri::XML::Node] the underlying node
33
- # @return [Boolean]
38
+ # @return [String]
34
39
  #
35
- def self.is_the_element_class_for?(node)
36
- node['data-type'] == 'unit'
40
+ def title_text
41
+ title.children.one? ? title.text : title.first('.os-text').text
37
42
  end
43
+
38
44
  end
39
45
  end
@@ -11,7 +11,7 @@ module Kitchen
11
11
  #
12
12
  def self.factory
13
13
  ElementEnumeratorFactory.new(
14
- default_css_or_xpath: "div[data-type='unit']",
14
+ default_css_or_xpath: Selector.named(:unit),
15
15
  sub_element_class: UnitElement,
16
16
  enumerator_class: self
17
17
  )
@@ -3,5 +3,5 @@
3
3
  # A library for modifying the structure of OpenStax book XML.
4
4
  #
5
5
  module Kitchen
6
- VERSION = '3.1.0'
6
+ VERSION = '5.0.0'
7
7
  end
data/lib/locales/en.yml CHANGED
@@ -15,14 +15,17 @@ en:
15
15
  chapter_review: Chapter Review
16
16
  learning_objectives: Learning Objectives
17
17
  stepwise_step_label: Step
18
+ references: References
18
19
  eoc_chapter_review: Chapter Review
19
20
  eoc_key_terms_title: Key Terms
20
21
  eoc_summary_title: Summary
21
22
  eoc_exercises_title: Exercises
23
+ eoc_composite_metadata_title: Chapter Review
22
24
  eoc_answer_key_title: Answer Key
23
25
  eoc_key_concepts: Key Concepts
24
26
  eoc_key_equations: Key Equations
25
27
  eoc_suggested_reading: Suggestions for Further Study
28
+ eoc_further_research_title: Further Research
26
29
  eob_index_title: Index
27
30
  eob_index_symbols_group: Symbols
28
31
  review_exercises: Review Exercises
@@ -0,0 +1,32 @@
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
+ eoc_chapter_review: Revisión Del Capítulo
20
+ eoc_key_terms_title: Términos Clave
21
+ eoc_summary_title: Resumen
22
+ eoc_exercises_title: Ejercicios
23
+ eoc_composite_metadata_title: Revisión Del Capítulo
24
+ eoc_answer_key_title: Respuestas Clave
25
+ eoc_key_concepts: Conceptos Clave
26
+ eoc_key_equations: Ecuaciones Clave
27
+ eoc_suggested_reading: Sugerencias Para Estudios Adicionales
28
+ eoc_further_research_title: Investigación Adicional
29
+ eob_index_title: Índice
30
+ eob_index_symbols_group: Símbolos
31
+ review_exercises: Ejercicios De Repaso
32
+ section_exercises: ! 'Sección %{number} Ejercicios'
@@ -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'
@@ -40,6 +39,8 @@ require 'kitchen/oven'
40
39
  require 'kitchen/clipboard'
41
40
  require 'kitchen/pantry'
42
41
  require 'kitchen/counter'
42
+ require 'kitchen/selector'
43
+ require 'kitchen/id_tracker'
43
44
 
44
45
  require 'kitchen/element_enumerator_base'
45
46
  require 'kitchen/element_enumerator_factory'
@@ -52,7 +53,3 @@ require 'kitchen/element_factory'
52
53
  require_all('kitchen/directions')
53
54
 
54
55
  I18n.backend.load_translations(file_glob('/locales/*.yml'))
55
-
56
- I18n.available_locales.each do |available_locale|
57
- I18n.backend.store_translations(available_locale, Kitchen::TRANSLITERATIONS)
58
- 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: 3.1.0
4
+ version: 5.0.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-04-20 00:00:00.000000000 Z
11
+ date: 2021-06-02 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
@@ -220,6 +234,7 @@ files:
220
234
  - lib/kitchen/chapter_element_enumerator.rb
221
235
  - lib/kitchen/clipboard.rb
222
236
  - lib/kitchen/composite_chapter_element.rb
237
+ - lib/kitchen/composite_chapter_element_enumerator.rb
223
238
  - lib/kitchen/composite_page_element.rb
224
239
  - lib/kitchen/composite_page_element_enumerator.rb
225
240
  - lib/kitchen/config.rb
@@ -227,26 +242,14 @@ files:
227
242
  - lib/kitchen/debug/print_recipe_error.rb
228
243
  - lib/kitchen/directions/.rubocop.yml
229
244
  - lib/kitchen/directions/bake_appendix.rb
230
- - lib/kitchen/directions/bake_book_answer_key/eob_solutions_container.xhtml.erb
231
- - lib/kitchen/directions/bake_book_answer_key/main.rb
232
- - lib/kitchen/directions/bake_book_answer_key/v1.rb
233
- - lib/kitchen/directions/bake_chapter_answer_key/main.rb
234
- - lib/kitchen/directions/bake_chapter_answer_key/strategies/calculus.rb
235
- - lib/kitchen/directions/bake_chapter_answer_key/strategies/uphysics.rb
236
- - lib/kitchen/directions/bake_chapter_answer_key/v1.rb
237
- - lib/kitchen/directions/bake_chapter_glossary.rb
245
+ - lib/kitchen/directions/bake_chapter_glossary/main.rb
246
+ - lib/kitchen/directions/bake_chapter_glossary/v1.rb
238
247
  - lib/kitchen/directions/bake_chapter_introductions.rb
239
- - lib/kitchen/directions/bake_chapter_key_concepts/key_concepts.xhtml.erb
240
248
  - lib/kitchen/directions/bake_chapter_key_concepts/main.rb
241
249
  - lib/kitchen/directions/bake_chapter_key_concepts/v1.rb
242
250
  - lib/kitchen/directions/bake_chapter_key_equations.rb
243
- - lib/kitchen/directions/bake_chapter_review/chapter_review.xhtml.erb
244
- - lib/kitchen/directions/bake_chapter_review/main.rb
245
- - lib/kitchen/directions/bake_chapter_review/v1.rb
246
- - lib/kitchen/directions/bake_chapter_review_exercises/main.rb
247
- - lib/kitchen/directions/bake_chapter_review_exercises/review_exercises.xhtml.erb
248
- - lib/kitchen/directions/bake_chapter_review_exercises/v1.rb
249
- - lib/kitchen/directions/bake_chapter_review_exercises/v2.rb
251
+ - lib/kitchen/directions/bake_chapter_references/main.rb
252
+ - lib/kitchen/directions/bake_chapter_references/v1.rb
250
253
  - lib/kitchen/directions/bake_chapter_section_exercises/main.rb
251
254
  - lib/kitchen/directions/bake_chapter_section_exercises/v1.rb
252
255
  - lib/kitchen/directions/bake_chapter_summary.rb
@@ -257,11 +260,14 @@ files:
257
260
  - lib/kitchen/directions/bake_composite_pages.rb
258
261
  - lib/kitchen/directions/bake_equations.rb
259
262
  - lib/kitchen/directions/bake_example.rb
260
- - lib/kitchen/directions/bake_exercises/main.rb
261
- - lib/kitchen/directions/bake_exercises/v1.rb
262
263
  - lib/kitchen/directions/bake_figure.rb
264
+ - lib/kitchen/directions/bake_first_elements.rb
263
265
  - lib/kitchen/directions/bake_footnotes/main.rb
264
266
  - lib/kitchen/directions/bake_footnotes/v1.rb
267
+ - lib/kitchen/directions/bake_free_response/free_response.xhtml.erb
268
+ - lib/kitchen/directions/bake_free_response/main.rb
269
+ - lib/kitchen/directions/bake_free_response/v1.rb
270
+ - lib/kitchen/directions/bake_further_research.rb
265
271
  - lib/kitchen/directions/bake_index/main.rb
266
272
  - lib/kitchen/directions/bake_index/v1.rb
267
273
  - lib/kitchen/directions/bake_index/v1.xhtml.erb
@@ -270,7 +276,6 @@ files:
270
276
  - lib/kitchen/directions/bake_non_introduction_pages.rb
271
277
  - lib/kitchen/directions/bake_notes/bake_autotitled_notes.rb
272
278
  - lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
273
- - lib/kitchen/directions/bake_notes/bake_notes.rb
274
279
  - lib/kitchen/directions/bake_notes/bake_numbered_notes.rb
275
280
  - lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
276
281
  - lib/kitchen/directions/bake_numbered_exercise/main.rb
@@ -280,7 +285,8 @@ files:
280
285
  - lib/kitchen/directions/bake_page_abstracts.rb
281
286
  - lib/kitchen/directions/bake_preface/main.rb
282
287
  - lib/kitchen/directions/bake_preface/v1.rb
283
- - lib/kitchen/directions/bake_problem_first_elements.rb
288
+ - lib/kitchen/directions/bake_references/main.rb
289
+ - lib/kitchen/directions/bake_references/v1.rb
284
290
  - lib/kitchen/directions/bake_stepwise.rb
285
291
  - lib/kitchen/directions/bake_suggested_reading.rb
286
292
  - lib/kitchen/directions/bake_theorem/main.rb
@@ -289,7 +295,21 @@ files:
289
295
  - lib/kitchen/directions/bake_unit_title/main.rb
290
296
  - lib/kitchen/directions/bake_unit_title/v1.rb
291
297
  - lib/kitchen/directions/bake_unnumbered_tables.rb
298
+ - lib/kitchen/directions/book_answer_key_container/eob_solutions_container.xhtml.erb
299
+ - lib/kitchen/directions/book_answer_key_container/main.rb
300
+ - lib/kitchen/directions/book_answer_key_container/v1.rb
301
+ - lib/kitchen/directions/chapter_review_container/chapter_review.xhtml.erb
302
+ - lib/kitchen/directions/chapter_review_container/main.rb
303
+ - lib/kitchen/directions/chapter_review_container/v1.rb
292
304
  - lib/kitchen/directions/eoc_section_title_link_snippet.rb
305
+ - lib/kitchen/directions/move_exercises_to_eoc/main.rb
306
+ - lib/kitchen/directions/move_exercises_to_eoc/v1.rb
307
+ - lib/kitchen/directions/move_exercises_to_eoc/v2.rb
308
+ - lib/kitchen/directions/move_solutions_to_answer_key/main.rb
309
+ - lib/kitchen/directions/move_solutions_to_answer_key/strategies/american_government.rb
310
+ - lib/kitchen/directions/move_solutions_to_answer_key/strategies/calculus.rb
311
+ - lib/kitchen/directions/move_solutions_to_answer_key/strategies/uphysics.rb
312
+ - lib/kitchen/directions/move_solutions_to_answer_key/v1.rb
293
313
  - lib/kitchen/directions/move_title_text_into_span.rb
294
314
  - lib/kitchen/document.rb
295
315
  - lib/kitchen/element.rb
@@ -305,6 +325,7 @@ files:
305
325
  - lib/kitchen/exercise_element_enumerator.rb
306
326
  - lib/kitchen/figure_element.rb
307
327
  - lib/kitchen/figure_element_enumerator.rb
328
+ - lib/kitchen/id_tracker.rb
308
329
  - lib/kitchen/metadata_element.rb
309
330
  - lib/kitchen/metadata_element_enumerator.rb
310
331
  - lib/kitchen/mixins/block_error_if.rb
@@ -314,25 +335,32 @@ files:
314
335
  - lib/kitchen/page_element.rb
315
336
  - lib/kitchen/page_element_enumerator.rb
316
337
  - lib/kitchen/pantry.rb
338
+ - lib/kitchen/patches/i18n.rb
317
339
  - lib/kitchen/patches/nokogiri.rb
340
+ - lib/kitchen/patches/nokogiri_profiling.rb
318
341
  - lib/kitchen/patches/renderable.rb
319
342
  - lib/kitchen/patches/string.rb
320
343
  - lib/kitchen/recipe.rb
344
+ - lib/kitchen/reference_element.rb
345
+ - lib/kitchen/references_element_enumerator.rb
321
346
  - lib/kitchen/search_history.rb
322
347
  - lib/kitchen/search_query.rb
348
+ - lib/kitchen/selector.rb
323
349
  - lib/kitchen/selectors/base.rb
324
350
  - lib/kitchen/selectors/standard_1.rb
325
351
  - lib/kitchen/table_element.rb
326
352
  - lib/kitchen/table_element_enumerator.rb
353
+ - lib/kitchen/templates/eob_section_title_template.xhtml.erb
354
+ - lib/kitchen/templates/eoc_section_title_template.xhtml.erb
327
355
  - lib/kitchen/term_element.rb
328
356
  - lib/kitchen/term_element_enumerator.rb
329
- - lib/kitchen/transliterations.rb
330
357
  - lib/kitchen/type_casting_element_enumerator.rb
331
358
  - lib/kitchen/unit_element.rb
332
359
  - lib/kitchen/unit_element_enumerator.rb
333
360
  - lib/kitchen/utils.rb
334
361
  - lib/kitchen/version.rb
335
362
  - lib/locales/en.yml
363
+ - lib/locales/es.yml
336
364
  - lib/locales/pl.yml
337
365
  - lib/notes.md
338
366
  - lib/openstax_kitchen.rb
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kitchen
4
- module Directions
5
- # Bake directons for eoc glossary
6
- #
7
- module BakeChapterGlossary
8
- def self.v1(chapter:, metadata_source:, append_to: nil)
9
- metadata_elements = metadata_source.children_to_keep.copy
10
-
11
- definitions = chapter.glossaries.search('dl').cut
12
- definitions.sort_by! do |definition|
13
- [definition.first('dt').text.downcase, definition.first('dd').text.downcase]
14
- end
15
-
16
- chapter.glossaries.trash
17
-
18
- return if definitions.none?
19
-
20
- append_to_element = append_to || chapter
21
-
22
- append_to_element.append(child:
23
- <<~HTML
24
- <div class="os-eoc os-glossary-container" data-type="composite-page" data-uuid-key="glossary">
25
- <h2 data-type="document-title">
26
- <span class="os-text">#{I18n.t(:eoc_key_terms_title)}</span>
27
- </h2>
28
- <div data-type="metadata" style="display: none;">
29
- <h1 data-type="document-title" itemprop="name">#{I18n.t(:eoc_key_terms_title)}</h1>
30
- #{metadata_elements.paste}
31
- </div>
32
- #{definitions.paste}
33
- </div>
34
- HTML
35
- )
36
- end
37
- end
38
- end
39
- end
@@ -1,16 +0,0 @@
1
- <div class="os-eoc os-key-concepts-container" data-type="composite-page" data-uuid-key=".key-concepts">
2
- <h2 data-type="document-title">
3
- <span class="os-text"><%= I18n.t(:eoc_key_concepts) %></span>
4
- </h2>
5
- <div data-type="metadata" style="display: none;">
6
- <h1 data-type="document-title" itemprop="name"><%= I18n.t(:eoc_key_concepts) %></h1>
7
- <%= @metadata_elements.paste %>
8
- </div>
9
- <div class="os-key-concepts">
10
- <% @key_concepts.each do |key_concept| %>
11
- <div class="os-section-area">
12
- <%= key_concept %>
13
- </div>
14
- <% end %>
15
- </div>
16
- </div>
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kitchen
4
- module Directions
5
- module BakeChapterReviewExercises
6
- def self.v1(chapter:, metadata_source:, append_to:, klass:)
7
- V1.new.bake(chapter: chapter, metadata_source: metadata_source, append_to: append_to, klass: klass)
8
- end
9
-
10
- def self.v2(chapter:, metadata_source:, append_to:, klass:)
11
- V2.new.bake(chapter: chapter, metadata_source: metadata_source, append_to: append_to, klass: klass)
12
- end
13
- end
14
- end
15
- end