openstax_kitchen 3.1.0 → 3.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 +4 -0
- data/Gemfile.lock +1 -1
- data/lib/kitchen/directions/bake_equations.rb +12 -2
- data/lib/kitchen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e855f5598f3d3a425d670a828131a25605935b01ce0de9c38cceea7bb27703f
|
4
|
+
data.tar.gz: 50b1a58be988e539a031390ee7387a1249a1ddcdc2734c3b9a0d9c9dfa43b426
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 844384ec30da9c49e15026d1e5604e7248ef3a2806bbd242be398a04d6d8bddb8924225036dc3f4cfd0a0033fa27fa0bb975768317ddae012684bcf01e5b7483
|
7
|
+
data.tar.gz: 3f68410be5d1f0e7b06a8f8b618f44cd022a35d6e5ab6ce76a785eb5f702cd22ef2312cba218d8d0fb0628ce13d04cffc023fc647bee16c6ebe6ab566c2f862e
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [3.2.0] - 2021-04-19
|
10
|
+
|
11
|
+
* Adds a decorating option of equation numbers on `BakeEquations` (minor)
|
12
|
+
|
9
13
|
## [3.1.0] - 2021-04-19
|
10
14
|
|
11
15
|
* Add the ability to copy an element's ID to `ElementBase` (minor)
|
data/Gemfile.lock
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Kitchen
|
4
4
|
module Directions
|
5
5
|
module BakeEquations
|
6
|
-
def self.v1(book:)
|
6
|
+
def self.v1(book:, number_decorator: :none)
|
7
7
|
book.chapters.search('[data-type="equation"]:not(.unnumbered)').each do |eq|
|
8
8
|
chapter = eq.ancestor(:chapter)
|
9
9
|
number = "#{chapter.count_in(:book)}.#{eq.count_in(:chapter)}"
|
@@ -12,11 +12,21 @@ module Kitchen
|
|
12
12
|
equation_label = "#{I18n.t(:equation)} #{number}"
|
13
13
|
book.document.pantry(name: :link_text).store equation_label, label: eq.id
|
14
14
|
|
15
|
+
decorated_number =
|
16
|
+
case number_decorator
|
17
|
+
when :none
|
18
|
+
number
|
19
|
+
when :parentheses
|
20
|
+
"(#{number})"
|
21
|
+
else
|
22
|
+
raise "Unsupported number_decorator '#{number_decorator}'"
|
23
|
+
end
|
24
|
+
|
15
25
|
# Bake the equation
|
16
26
|
eq.append(child:
|
17
27
|
<<~HTML
|
18
28
|
<div class="os-equation-number">
|
19
|
-
<span class="os-number">#{
|
29
|
+
<span class="os-number">#{decorated_number}</span>
|
20
30
|
</div>
|
21
31
|
HTML
|
22
32
|
)
|
data/lib/kitchen/version.rb
CHANGED