| 1 |
% \subsubsection{Including widgets} |
| 2 |
% \DescribeMacro{\includeinteractive}{Cognate to |includegraphics| but |
| 3 |
% instead of a graphics file, accepts a |.js| file which will be |
| 4 |
% loaded as an interactive widget.} |
| 5 |
% \begin{macrocode} |
| 6 |
%<*classXimera> |
| 7 |
\define@key{interactive}{id}{\def\interactive@id{#1}} |
| 8 |
\setkeys{interactive}{id=} |
| 9 |
\newcommand{\includeinteractive}[2][]{ |
| 10 |
\setkeys*{interactive}{#1}% |
| 11 |
\ifthenelse{\equal{\interactive@id}{}}{}{\recordvariable{\interactive@id}} |
| 12 |
Interactive |
| 13 |
} |
| 14 |
%</classXimera> |
| 15 |
% \end{macrocode} |
| 16 |
% \begin{macrocode} |
| 17 |
%<*htXimera> |
| 18 |
\renewcommand{\includeinteractive}[2][]{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div id="interactive\arabic{identification}" class="interactive"> </div>}\HCode{<script src="#2" data-argument="#1" data-target="interactive\arabic{identification}"> </script>}\IgnoreIndent} |
| 19 |
%</htXimera> |
| 20 |
% \end{macrocode} |
| 21 |
|
| 22 |
|