openstax_kitchen 3.0.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/CHANGELOG.md +77 -3
- data/Gemfile.lock +13 -14
- data/README.md +23 -0
- data/codecov.yaml +1 -0
- data/docker/ci +0 -1
- data/lib/kitchen/book_document.rb +1 -1
- data/lib/kitchen/book_element.rb +16 -2
- data/lib/kitchen/chapter_element.rb +10 -13
- data/lib/kitchen/chapter_element_enumerator.rb +1 -1
- data/lib/kitchen/composite_chapter_element.rb +7 -11
- data/lib/kitchen/composite_chapter_element_enumerator.rb +21 -0
- data/lib/kitchen/composite_page_element.rb +15 -10
- data/lib/kitchen/composite_page_element_enumerator.rb +1 -1
- data/lib/kitchen/config.rb +14 -0
- 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 +1 -1
- 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 +27 -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 +48 -42
- 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 +1 -1
- data/lib/kitchen/directions/bake_equations.rb +37 -0
- data/lib/kitchen/directions/bake_example.rb +34 -8
- data/lib/kitchen/directions/bake_figure.rb +1 -1
- data/lib/kitchen/directions/bake_first_elements.rb +16 -0
- data/lib/kitchen/directions/bake_footnotes/v1.rb +2 -1
- 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/v1.rb +35 -14
- data/lib/kitchen/directions/bake_link_placeholders.rb +1 -1
- 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 +2 -2
- data/lib/kitchen/directions/bake_numbered_table/v1.rb +18 -4
- data/lib/kitchen/directions/bake_page_abstracts.rb +16 -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 +1 -5
- data/lib/kitchen/directions/bake_suggested_reading.rb +5 -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 +10 -2
- data/lib/kitchen/directions/book_answer_key_container/eob_solutions_container.xhtml.erb +9 -0
- data/lib/kitchen/directions/{bake_exercises → book_answer_key_container}/main.rb +1 -1
- 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/document.rb +3 -0
- data/lib/kitchen/element.rb +9 -3
- data/lib/kitchen/element_base.rb +118 -16
- data/lib/kitchen/element_enumerator_base.rb +118 -8
- data/lib/kitchen/element_enumerator_factory.rb +28 -12
- data/lib/kitchen/element_factory.rb +3 -3
- data/lib/kitchen/example_element.rb +8 -11
- data/lib/kitchen/example_element_enumerator.rb +1 -1
- data/lib/kitchen/exercise_element.rb +42 -0
- data/lib/kitchen/exercise_element_enumerator.rb +21 -0
- data/lib/kitchen/figure_element.rb +8 -11
- data/lib/kitchen/figure_element_enumerator.rb +1 -1
- data/lib/kitchen/metadata_element.rb +8 -2
- data/lib/kitchen/metadata_element_enumerator.rb +1 -1
- data/lib/kitchen/note_element.rb +25 -27
- data/lib/kitchen/note_element_enumerator.rb +1 -1
- data/lib/kitchen/oven.rb +2 -0
- data/lib/kitchen/page_element.rb +33 -9
- data/lib/kitchen/page_element_enumerator.rb +1 -1
- data/lib/kitchen/patches/nokogiri.rb +55 -0
- data/lib/kitchen/patches/nokogiri_profiling.rb +60 -0
- data/lib/kitchen/recipe.rb +35 -2
- data/lib/kitchen/reference_element.rb +27 -0
- data/lib/kitchen/references_element_enumerator.rb +20 -0
- data/lib/kitchen/search_query.rb +31 -3
- data/lib/kitchen/selector.rb +25 -0
- data/lib/kitchen/selectors/base.rb +39 -0
- data/lib/kitchen/selectors/standard_1.rb +13 -0
- data/lib/kitchen/table_element.rb +8 -11
- data/lib/kitchen/table_element_enumerator.rb +1 -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 +5 -8
- data/lib/kitchen/term_element_enumerator.rb +1 -1
- data/lib/kitchen/unit_element.rb +13 -7
- data/lib/kitchen/unit_element_enumerator.rb +1 -1
- data/lib/kitchen/version.rb +1 -1
- data/lib/locales/en.yml +12 -7
- data/lib/locales/pl.yml +24 -0
- data/lib/openstax_kitchen.rb +2 -1
- metadata +54 -6
- data/lib/kitchen/directions/bake_chapter_glossary.rb +0 -37
- data/lib/kitchen/directions/bake_exercises/v1.rb +0 -166
- data/lib/kitchen/directions/bake_notes.rb +0 -58
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Kitchen
|
4
|
-
module Directions
|
5
|
-
module BakeNotes
|
6
|
-
def self.v1(book:)
|
7
|
-
book.notes.each do |note|
|
8
|
-
title = note.title&.cut
|
9
|
-
|
10
|
-
note.replace_children(with:
|
11
|
-
<<~HTML
|
12
|
-
<div class="os-note-body">#{note.children}</div>
|
13
|
-
HTML
|
14
|
-
)
|
15
|
-
|
16
|
-
if title
|
17
|
-
if note.indicates_autogenerated_title?
|
18
|
-
note.prepend(child:
|
19
|
-
<<~HTML
|
20
|
-
<h3 class="os-title" data-type="title">
|
21
|
-
<span class="os-title-label">#{note.autogenerated_title}</span>
|
22
|
-
</h3>
|
23
|
-
HTML
|
24
|
-
)
|
25
|
-
|
26
|
-
title.name = 'h4'
|
27
|
-
title.add_class('os-subtitle')
|
28
|
-
title.replace_children(with:
|
29
|
-
<<~HTML
|
30
|
-
<span class="os-subtitle-label">#{title.children}</span>
|
31
|
-
HTML
|
32
|
-
)
|
33
|
-
note.first!('.os-note-body').prepend(child: title.raw)
|
34
|
-
else
|
35
|
-
title.name = 'h3'
|
36
|
-
title.add_class('os-title')
|
37
|
-
title.replace_children(with:
|
38
|
-
<<~HTML
|
39
|
-
<span data-type="" id="#{title.id}" class="os-title-label">#{title.children}</span>
|
40
|
-
HTML
|
41
|
-
)
|
42
|
-
title.remove_attribute('id')
|
43
|
-
note.prepend(child: title.raw)
|
44
|
-
end
|
45
|
-
else
|
46
|
-
note.prepend(child:
|
47
|
-
<<~HTML
|
48
|
-
<h3 class="os-title" data-type="title">
|
49
|
-
<span class="os-title-label">#{note.autogenerated_title}</span>
|
50
|
-
</h3>
|
51
|
-
HTML
|
52
|
-
)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|