openstax_kitchen 11.1.0 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +2 -2
- data/lib/kitchen/directions/bake_accessibility_fixes.rb +11 -0
- data/lib/kitchen/directions/bake_chapter_introductions/bake_chapter_objectives.rb +2 -0
- data/lib/kitchen/directions/bake_chapter_introductions/v1.rb +8 -48
- data/lib/kitchen/directions/bake_chapter_references/v1.rb +2 -0
- data/lib/kitchen/directions/bake_example.rb +2 -2
- data/lib/kitchen/directions/bake_footnotes/v1.rb +5 -1
- data/lib/kitchen/directions/bake_free_response/v1.rb +2 -0
- data/lib/kitchen/directions/bake_notes/bake_autotitled_notes.rb +1 -1
- data/lib/kitchen/directions/bake_notes/bake_numbered_notes/v3.rb +3 -0
- data/lib/kitchen/directions/bake_numbered_table/v1.rb +2 -0
- data/lib/kitchen/directions/bake_numbered_table/v2.rb +2 -0
- data/lib/kitchen/exercise_element.rb +8 -0
- data/lib/kitchen/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e366a482a30f5cda88fe3c76731d3f187e727447cfc9ae1c13ff5e8bb99c1daa
|
4
|
+
data.tar.gz: 97db8d770c708fda67c566157989b0999fe12859eb515d52da73a86136ab9c29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1b69721238c536696a265d4419f94944746a8a934f24c2e39d8beebe27b18fbd85b1da1599cf6cf326e2d44053b0927db0ab7edae3e24c1a5bfea44839555d9
|
7
|
+
data.tar.gz: 2b420da729d4282fc85f7b074c2848f83d7912a5ff75365ba91d6406b245a1442f0c3dd7074cc6744b44ba96cdc8d00a0a872b092f54a3865e0fd21daff3d81d
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [11.2.0] - 2021-09-10
|
10
|
+
|
11
|
+
* Adds `BakeAccessibilityFixes` direction for (minor)
|
12
|
+
* Remove deprecation warning from `BakeChapterIntroductions.v1` and adapted to be used like `.v2` (minor)
|
13
|
+
* Small class fix for `BakeFootnotes.v1` (patch)
|
14
|
+
* Fix `BakeNumberedNotes` to find related example better (minor)
|
15
|
+
* Small fix for parameter in `bake_note` definition (minor)
|
16
|
+
* Small fixes to return when no elements are found and not add an empty wrapper in `BakeChapterReferences` and
|
17
|
+
`BakeFreeResponse` (minor)
|
18
|
+
* Adding class `os-timeline-table-container` to numbered tables when required (minor)
|
19
|
+
* Fix `BakeExample` to catch the multiple solutions to one exercise (patch)
|
20
|
+
|
9
21
|
## [11.1.0] - 2021-08-30
|
10
22
|
|
11
23
|
* Update injected questions to synthesize ids during baking (minor)
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openstax_kitchen (11.
|
4
|
+
openstax_kitchen (11.2.0)
|
5
5
|
activesupport
|
6
6
|
i18n
|
7
7
|
nokogiri
|
@@ -11,7 +11,7 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activesupport (6.1.4)
|
14
|
+
activesupport (6.1.4.1)
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
16
|
i18n (>= 1.6, < 2)
|
17
17
|
minitest (>= 5.1)
|
@@ -18,6 +18,8 @@ module Kitchen::Directions::BakeChapterIntroductions
|
|
18
18
|
def bake_as_note(chapter:)
|
19
19
|
chapter_objectives_note = chapter.notes('$.chapter-objectives').first
|
20
20
|
|
21
|
+
return unless chapter_objectives_note.present?
|
22
|
+
|
21
23
|
# trash existing title
|
22
24
|
chapter_objectives_note.titles.first&.trash
|
23
25
|
Kitchen::Directions::BakeAutotitledNotes.v1(
|
@@ -3,54 +3,14 @@
|
|
3
3
|
module Kitchen::Directions::BakeChapterIntroductions
|
4
4
|
class V1
|
5
5
|
def bake(book:)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
title = introduction_page.title.cut
|
16
|
-
title.name = 'h2'
|
17
|
-
Kitchen::Directions::MoveTitleTextIntoSpan.v1(title: title)
|
18
|
-
|
19
|
-
intro_content = introduction_page.search(
|
20
|
-
"> :not([data-type='metadata']):not(.splash):not(.has-splash)"
|
21
|
-
).cut
|
22
|
-
|
23
|
-
chapter_objectives_html = chapter.non_introduction_pages.map do |page|
|
24
|
-
<<~HTML
|
25
|
-
<div class="os-chapter-objective">
|
26
|
-
<a class="os-chapter-objective" href="##{page.title[:id]}">
|
27
|
-
<span class="os-number">#{chapter.count_in(:book)}.#{page.count_in(:chapter)}</span>
|
28
|
-
<span class="os-divider"> </span>
|
29
|
-
<span data-type="" itemprop="" class="os-text">#{page.title.children[0].text}</span>
|
30
|
-
</a>
|
31
|
-
</div>
|
32
|
-
HTML
|
33
|
-
end.join('')
|
34
|
-
|
35
|
-
chapter_outline =
|
36
|
-
Kitchen::Directions::BakeChapterIntroductions.bake_chapter_outline(
|
37
|
-
chapter_objectives_html: chapter_objectives_html
|
38
|
-
)
|
39
|
-
|
40
|
-
introduction_page.append(child:
|
41
|
-
<<~HTML
|
42
|
-
<div class="intro-body">
|
43
|
-
#{chapter_outline}
|
44
|
-
<div class="intro-text">
|
45
|
-
#{title.paste}
|
46
|
-
#{intro_content.paste}
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
HTML
|
50
|
-
)
|
51
|
-
end
|
52
|
-
|
53
|
-
Kitchen::Directions::BakeChapterIntroductions.v1_update_selectors(book)
|
6
|
+
Kitchen::Directions::BakeChapterIntroductions.v2(
|
7
|
+
book: book,
|
8
|
+
strategy_options: {
|
9
|
+
strategy: :add_objectives,
|
10
|
+
bake_chapter_outline: true,
|
11
|
+
introduction_order: :v1
|
12
|
+
}
|
13
|
+
)
|
54
14
|
end
|
55
15
|
end
|
56
16
|
end
|
@@ -30,9 +30,9 @@ module Kitchen
|
|
30
30
|
problem.wrap_children(class: 'os-problem-container')
|
31
31
|
end
|
32
32
|
|
33
|
-
|
33
|
+
exercise.solutions.each do |solution|
|
34
34
|
solution_number = if numbered_solutions
|
35
|
-
"<span class=\"os-number\">#{
|
35
|
+
"<span class=\"os-number\">#{solution.count_in(:example)}</span>"
|
36
36
|
else
|
37
37
|
''
|
38
38
|
end
|
@@ -28,7 +28,11 @@ module Kitchen::Directions::BakeFootnotes
|
|
28
28
|
anchor.replace_children(with: footnote_number)
|
29
29
|
aside_id = anchor[:href][1..-1]
|
30
30
|
aside_id_to_footnote_number[aside_id] = footnote_number
|
31
|
-
|
31
|
+
if anchor.parent.name == 'p'
|
32
|
+
anchor.parent.add_class('has-noteref')
|
33
|
+
elsif anchor.parent.name == 'em' && anchor.parent.parent.name == 'p'
|
34
|
+
anchor.parent.parent.add_class('has-noteref')
|
35
|
+
end
|
32
36
|
end
|
33
37
|
|
34
38
|
container.search('aside').each do |aside|
|
@@ -9,6 +9,9 @@ module Kitchen::Directions
|
|
9
9
|
book.chapters.pages.notes("$.#{klass}").each do |note|
|
10
10
|
note.wrap_children(class: 'os-note-body')
|
11
11
|
previous_example = note.previous
|
12
|
+
until previous_example.nil? || previous_example[:'data-type'] == 'example'
|
13
|
+
previous_example = previous_example.previous
|
14
|
+
end
|
12
15
|
os_number = previous_example&.first('.os-number')&.children&.to_s
|
13
16
|
|
14
17
|
note.prepend(child:
|
@@ -39,6 +39,14 @@ module Kitchen
|
|
39
39
|
first("div[data-type='solution']")
|
40
40
|
end
|
41
41
|
|
42
|
+
# Returns the enumerator for solutions
|
43
|
+
#
|
44
|
+
# @return [ElementEnumerator]
|
45
|
+
#
|
46
|
+
def solutions
|
47
|
+
search("div[data-type='solution']")
|
48
|
+
end
|
49
|
+
|
42
50
|
# Returns whether the exercise has been baked
|
43
51
|
#
|
44
52
|
# @return [Boolean]
|
data/lib/kitchen/version.rb
CHANGED
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: 11.
|
4
|
+
version: 11.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-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -243,6 +243,7 @@ files:
|
|
243
243
|
- lib/kitchen/counter.rb
|
244
244
|
- lib/kitchen/debug/print_recipe_error.rb
|
245
245
|
- lib/kitchen/directions/.rubocop.yml
|
246
|
+
- lib/kitchen/directions/bake_accessibility_fixes.rb
|
246
247
|
- lib/kitchen/directions/bake_annotation_classes/main.rb
|
247
248
|
- lib/kitchen/directions/bake_annotation_classes/v1.rb
|
248
249
|
- lib/kitchen/directions/bake_appendix.rb
|
@@ -458,7 +459,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
458
459
|
- !ruby/object:Gem::Version
|
459
460
|
version: '0'
|
460
461
|
requirements: []
|
461
|
-
rubygems_version: 3.0.3
|
462
|
+
rubygems_version: 3.0.3
|
462
463
|
signing_key:
|
463
464
|
specification_version: 4
|
464
465
|
summary: OpenStax content baking library
|