openstax_kitchen 8.0.0 → 9.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/Gemfile.lock +1 -1
- data/lib/kitchen/chapter_element.rb +0 -8
- data/lib/kitchen/composite_page_element.rb +2 -4
- data/lib/kitchen/directions/.rubocop.yml +3 -0
- data/lib/kitchen/directions/bake_chapter_glossary/v1.rb +8 -12
- data/lib/kitchen/directions/bake_chapter_key_concepts/v1.rb +9 -13
- data/lib/kitchen/directions/bake_chapter_key_equations.rb +10 -17
- data/lib/kitchen/directions/bake_chapter_references/v1.rb +10 -12
- data/lib/kitchen/directions/bake_chapter_solutions/v1.rb +8 -12
- data/lib/kitchen/directions/bake_chapter_summary.rb +10 -32
- data/lib/kitchen/directions/bake_eoc_section_content/remove_section_title.rb +11 -0
- data/lib/kitchen/directions/bake_example.rb +1 -1
- data/lib/kitchen/directions/bake_first_elements.rb +8 -0
- data/lib/kitchen/directions/bake_further_research.rb +13 -39
- data/lib/kitchen/directions/bake_inline_lists.rb +1 -1
- data/lib/kitchen/directions/bake_notes/bake_autotitled_notes.rb +1 -0
- data/lib/kitchen/directions/bake_notes/bake_note_iframes.rb +27 -0
- data/lib/kitchen/directions/bake_toc.rb +2 -0
- data/lib/kitchen/directions/eoc_composite_page_container/main.rb +27 -0
- data/lib/kitchen/directions/eoc_composite_page_container/v1.rb +19 -0
- data/lib/kitchen/directions/move_custom_section_to_eoc_container/main.rb +37 -0
- data/lib/kitchen/directions/move_custom_section_to_eoc_container/v1.rb +27 -0
- data/lib/kitchen/directions/move_exercises_to_eoc/v1.rb +10 -27
- data/lib/kitchen/directions/move_exercises_to_eoc/v2.rb +11 -18
- data/lib/kitchen/directions/move_exercises_to_eoc/v3.rb +14 -38
- data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/calculus.rb +5 -5
- data/lib/kitchen/directions/move_solutions_to_answer_key/strategies/precalculus.rb +4 -4
- data/lib/kitchen/example_element.rb +1 -1
- data/lib/kitchen/metadata_element.rb +2 -2
- data/lib/kitchen/page_element.rb +8 -0
- data/lib/kitchen/templates/eoc_section_template.xhtml.erb +11 -0
- data/lib/kitchen/templates/eoc_section_template_old.xhtml.erb +11 -0
- data/lib/kitchen/version.rb +1 -1
- data/lib/locales/en.yml +9 -5
- data/lib/locales/es.yml +6 -4
- data/lib/locales/pl.yml +5 -3
- metadata +10 -3
- data/lib/kitchen/templates/eoc_section_title_template.xhtml.erb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddd15ebcb9ead1f1e6301bfc025a93bb3ca7e75d2e412eae3a63d3496574eea5
|
4
|
+
data.tar.gz: 82af5aa1d8151438286f9e6cc21c052f5c7d1549b1966abaf3018f5578fb6f53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 268bf8bcf65bc1deb38d20e433b503e28eefc0048a5174bb7ea378354354f7c671e88b72378d03ad03ef077f2d15e5870c691bbdec358664e2f5c2c9344a9f33
|
7
|
+
data.tar.gz: ef6c551bb52f90e7bf3301b38879cf2262a62dcc4b91b87c02c4ec944e30f71542dac6b4b3b65763e027737a13fd7b7a77ca86b57366025109b4539eb989f9f4
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [9.2.0] - 2021-07-19
|
10
|
+
|
11
|
+
* Update `BakeFirstElements` to also add the `.has-first-inline-list` class (minor)
|
12
|
+
|
13
|
+
## [9.1.0] - 2021-07-16
|
14
|
+
|
15
|
+
* Add `BakeNoteIFrames` direction (minor)
|
16
|
+
* Selector optimization in precalculus `Strategy` & elsewhere (patch)
|
17
|
+
* Tweaks inline list seperators to only target labeled items (major?)
|
18
|
+
* Add definition of handbook page selector needed for BakeToc, create a link class for this page (minor)
|
19
|
+
|
20
|
+
## [9.0.0] - 2021-07-12
|
21
|
+
|
22
|
+
* Refactor `BakeChapterKeyConcepts`, `BakeChapterReferences`, `BakeChapterSolutions`, and `MoveExercisesToEoc` versions 1-3 to use new general eoc directions (major)
|
23
|
+
* Fixed `BakeExample.v1` to also search inside `.body` for titles (minor)
|
24
|
+
* Add documentation to `MoveCustomSectionToEocContainer` & `EocCompositePageContainer` (minor)
|
25
|
+
* Add a `MoveCustomSectionToEocContainer` to allow for custom sections (minor)
|
26
|
+
* Add a `EocCompositePageContainer` direction to handle creation of eoc page wrapper (minor)
|
27
|
+
* Refactor `BakeChapterKeyEquations`, `BakeChapterGlossary`, `BakeChapterSummary`, `BakeFurtherResearch` (major)
|
28
|
+
* Fix metadata title in composite pages (major)
|
29
|
+
|
30
|
+
## [8.0.1] - 2021-06-29
|
31
|
+
|
32
|
+
* Added tags to classnames to optimize searches in `calculus strategy` for `move_solutions_to_answer_key` (minor)
|
9
33
|
|
10
34
|
## [8.0.0] - 2021-06-29
|
11
35
|
|
data/Gemfile.lock
CHANGED
@@ -52,14 +52,6 @@ module Kitchen
|
|
52
52
|
search("div[data-type='glossary']")
|
53
53
|
end
|
54
54
|
|
55
|
-
# Returns an enumerator for the key equations
|
56
|
-
#
|
57
|
-
# @return [ElementEnumerator]
|
58
|
-
#
|
59
|
-
def key_equations
|
60
|
-
search('section.key-equations')
|
61
|
-
end
|
62
|
-
|
63
55
|
# Returns an enumerator for the abstracts
|
64
56
|
#
|
65
57
|
# @return [ElementEnumerator]
|
@@ -29,10 +29,8 @@ module Kitchen
|
|
29
29
|
# @return [Element]
|
30
30
|
#
|
31
31
|
def title
|
32
|
-
|
33
|
-
|
34
|
-
# but xpath is shorter
|
35
|
-
first!("./*[@data-type = 'document-title' or @data-type = 'title']")
|
32
|
+
first!('h3[data-type="title"], h2[data-type="document-title"],' \
|
33
|
+
'h1[data-type="document-title"]')
|
36
34
|
end
|
37
35
|
|
38
36
|
# Returns true if this page is a book index
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
module Kitchen::Directions::BakeChapterGlossary
|
4
4
|
class V1
|
5
|
-
renderable
|
6
|
-
|
7
5
|
class Definition
|
8
6
|
attr_reader :element
|
9
7
|
|
@@ -24,10 +22,6 @@ module Kitchen::Directions::BakeChapterGlossary
|
|
24
22
|
end
|
25
23
|
|
26
24
|
def bake(chapter:, metadata_source:, append_to: nil, uuid_prefix: '')
|
27
|
-
@metadata = metadata_source.children_to_keep.copy
|
28
|
-
@klass = 'glossary'
|
29
|
-
@title = I18n.t(:eoc_key_terms_title)
|
30
|
-
@uuid_prefix = uuid_prefix
|
31
25
|
@glossary = []
|
32
26
|
|
33
27
|
chapter.glossaries.search('dl').each do |definition_element|
|
@@ -36,13 +30,15 @@ module Kitchen::Directions::BakeChapterGlossary
|
|
36
30
|
|
37
31
|
chapter.glossaries.trash
|
38
32
|
|
39
|
-
|
40
|
-
|
41
|
-
append_to_element = append_to || chapter
|
42
|
-
@in_composite_chapter = append_to_element.is?(:composite_chapter)
|
33
|
+
content = @glossary.sort.map { |definition| definition.element.paste }.join
|
43
34
|
|
44
|
-
|
45
|
-
'
|
35
|
+
Kitchen::Directions::EocCompositePageContainer.v1(
|
36
|
+
container_key: 'glossary',
|
37
|
+
uuid_key: "#{uuid_prefix}glossary",
|
38
|
+
metadata_source: metadata_source,
|
39
|
+
content: content,
|
40
|
+
append_to: append_to || chapter
|
41
|
+
)
|
46
42
|
end
|
47
43
|
end
|
48
44
|
end
|
@@ -2,34 +2,30 @@
|
|
2
2
|
|
3
3
|
module Kitchen::Directions::BakeChapterKeyConcepts
|
4
4
|
class V1
|
5
|
-
renderable
|
6
5
|
def bake(chapter:, metadata_source:, append_to:, uuid_prefix:)
|
7
|
-
@metadata = metadata_source.children_to_keep.copy
|
8
|
-
@klass = 'key-concepts'
|
9
|
-
@title = I18n.t(:eoc_key_concepts)
|
10
|
-
@uuid_prefix = uuid_prefix
|
11
|
-
|
12
6
|
key_concepts_clipboard = Kitchen::Clipboard.new
|
13
7
|
chapter.non_introduction_pages.each do |page|
|
14
8
|
key_concepts = page.key_concepts
|
15
9
|
next if key_concepts.none?
|
16
10
|
|
17
|
-
key_concepts.search('h3').trash
|
18
11
|
title = Kitchen::Directions::EocSectionTitleLinkSnippet.v1(page: page)
|
19
12
|
key_concepts.each do |key_concept|
|
13
|
+
Kitchen::Directions::RemoveSectionTitle.v1(section: key_concept)
|
20
14
|
key_concept.prepend(child: title)
|
21
15
|
key_concept.wrap("<div class='os-section-area'>")
|
22
16
|
page.search('div.os-section-area').first.cut(to: key_concepts_clipboard)
|
23
17
|
end
|
24
18
|
end
|
25
19
|
|
26
|
-
|
27
|
-
|
28
|
-
append_to_element = append_to || chapter
|
29
|
-
@in_composite_chapter = append_to_element.is?(:composite_chapter)
|
20
|
+
content = "<div class=\"os-key-concepts\"> #{key_concepts_clipboard.paste} </div>"
|
30
21
|
|
31
|
-
|
32
|
-
'
|
22
|
+
Kitchen::Directions::EocCompositePageContainer.v1(
|
23
|
+
container_key: 'key-concepts',
|
24
|
+
uuid_key: "#{uuid_prefix}key-concepts",
|
25
|
+
metadata_source: metadata_source,
|
26
|
+
content: content,
|
27
|
+
append_to: append_to || chapter
|
28
|
+
)
|
33
29
|
end
|
34
30
|
end
|
35
31
|
end
|
@@ -15,24 +15,17 @@ module Kitchen
|
|
15
15
|
end
|
16
16
|
|
17
17
|
class V1
|
18
|
-
renderable
|
19
18
|
def bake(chapter:, metadata_source:, append_to:, uuid_prefix:)
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
append_to_element = append_to || chapter
|
32
|
-
@in_composite_chapter = append_to_element.is?(:composite_chapter)
|
33
|
-
|
34
|
-
append_to_element.append(child: render(file:
|
35
|
-
'../templates/eoc_section_title_template.xhtml.erb'))
|
19
|
+
MoveCustomSectionToEocContainer.v1(
|
20
|
+
chapter: chapter,
|
21
|
+
metadata_source: metadata_source,
|
22
|
+
container_key: 'key-equations',
|
23
|
+
uuid_key: "#{uuid_prefix}key-equations",
|
24
|
+
section_selector: 'section.key-equations',
|
25
|
+
append_to: append_to
|
26
|
+
) do |section|
|
27
|
+
RemoveSectionTitle.v1(section: section)
|
28
|
+
end
|
36
29
|
end
|
37
30
|
end
|
38
31
|
end
|
@@ -2,25 +2,22 @@
|
|
2
2
|
|
3
3
|
module Kitchen::Directions::BakeChapterReferences
|
4
4
|
class V1
|
5
|
-
renderable
|
6
|
-
|
7
5
|
def bake(chapter:, metadata_source:, uuid_prefix: '.', klass: 'references')
|
8
|
-
@metadata = metadata_source.children_to_keep.copy
|
9
|
-
@klass = klass
|
10
|
-
@title = I18n.t(:references)
|
11
|
-
@uuid_prefix = uuid_prefix
|
12
|
-
|
13
|
-
chapter.references.search('h3').trash
|
14
|
-
|
15
6
|
bake_page_references(page: chapter.introduction_page)
|
16
7
|
|
17
8
|
chapter.non_introduction_pages.each do |page|
|
18
9
|
bake_page_references(page: page)
|
19
10
|
end
|
20
11
|
|
21
|
-
|
22
|
-
|
23
|
-
|
12
|
+
content = chapter.pages.references.cut.paste
|
13
|
+
|
14
|
+
Kitchen::Directions::EocCompositePageContainer.v1(
|
15
|
+
container_key: klass,
|
16
|
+
uuid_key: "#{uuid_prefix}#{klass}",
|
17
|
+
metadata_source: metadata_source,
|
18
|
+
content: content,
|
19
|
+
append_to: chapter
|
20
|
+
)
|
24
21
|
end
|
25
22
|
|
26
23
|
def bake_page_references(page:)
|
@@ -42,6 +39,7 @@ module Kitchen::Directions::BakeChapterReferences
|
|
42
39
|
end
|
43
40
|
|
44
41
|
references.each do |reference|
|
42
|
+
Kitchen::Directions::RemoveSectionTitle.v1(section: reference)
|
45
43
|
reference.prepend(child: title)
|
46
44
|
end
|
47
45
|
end
|
@@ -2,14 +2,7 @@
|
|
2
2
|
|
3
3
|
module Kitchen::Directions::BakeChapterSolutions
|
4
4
|
class V1
|
5
|
-
renderable
|
6
|
-
|
7
5
|
def bake(chapter:, metadata_source:, uuid_prefix: '')
|
8
|
-
@metadata = metadata_source.children_to_keep.copy
|
9
|
-
@klass = 'solutions'
|
10
|
-
@title = I18n.t(:eoc_solutions_title)
|
11
|
-
@uuid_prefix = uuid_prefix
|
12
|
-
|
13
6
|
solutions_clipboard = Kitchen::Clipboard.new
|
14
7
|
|
15
8
|
chapter.search('section.free-response').each do |free_response_question|
|
@@ -26,12 +19,15 @@ module Kitchen::Directions::BakeChapterSolutions
|
|
26
19
|
end
|
27
20
|
end
|
28
21
|
|
29
|
-
|
30
|
-
|
31
|
-
@in_composite_chapter = false
|
22
|
+
content = solutions_clipboard.paste
|
32
23
|
|
33
|
-
|
34
|
-
'
|
24
|
+
Kitchen::Directions::EocCompositePageContainer.v1(
|
25
|
+
container_key: 'solutions',
|
26
|
+
uuid_key: "#{uuid_prefix}solutions",
|
27
|
+
metadata_source: metadata_source,
|
28
|
+
content: content,
|
29
|
+
append_to: chapter
|
30
|
+
)
|
35
31
|
end
|
36
32
|
end
|
37
33
|
end
|
@@ -15,52 +15,30 @@ module Kitchen
|
|
15
15
|
end
|
16
16
|
|
17
17
|
class V1
|
18
|
-
renderable
|
19
18
|
def bake(chapter:, metadata_source:, uuid_prefix: '.', klass: 'summary')
|
20
|
-
@metadata = metadata_source.children_to_keep.copy
|
21
|
-
@klass = klass
|
22
|
-
@title = I18n.t(:eoc_summary_title)
|
23
|
-
@uuid_prefix = uuid_prefix
|
24
|
-
|
25
19
|
summaries = Clipboard.new
|
26
20
|
|
27
|
-
# TODO: include specific page types somehow without writing it out
|
28
21
|
chapter.non_introduction_pages.each do |page|
|
29
22
|
summary = page.summary
|
30
23
|
|
31
24
|
next if summary.nil?
|
32
25
|
|
33
26
|
summary.first("[data-type='title']")&.trash # get rid of old title if exists
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
unless summary_title.children.search('span.os-number').present?
|
38
|
-
summary_title.replace_children(with:
|
39
|
-
<<~HTML
|
40
|
-
<span class="os-number">#{chapter.count_in(:book)}.#{page.count_in(:chapter)}</span>
|
41
|
-
<span class="os-divider"> </span>
|
42
|
-
<span class="os-text" data-type="" itemprop="">#{summary_title.children}</span>
|
43
|
-
HTML
|
44
|
-
)
|
45
|
-
end
|
46
|
-
|
47
|
-
summary.prepend(child:
|
48
|
-
<<~HTML
|
49
|
-
<a href="##{page.title.id}">
|
50
|
-
#{summary_title.paste}
|
51
|
-
</a>
|
52
|
-
HTML
|
53
|
-
)
|
27
|
+
title = EocSectionTitleLinkSnippet.v1(page: page)
|
28
|
+
summary.prepend(child: title)
|
29
|
+
summary.first('h3')[:itemprop] = 'name'
|
54
30
|
summary.cut(to: summaries)
|
55
31
|
end
|
56
32
|
|
57
33
|
return if summaries.none?
|
58
34
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
35
|
+
EocCompositePageContainer.v1(
|
36
|
+
container_key: klass,
|
37
|
+
uuid_key: "#{uuid_prefix}#{klass}",
|
38
|
+
metadata_source: metadata_source,
|
39
|
+
content: summaries.paste,
|
40
|
+
append_to: chapter
|
41
|
+
)
|
64
42
|
end
|
65
43
|
end
|
66
44
|
end
|
@@ -54,7 +54,7 @@ module Kitchen
|
|
54
54
|
|
55
55
|
exercise.add_class('unnumbered')
|
56
56
|
|
57
|
-
commentary = exercise.first('[data-type="commentary"]')
|
57
|
+
commentary = exercise.first('div[data-type="commentary"]')
|
58
58
|
next unless commentary.present?
|
59
59
|
|
60
60
|
commentary_title = commentary.titles.first
|
@@ -4,6 +4,7 @@ module Kitchen
|
|
4
4
|
module Directions
|
5
5
|
module BakeFirstElements
|
6
6
|
def self.v1(within:)
|
7
|
+
# add has-first-element class
|
7
8
|
selectors = [
|
8
9
|
'div.os-problem-container > div.os-table',
|
9
10
|
'div.os-problem-container > span[data-type="media"]',
|
@@ -16,6 +17,13 @@ module Kitchen
|
|
16
17
|
problem.parent.add_class('has-first-element')
|
17
18
|
end
|
18
19
|
end
|
20
|
+
|
21
|
+
# add first-inline-element class
|
22
|
+
inline_list = within&.first('div.os-solution-container > ol[type="1"]:first-child')
|
23
|
+
return unless inline_list
|
24
|
+
|
25
|
+
inline_list.add_class('first-inline-list-element')
|
26
|
+
inline_list.parent.add_class('has-first-inline-list-element')
|
19
27
|
end
|
20
28
|
end
|
21
29
|
end
|
@@ -13,47 +13,21 @@ module Kitchen
|
|
13
13
|
end
|
14
14
|
|
15
15
|
class V1
|
16
|
-
renderable
|
17
16
|
def bake(chapter:, metadata_source:, uuid_prefix: '.')
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
further_research.
|
30
|
-
|
31
|
-
further_research_title.name = 'h3'
|
32
|
-
further_research_title.replace_children(with: <<~HTML
|
33
|
-
<span class="os-number">#{chapter.count_in(:book)}.#{page.count_in(:chapter)}</span>
|
34
|
-
<span class="os-divider"> </span>
|
35
|
-
<span class="os-text" data-type="" itemprop="">#{further_research_title.children}</span>
|
36
|
-
HTML
|
37
|
-
)
|
38
|
-
|
39
|
-
further_research.prepend(child:
|
40
|
-
<<~HTML
|
41
|
-
<a href="##{page.title.id}">
|
42
|
-
#{further_research_title.paste}
|
43
|
-
</a>
|
44
|
-
HTML
|
45
|
-
)
|
46
|
-
further_research.cut(to: further_researches)
|
17
|
+
MoveCustomSectionToEocContainer.v1(
|
18
|
+
chapter: chapter,
|
19
|
+
metadata_source: metadata_source,
|
20
|
+
container_key: 'further-research',
|
21
|
+
uuid_key: "#{uuid_prefix}further-research",
|
22
|
+
section_selector: 'section.further-research',
|
23
|
+
append_to: nil,
|
24
|
+
include_intro_page: false
|
25
|
+
) do |further_research|
|
26
|
+
RemoveSectionTitle.v1(section: further_research)
|
27
|
+
title = EocSectionTitleLinkSnippet.v1(page: further_research.ancestor(:page))
|
28
|
+
further_research.prepend(child: title)
|
29
|
+
further_research.first('h3')[:itemprop] = 'name'
|
47
30
|
end
|
48
|
-
|
49
|
-
return if further_researches.none?
|
50
|
-
|
51
|
-
@content = further_researches.paste
|
52
|
-
|
53
|
-
@in_composite_chapter = false
|
54
|
-
|
55
|
-
chapter.append(child: render(file:
|
56
|
-
'../templates/eoc_section_title_template.xhtml.erb'))
|
57
31
|
end
|
58
32
|
end
|
59
33
|
end
|
@@ -10,7 +10,7 @@ module Kitchen
|
|
10
10
|
SEPARATOR_CLASS = '-os-inline-list-separator'
|
11
11
|
|
12
12
|
def self.v1(book:)
|
13
|
-
inline_lists = book.search('span[data-display="inline"][data-type="
|
13
|
+
inline_lists = book.search('span[data-display="inline"][data-list-type="labeled-item"]')
|
14
14
|
inline_lists.each do |list|
|
15
15
|
list.search('span[data-type="item"]')[0..-2].each do |item|
|
16
16
|
item.append(child: "<span class=\"#{SEPARATOR_CLASS}\">#{LIST_SEPARATOR}</span>")
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Kitchen
|
4
|
+
module Directions
|
5
|
+
module BakeNoteIFrames
|
6
|
+
def self.v1(note:)
|
7
|
+
iframes = note.search('iframe')
|
8
|
+
return unless iframes.any?
|
9
|
+
|
10
|
+
iframes.each do |iframe|
|
11
|
+
iframe.wrap('<div class="os-has-iframe" data-type="alternatives">')
|
12
|
+
iframe.add_class('os-is-iframe')
|
13
|
+
link_ref = iframe[:src]
|
14
|
+
next unless link_ref
|
15
|
+
|
16
|
+
iframe = iframe.parent
|
17
|
+
iframe.add_class('os-has-link')
|
18
|
+
iframe.prepend(child:
|
19
|
+
<<~HTML
|
20
|
+
<a class="os-is-link" href="#{link_ref}" target="_window">#{I18n.t(:iframe_link_text)}</a>
|
21
|
+
HTML
|
22
|
+
)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Kitchen
|
4
|
+
module Directions
|
5
|
+
module EocCompositePageContainer
|
6
|
+
# Creates a wrapper for the given content & appends it to the given element
|
7
|
+
#
|
8
|
+
# @param container_key [String] Appended to 'eoc.' to form the I18n key for the container title; also used as part of a class on the container.
|
9
|
+
# @param uuid_key [String] the uuid key for the wrapper class, e.g. `'.summary'`
|
10
|
+
# @param metadata_source [MetadataElement] metadata for the book
|
11
|
+
# @param content [String] the content to be contained by the wrapper
|
12
|
+
# @param append_to [ElementBase] the element to be appended, usually either a `ChapterElement` or a `CompositeChapterElement`
|
13
|
+
# @return [ElementBase] the append_to element with container appended
|
14
|
+
#
|
15
|
+
def self.v1(container_key:, uuid_key:, metadata_source:, content:,
|
16
|
+
append_to:)
|
17
|
+
V1.new.bake(
|
18
|
+
container_key: container_key,
|
19
|
+
uuid_key: uuid_key,
|
20
|
+
metadata_source: metadata_source,
|
21
|
+
content: content,
|
22
|
+
append_to: append_to
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Kitchen::Directions::EocCompositePageContainer
|
4
|
+
class V1
|
5
|
+
renderable
|
6
|
+
|
7
|
+
def bake(container_key:, uuid_key:, metadata_source:, content:, append_to:)
|
8
|
+
@title = I18n.t(:"eoc.#{container_key}")
|
9
|
+
@uuid_key = uuid_key
|
10
|
+
@container_class_type = container_key
|
11
|
+
@metadata = metadata_source.children_to_keep.copy
|
12
|
+
@content = content
|
13
|
+
@in_composite_chapter = append_to.is?(:composite_chapter)
|
14
|
+
|
15
|
+
append_to.append(child: render(file:
|
16
|
+
'../../templates/eoc_section_template.xhtml.erb'))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rubocop:disable Metrics/ParameterLists
|
4
|
+
# More parameters are ok here because these generic classes DRY up a lot of other code
|
5
|
+
module Kitchen
|
6
|
+
module Directions
|
7
|
+
module MoveCustomSectionToEocContainer
|
8
|
+
# Creates a custom eoc composite page for a section within the given chapter.
|
9
|
+
# The sections are moved into this composite page, and can be transformed before the moved by an optional block argument.
|
10
|
+
#
|
11
|
+
# @param chapter [ChapterElement] the chapter in which the section to be moved is contained
|
12
|
+
# @param metadata_source [MetadataElement] metadata for the book
|
13
|
+
# @param container_key [String] Appended to 'eoc.' to form the I18n key for the container title; also used as part of a class on the container.
|
14
|
+
# @param uuid_key [String] the uuid key for the wrapper class, e.g. `'.summary'`
|
15
|
+
# @param section_selector [String] the selector for the section to be moved, e.g. `'section.summary'`
|
16
|
+
# @param append_to [ElementBase] the element to be appended. Defaults to the value of `chapter` param if none given.
|
17
|
+
# @param include_intro_page [Boolean] control the introduction page for the chapter should be searched for a section to move, default is true
|
18
|
+
# @return [ElementBase] the append_to element with container appended
|
19
|
+
#
|
20
|
+
def self.v1(chapter:, metadata_source:, container_key:, uuid_key:,
|
21
|
+
section_selector:, append_to: nil, include_intro_page: true)
|
22
|
+
V1.new.bake(
|
23
|
+
chapter: chapter,
|
24
|
+
metadata_source: metadata_source,
|
25
|
+
container_key: container_key,
|
26
|
+
uuid_key: uuid_key,
|
27
|
+
section_selector: section_selector,
|
28
|
+
append_to: append_to || chapter,
|
29
|
+
include_intro_page: include_intro_page
|
30
|
+
) do |section|
|
31
|
+
yield section if block_given?
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
# rubocop:enable Metrics/ParameterLists
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rubocop:disable Metrics/ParameterLists
|
4
|
+
# More parameters are ok here because these generic classes DRY up a lot of other code
|
5
|
+
module Kitchen::Directions::MoveCustomSectionToEocContainer
|
6
|
+
class V1
|
7
|
+
def bake(chapter:, metadata_source:, container_key:, uuid_key:,
|
8
|
+
section_selector:, append_to:, include_intro_page:, &block)
|
9
|
+
section_clipboard = Kitchen::Clipboard.new
|
10
|
+
pages = include_intro_page ? chapter.pages : chapter.non_introduction_pages
|
11
|
+
sections = pages.search(section_selector)
|
12
|
+
sections.each(&block)
|
13
|
+
sections.cut(to: section_clipboard)
|
14
|
+
|
15
|
+
return if section_clipboard.none?
|
16
|
+
|
17
|
+
Kitchen::Directions::EocCompositePageContainer.v1(
|
18
|
+
container_key: container_key,
|
19
|
+
uuid_key: uuid_key,
|
20
|
+
metadata_source: metadata_source,
|
21
|
+
content: section_clipboard.paste,
|
22
|
+
append_to: append_to || chapter
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
# rubocop:enable Metrics/ParameterLists
|
@@ -2,35 +2,18 @@
|
|
2
2
|
|
3
3
|
module Kitchen::Directions::MoveExercisesToEOC
|
4
4
|
class V1
|
5
|
-
renderable
|
6
|
-
|
7
5
|
def bake(chapter:, metadata_source:, klass:, append_to: nil, uuid_prefix: '.')
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
sections.each do |exercise_section|
|
19
|
-
exercise_section.first("[data-type='title']")&.trash
|
20
|
-
|
21
|
-
exercise_section.cut(to: exercise_clipboard)
|
22
|
-
end
|
6
|
+
Kitchen::Directions::MoveCustomSectionToEocContainer.v1(
|
7
|
+
chapter: chapter,
|
8
|
+
metadata_source: metadata_source,
|
9
|
+
container_key: klass,
|
10
|
+
uuid_key: "#{uuid_prefix}#{klass}",
|
11
|
+
section_selector: "section.#{klass}",
|
12
|
+
append_to: append_to || chapter,
|
13
|
+
include_intro_page: false
|
14
|
+
) do |exercise_section|
|
15
|
+
Kitchen::Directions::RemoveSectionTitle.v1(section: exercise_section)
|
23
16
|
end
|
24
|
-
|
25
|
-
return if exercise_clipboard.none?
|
26
|
-
|
27
|
-
@content = exercise_clipboard.paste
|
28
|
-
|
29
|
-
append_to_element = append_to || chapter
|
30
|
-
@in_composite_chapter = append_to_element.is?(:composite_chapter)
|
31
|
-
|
32
|
-
append_to_element.append(child: render(file:
|
33
|
-
'../../templates/eoc_section_title_template.xhtml.erb'))
|
34
17
|
end
|
35
18
|
end
|
36
19
|
end
|
@@ -4,25 +4,16 @@ module Kitchen::Directions::MoveExercisesToEOC
|
|
4
4
|
# Main difference from v1 is the presence of a section title
|
5
5
|
# and some additional wrappers
|
6
6
|
class V2
|
7
|
-
renderable
|
8
|
-
|
9
7
|
def bake(chapter:, metadata_source:, klass:, append_to: nil, uuid_prefix: '.')
|
10
|
-
@klass = klass
|
11
|
-
@metadata = metadata_source.children_to_keep.copy
|
12
|
-
@title = I18n.t(:"eoc.#{klass}")
|
13
|
-
@uuid_prefix = uuid_prefix
|
14
|
-
|
15
8
|
exercise_clipboard = Kitchen::Clipboard.new
|
16
9
|
|
17
10
|
chapter.non_introduction_pages.each do |page|
|
18
|
-
sections = page.search("section.#{
|
11
|
+
sections = page.search("section.#{klass}")
|
19
12
|
|
20
13
|
sections.each do |exercise_section|
|
21
|
-
|
22
|
-
|
14
|
+
Kitchen::Directions::RemoveSectionTitle.v1(section: exercise_section)
|
23
15
|
# Get parent page title
|
24
16
|
section_title = Kitchen::Directions::EocSectionTitleLinkSnippet.v1(page: page)
|
25
|
-
|
26
17
|
# Configure section title & wrappers
|
27
18
|
exercise_section.prepend(child: section_title)
|
28
19
|
exercise_section.wrap('<div class="os-section-area">')
|
@@ -33,17 +24,19 @@ module Kitchen::Directions::MoveExercisesToEOC
|
|
33
24
|
|
34
25
|
return if exercise_clipboard.none?
|
35
26
|
|
36
|
-
|
37
|
-
<div class="os-#{
|
27
|
+
content = <<~HTML
|
28
|
+
<div class="os-#{klass}">
|
38
29
|
#{exercise_clipboard.paste}
|
39
30
|
</div>
|
40
31
|
HTML
|
41
32
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
33
|
+
Kitchen::Directions::EocCompositePageContainer.v1(
|
34
|
+
container_key: klass,
|
35
|
+
uuid_key: "#{uuid_prefix}#{klass}",
|
36
|
+
metadata_source: metadata_source,
|
37
|
+
content: content,
|
38
|
+
append_to: append_to || chapter
|
39
|
+
)
|
47
40
|
end
|
48
41
|
end
|
49
42
|
end
|
@@ -4,46 +4,22 @@ module Kitchen::Directions::MoveExercisesToEOC
|
|
4
4
|
# The difference from v1 is the presence of a section title
|
5
5
|
# and from v2 the lack of additional "os-section-area" and os-#{@klass} wrappers
|
6
6
|
class V3
|
7
|
-
renderable
|
8
|
-
|
9
7
|
def bake(chapter:, metadata_source:, klass:, append_to: nil, uuid_prefix: '.')
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
exercise_section.
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
exercise_section.exercises.each do |exercise|
|
26
|
-
exercise.document.pantry(name: :link_text).store(
|
27
|
-
"#{I18n.t(:exercise_label)} #{chapter.count_in(:book)}.#{exercise.count_in(:chapter)}",
|
28
|
-
label: exercise.id
|
29
|
-
)
|
30
|
-
end
|
31
|
-
|
32
|
-
# Configure section title
|
33
|
-
exercise_section.prepend(child: section_title)
|
34
|
-
exercise_section.cut(to: exercise_clipboard)
|
35
|
-
end
|
8
|
+
Kitchen::Directions::MoveCustomSectionToEocContainer.v1(
|
9
|
+
chapter: chapter,
|
10
|
+
metadata_source: metadata_source,
|
11
|
+
container_key: klass,
|
12
|
+
uuid_key: "#{uuid_prefix}#{klass}",
|
13
|
+
section_selector: "section.#{klass}",
|
14
|
+
append_to: append_to || chapter,
|
15
|
+
include_intro_page: false
|
16
|
+
) do |exercise_section|
|
17
|
+
Kitchen::Directions::RemoveSectionTitle.v1(section: exercise_section)
|
18
|
+
title = Kitchen::Directions::EocSectionTitleLinkSnippet.v1(
|
19
|
+
page: exercise_section.ancestor(:page)
|
20
|
+
)
|
21
|
+
exercise_section.prepend(child: title)
|
36
22
|
end
|
37
|
-
|
38
|
-
return if exercise_clipboard.none?
|
39
|
-
|
40
|
-
@content = exercise_clipboard.paste
|
41
|
-
|
42
|
-
append_to_element = append_to || chapter
|
43
|
-
@in_composite_chapter = append_to_element.is?(:composite_chapter)
|
44
|
-
|
45
|
-
append_to_element.append(child: render(file:
|
46
|
-
'../../templates/eoc_section_title_template.xhtml.erb'))
|
47
23
|
end
|
48
24
|
end
|
49
25
|
end
|
@@ -4,11 +4,11 @@ module Kitchen::Directions::MoveSolutionsToAnswerKey
|
|
4
4
|
module Strategies
|
5
5
|
class Calculus
|
6
6
|
def bake(chapter:, append_to:)
|
7
|
-
checkpoint_solutions = chapter.search('.checkpoint [data-type="solution"]').cut
|
7
|
+
checkpoint_solutions = chapter.search('div.checkpoint div[data-type="solution"]').cut
|
8
8
|
append_solution_area(I18n.t(:checkpoint), checkpoint_solutions, append_to)
|
9
9
|
|
10
|
-
chapter.search('.section-exercises').each do |section|
|
11
|
-
section_solutions = section.search('[data-type="solution"]').cut
|
10
|
+
chapter.search('section.section-exercises').each do |section|
|
11
|
+
section_solutions = section.search('div[data-type="solution"]').cut
|
12
12
|
section_title = I18n.t(
|
13
13
|
:section_exercises,
|
14
14
|
number: "#{chapter.count_in(:book)}.#{section.count_in(:chapter)}"
|
@@ -16,8 +16,8 @@ module Kitchen::Directions::MoveSolutionsToAnswerKey
|
|
16
16
|
append_solution_area(section_title, section_solutions, append_to)
|
17
17
|
end
|
18
18
|
|
19
|
-
chapter.search('.review-exercises').each do |section|
|
20
|
-
section_solutions = section.search('[data-type="solution"]').cut
|
19
|
+
chapter.search('section.review-exercises').each do |section|
|
20
|
+
section_solutions = section.search('div[data-type="solution"]').cut
|
21
21
|
append_solution_area(I18n.t(:review_exercises), section_solutions, append_to)
|
22
22
|
end
|
23
23
|
end
|
@@ -24,8 +24,8 @@ module Kitchen::Directions::MoveSolutionsToAnswerKey
|
|
24
24
|
|
25
25
|
def bake_section(chapter:, append_to:, klass:, number: nil)
|
26
26
|
section_solutions_set = Kitchen::Clipboard.new
|
27
|
-
chapter.search(".#{klass}").each do |section|
|
28
|
-
section.search('[data-type="solution"]').each do |solution|
|
27
|
+
chapter.search("section.#{klass}").each do |section|
|
28
|
+
section.search('div[data-type="solution"]').each do |solution|
|
29
29
|
solution.cut(to: section_solutions_set)
|
30
30
|
end
|
31
31
|
end
|
@@ -56,7 +56,7 @@ module Kitchen::Directions::MoveSolutionsToAnswerKey
|
|
56
56
|
page.notes('$.try').each do |note|
|
57
57
|
note.exercises.each do |exercise|
|
58
58
|
solution = exercise.solution
|
59
|
-
solution&.cut(to: solutions)
|
59
|
+
solution&.cut(to: solutions)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
next if solutions.items.empty?
|
@@ -64,7 +64,7 @@ module Kitchen::Directions::MoveSolutionsToAnswerKey
|
|
64
64
|
title_snippet = Kitchen::Directions::EocSectionTitleLinkSnippet.v2(page: page)
|
65
65
|
|
66
66
|
append_solution_area(title: title_snippet, solutions: solutions,
|
67
|
-
append_to: append_to.search('.os-try-solution-area').first)
|
67
|
+
append_to: append_to.search('div.os-try-solution-area').first)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
@@ -27,8 +27,8 @@ module Kitchen
|
|
27
27
|
# @return [ElementEnumerator]
|
28
28
|
#
|
29
29
|
def children_to_keep
|
30
|
-
search(%w([data-type='revised'] .authors .publishers .print-style .permissions
|
31
|
-
[data-type='subject']))
|
30
|
+
search(%w(span[data-type='revised'] div.authors div.publishers div.print-style div.permissions
|
31
|
+
div[data-type='subject']))
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
data/lib/kitchen/page_element.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
<% main_title_tag = @in_composite_chapter ? 'h3' : 'h2' %>
|
2
|
+
<div class="os-eoc os-<%=@container_class_type%>-container" data-type="composite-page" data-uuid-key="<%= @uuid_key %>">
|
3
|
+
<<%= main_title_tag %> data-type="<%= @in_composite_chapter ? 'title' : 'document-title' %>">
|
4
|
+
<span class="os-text"><%= @title %></span>
|
5
|
+
</<%= main_title_tag %>>
|
6
|
+
<div data-type="metadata" style="display: none;">
|
7
|
+
<h1 data-type="document-title" itemprop="name"><%= @title %></h1>
|
8
|
+
<%= @metadata.paste %>
|
9
|
+
</div>
|
10
|
+
<%= @content %>
|
11
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% main_title_tag = @in_composite_chapter ? 'h3' : 'h2' %>
|
2
|
+
<div class="os-eoc os-<%=@klass%>-container" data-type="composite-page" data-uuid-key="<%=@uuid_prefix%><%=@klass%>">
|
3
|
+
<<%= main_title_tag %> data-type="<%= @in_composite_chapter ? 'title' : 'document-title' %>">
|
4
|
+
<span class="os-text"><%= @title %></span>
|
5
|
+
</<%= main_title_tag %>>
|
6
|
+
<div data-type="metadata" style="display: none;">
|
7
|
+
<h1 data-type="document-title" itemprop="name"><%= @title %></h1>
|
8
|
+
<%= @metadata.paste %>
|
9
|
+
</div>
|
10
|
+
<%= @content %>
|
11
|
+
</div>
|
data/lib/kitchen/version.rb
CHANGED
data/lib/locales/en.yml
CHANGED
@@ -18,16 +18,20 @@ en:
|
|
18
18
|
references: References
|
19
19
|
answer_key_title: Answer Key
|
20
20
|
eoc_chapter_review: Chapter Review
|
21
|
-
eoc_key_terms_title: Key Terms
|
22
|
-
eoc_summary_title: Summary
|
23
21
|
eoc_exercises_title: Exercises
|
24
22
|
eoc_composite_metadata_title: Chapter Review
|
25
23
|
eoc_solutions_title: Solutions
|
26
|
-
eoc_key_concepts: Key Concepts
|
27
|
-
eoc_key_equations: Key Equations
|
28
24
|
eoc_suggested_reading: Suggestions for Further Study
|
29
|
-
eoc_further_research_title: Further Research
|
30
25
|
eob_index_title: Index
|
31
26
|
eob_index_symbols_group: Symbols
|
32
27
|
review_exercises: Review Exercises
|
33
28
|
section_exercises: ! 'Section %{number} Exercises'
|
29
|
+
iframe_link_text: Click to view content
|
30
|
+
eoc:
|
31
|
+
glossary: Key Terms
|
32
|
+
key-equations: Key Equations
|
33
|
+
summary: Summary
|
34
|
+
further-research: Further Research
|
35
|
+
key-concepts: Key Concepts
|
36
|
+
references: References
|
37
|
+
solutions: Solutions
|
data/lib/locales/es.yml
CHANGED
@@ -18,16 +18,18 @@ es:
|
|
18
18
|
references: Referencias
|
19
19
|
answer_key_title: Clave de Respuestas
|
20
20
|
eoc_chapter_review: Revisión Del Capítulo
|
21
|
-
eoc_key_terms_title: Términos Clave
|
22
|
-
eoc_summary_title: Resumen
|
23
21
|
eoc_exercises_title: Ejercicios
|
24
22
|
eoc_composite_metadata_title: Revisión Del Capítulo
|
25
23
|
eoc_solutions_title: Soluciones
|
26
24
|
eoc_key_concepts: Conceptos Clave
|
27
|
-
eoc_key_equations: Ecuaciones Clave
|
28
25
|
eoc_suggested_reading: Sugerencias Para Estudios Adicionales
|
29
|
-
eoc_further_research_title: Investigación Adicional
|
30
26
|
eob_index_title: Índice
|
31
27
|
eob_index_symbols_group: Símbolos
|
32
28
|
review_exercises: Ejercicios De Repaso
|
33
29
|
section_exercises: ! 'Sección %{number} Ejercicios'
|
30
|
+
eoc:
|
31
|
+
glossary: Términos Clave
|
32
|
+
key-equations: Ecuaciones Clave
|
33
|
+
summary: Resumen
|
34
|
+
further-research: Investigación Adicional
|
35
|
+
references: Referencias
|
data/lib/locales/pl.yml
CHANGED
@@ -16,11 +16,13 @@ pl:
|
|
16
16
|
stepwise_step_label: Krok
|
17
17
|
answer_key_title: Rozwiązania zadań
|
18
18
|
eoc_chapter_review: Podsumowanie rozdziału
|
19
|
-
eoc_key_terms_title: Kluczowe pojęcia
|
20
19
|
eoc_solutions_title: Rozwiązania
|
21
|
-
eoc_summary_title: Podsumowanie
|
22
|
-
eoc_key_equations: Najważniejsze wzory
|
23
20
|
eob_index_title: Skorowidz rzeczowy
|
24
21
|
eob_index_symbols_group: Symbole
|
25
22
|
references: Bibliografia
|
23
|
+
eoc:
|
24
|
+
glossary: Kluczowe pojęcia
|
25
|
+
key-equations: Najważniejsze wzory
|
26
|
+
summary: Podsumowanie
|
27
|
+
references: Bibliografia
|
26
28
|
|
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
|
+
version: 9.2.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-
|
11
|
+
date: 2021-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -263,6 +263,7 @@ files:
|
|
263
263
|
- lib/kitchen/directions/bake_checkpoint.rb
|
264
264
|
- lib/kitchen/directions/bake_composite_chapters.rb
|
265
265
|
- lib/kitchen/directions/bake_composite_pages.rb
|
266
|
+
- lib/kitchen/directions/bake_eoc_section_content/remove_section_title.rb
|
266
267
|
- lib/kitchen/directions/bake_equations.rb
|
267
268
|
- lib/kitchen/directions/bake_example.rb
|
268
269
|
- lib/kitchen/directions/bake_figure.rb
|
@@ -281,6 +282,7 @@ files:
|
|
281
282
|
- lib/kitchen/directions/bake_math_in_paragraph.rb
|
282
283
|
- lib/kitchen/directions/bake_non_introduction_pages.rb
|
283
284
|
- lib/kitchen/directions/bake_notes/bake_autotitled_notes.rb
|
285
|
+
- lib/kitchen/directions/bake_notes/bake_note_iframes.rb
|
284
286
|
- lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
|
285
287
|
- lib/kitchen/directions/bake_notes/bake_numbered_notes/main.rb
|
286
288
|
- lib/kitchen/directions/bake_notes/bake_numbered_notes/v1.rb
|
@@ -313,7 +315,11 @@ files:
|
|
313
315
|
- lib/kitchen/directions/chapter_review_container/chapter_review.xhtml.erb
|
314
316
|
- lib/kitchen/directions/chapter_review_container/main.rb
|
315
317
|
- lib/kitchen/directions/chapter_review_container/v1.rb
|
318
|
+
- lib/kitchen/directions/eoc_composite_page_container/main.rb
|
319
|
+
- lib/kitchen/directions/eoc_composite_page_container/v1.rb
|
316
320
|
- lib/kitchen/directions/eoc_section_title_link_snippet.rb
|
321
|
+
- lib/kitchen/directions/move_custom_section_to_eoc_container/main.rb
|
322
|
+
- lib/kitchen/directions/move_custom_section_to_eoc_container/v1.rb
|
317
323
|
- lib/kitchen/directions/move_exercises_to_eoc/main.rb
|
318
324
|
- lib/kitchen/directions/move_exercises_to_eoc/v1.rb
|
319
325
|
- lib/kitchen/directions/move_exercises_to_eoc/v2.rb
|
@@ -368,7 +374,8 @@ files:
|
|
368
374
|
- lib/kitchen/table_element.rb
|
369
375
|
- lib/kitchen/table_element_enumerator.rb
|
370
376
|
- lib/kitchen/templates/eob_section_title_template.xhtml.erb
|
371
|
-
- lib/kitchen/templates/
|
377
|
+
- lib/kitchen/templates/eoc_section_template.xhtml.erb
|
378
|
+
- lib/kitchen/templates/eoc_section_template_old.xhtml.erb
|
372
379
|
- lib/kitchen/term_element.rb
|
373
380
|
- lib/kitchen/term_element_enumerator.rb
|
374
381
|
- lib/kitchen/type_casting_element_enumerator.rb
|
@@ -1,10 +0,0 @@
|
|
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>
|