@@ -2323,6 +2323,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
23232323 <xsl : value-of select =" @assembly-id" />
23242324</xsl : template >
23252325
2326+ <xsl : template match =" program[@interactive]" mode =" assembly-id" >
2327+ <xsl : value-of select =" @assembly-id" />
2328+ </xsl : template >
2329+
23262330<xsl : template match =" datafile" mode =" assembly-id" >
23272331 <xsl : value-of select =" @assembly-id" />
23282332</xsl : template >
@@ -4089,6 +4093,12 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
40894093 <xsl : apply-templates select =" @source" />
40904094</xsl : template >
40914095
4096+ <!-- interactive programs need to point to page in book -->
4097+ <xsl : template match =" program[@interactive = 'codelens' or @interactive = 'activecode']" mode =" static-url" >
4098+ <xsl : value-of select =" $baseurl" />
4099+ <xsl : apply-templates select =" ." mode =" containing-filename" />
4100+ </xsl : template >
4101+
40924102<!-- The contents of a datafile may be encoded as text in an XML -->
40934103<!-- file within the generated/datafile directory. The filename -->
40944104<!-- has this construction, even if we do not always consult it. -->
@@ -4140,4 +4150,50 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
41404150 <xsl : variable name =" interactive-url-file" select =" concat($generated-directory-source,'qrcode/', @assembly-id, '-url.xml')" />
41414151 <xsl : value-of select =" document($interactive-url-file, $original)/interactive-url/@url" />
41424152</xsl : template >
4153+
4154+ <xsl : template match =" program[@interactive = 'codelens' or @interactive = 'activecode']" mode =" representations" >
4155+ <xsl : choose >
4156+ <xsl : when test =" $exercise-style = 'static'" >
4157+ <!-- first the static program -->
4158+ <xsl : copy >
4159+ <xsl : apply-templates select =" node()|@*" mode =" representations" />
4160+ </xsl : copy >
4161+ <!-- then a qr assemblage if desired -->
4162+ <xsl : if test =" $b-program-static-qrcodes" >
4163+ <xsl : variable name =" static-url" >
4164+ <xsl : apply-templates select =" ." mode =" get-interactive-url-from-file" />
4165+ </xsl : variable >
4166+ <sidebyside margins =" 0%" widths =" 70% 25%" valign =" middle" halign =" center" >
4167+ <paragraphs >
4168+ <p pi : indent =" no" >
4169+ <xsl : element name =" pi:localize" >
4170+ <xsl : attribute name =" string-id" >program-interactive-available</xsl : attribute >
4171+ </xsl : element >
4172+ </p >
4173+ <p pi : indent =" no" >
4174+ <!-- Kill the automatic footnote -->
4175+ <url href =" {$static-url}" visual =" " >
4176+ <xsl : value-of select =" $static-url" />
4177+ </url >
4178+ </p >
4179+ </paragraphs >
4180+ <image >
4181+ <xsl : attribute name =" pi:generated" >
4182+ <xsl : text >qrcode/</xsl : text >
4183+ <xsl : apply-templates select =" ." mode =" assembly-id" />
4184+ <xsl : text >.png</xsl : text >
4185+ </xsl : attribute >
4186+ </image >
4187+ </sidebyside >
4188+ </xsl : if >
4189+ </xsl : when >
4190+ <xsl : when test =" ($exercise-style = 'dynamic')" >
4191+ <!-- duplicate authored content for the non-static conversions -->
4192+ <xsl : copy >
4193+ <xsl : apply-templates select =" node()|@*" mode =" representations" />
4194+ </xsl : copy >
4195+ </xsl : when >
4196+ </xsl : choose >
4197+ </xsl : template >
4198+
41434199</xsl : stylesheet >
0 commit comments