Skip to content

Commit

Permalink
move Hint and Solution knowls to details/summary disclosure
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Jordan committed Oct 10, 2023
1 parent a208c21 commit b772447
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions macros/core/PGbasicmacros.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1182,8 +1182,20 @@ sub SOLUTION {
return "" if $solution_body eq "";

if ($displayMode =~ /HTML/) {
TEXT('<div class="knowl-container">',
knowlLink(SOLUTION_HEADING(), value => $solution_body, type => 'solution'), '</div>');
TEXT(tag(
'div',
class => 'solution accordion border-bottom-0',
tag(
'details',
class => 'accordion-item border-bottom-0',
tag(
'summary',
class => 'accordion-button',
tag('div', class => 'accordion-header user-select-none', SOLUTION_HEADING())
)
. tag('div', class => 'accordion-body border-bottom', $solution_body)
)
));
} elsif ($displayMode =~ /TeX/) {
TEXT(
"\n%%% BEGIN SOLUTION\n"
Expand All @@ -1208,7 +1220,20 @@ sub HINT {
my $hint_body = hint(@_);
return unless $hint_body;
if ($displayMode =~ /HTML/) {
TEXT('<div class="knowl-container">', knowlLink(HINT_HEADING(), value => $hint_body, type => 'hint'), '</div>');
TEXT(tag(
'div',
class => 'hint accordion border-bottom-0',
tag(
'details',
class => 'accordion-item border-bottom-0',
tag(
'summary',
class => 'accordion-button',
tag('div', class => 'accordion-header user-select-none', HINT_HEADING())
)
. tag('div', class => 'accordion-body border-bottom', $hint_body)
)
));
} elsif ($displayMode =~ /TeX/) {
TEXT(
"\n%%% BEGIN HINT\n"
Expand Down Expand Up @@ -1507,7 +1532,7 @@ sub SOLUTION_HEADING {
MODES(
TeX => '{\\bf ' . maketext('Solution: ') . ' }',
Latex2HTML => '\\par {\\bf ' . maketext('Solution:') . ' }',
HTML => '<B>' . maketext('Solution:') . '</B> ',
HTML => maketext('Solution'),
PTX => ''
);
}
Expand All @@ -1516,7 +1541,7 @@ sub HINT_HEADING {
MODES(
TeX => "{\\bf " . maketext('Hint: ') . "}",
Latex2HTML => "\\par {\\bf " . maketext('Hint:') . " }",
HTML => "<B>" . maketext('Hint:') . "</B> ",
HTML => maketext('Hint'),
PTX => ''
);
}
Expand Down

0 comments on commit b772447

Please sign in to comment.