5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/kitchen/directions/bake_autotitled_exercise/v1.rb', line 5
def bake(exercise:, number:)
exercise.add_class('unnumbered') unless number
exercise.problem.wrap_children('div', class: 'os-problem-container')
exercise.problem.prepend(child:
<<~HTML
<h4 class="exercise-title" data-type="title">#{exercise.autogenerated_title}</h4>
HTML
)
return unless exercise.solution
exercise.solution.wrap_children('div', class: 'os-solution-container')
exercise.solution.prepend(child:
<<~HTML
<h4 class="solution-title" data-type="title">
<span class="os-text">#{I18n.t(:"exercises.solution")}</span>
</h4>
HTML
)
end
|