@@ -3220,95 +3220,6 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
32203220<xsl : template match =" interactive[@desmos|@geogebra|@calcplot3d|@circuitjs|@iframe]" mode =" embed-iframe-url" />
32213221
32223222
3223- <!-- Static URL's -->
3224- <!-- Predictable and/or stable URLs for versions -->
3225- <!-- of interactives available online. These are -->
3226- <!-- -->
3227- <!-- (1) "standalone" pages for author/local material, -->
3228- <!-- as a product of the HTML conversion -->
3229- <!-- (2) computable addresses of network resources, -->
3230- <!-- eg the YouTube page of a resource -->
3231-
3232- <!-- Point to HTML-produced, and canonically-hosted, standalone page -->
3233- <!-- NB: baseurl is assumed to have a trailing slash -->
3234-
3235- <xsl : template match =" audio[@source|@href]|video[@source|@href]|interactive" mode =" static-url" >
3236- <xsl : value-of select =" $baseurl" />
3237- <xsl : apply-templates select =" ." mode =" standalone-filename" />
3238- </xsl : template >
3239-
3240- <!-- Natural override for YouTube videos -->
3241- <!-- Better - standalone page, with "View on You Tube" -->
3242-
3243- <!-- NB: ampersand is escaped for LaTeX use, be careful with switch to QR codes via Python! -->
3244- <!-- POTENTIAL BUG: this should be un-LaTeX'ed for general use and then -->
3245- <!-- sanitized on the receiving end in the LaTeX conversion, or maybe -->
3246- <!-- the LaTeX conversion will do just fine if the right URL package is -->
3247- <!-- used and the ampersand is handled correctly? -->
3248-
3249- <xsl : template match =" video[@youtube|@youtubeplaylist]" mode =" static-url" >
3250- <xsl : apply-templates select =" ." mode =" youtube-view-url" />
3251- <xsl : if test =" @start" >
3252- <xsl : text >\& start=</xsl : text >
3253- <xsl : value-of select =" @start" />
3254- </xsl : if >
3255- <xsl : if test =" @end" >
3256- <xsl : text >\& end=</xsl : text >
3257- <xsl : value-of select =" @end" />
3258- </xsl : if >
3259- </xsl : template >
3260-
3261- <xsl : template match =" video[@youtube|@youtubeplaylist]" mode =" youtube-view-url" >
3262- <xsl : variable name =" youtube" >
3263- <xsl : choose >
3264- <xsl : when test =" @youtubeplaylist" >
3265- <xsl : value-of select =" normalize-space(@youtubeplaylist)" />
3266- </xsl : when >
3267- <xsl : otherwise >
3268- <xsl : value-of select =" normalize-space(str:replace(@youtube, ',', ' '))" />
3269- </xsl : otherwise >
3270- </xsl : choose >
3271- </xsl : variable >
3272- <xsl : text >https://www.youtube.com/</xsl : text >
3273- <xsl : choose >
3274- <xsl : when test =" @youtubeplaylist" >
3275- <xsl : text >playlist?list=</xsl : text >
3276- <xsl : value-of select =" $youtube" />
3277- </xsl : when >
3278- <xsl : when test =" contains($youtube, ' ')" >
3279- <xsl : text >watch_videos?video_ids=</xsl : text >
3280- <xsl : value-of select =" str:replace($youtube, ' ', ',')" />
3281- </xsl : when >
3282- <xsl : otherwise >
3283- <xsl : text >watch?v=</xsl : text >
3284- <xsl : value-of select =" $youtube" />
3285- </xsl : otherwise >
3286- </xsl : choose >
3287- </xsl : template >
3288-
3289- <!-- Vimeo view URL -->
3290- <xsl : template match =" video[@vimeo]" mode =" static-url" >
3291- <xsl : text >https://vimeo.com/</xsl : text >
3292- <xsl : value-of select =" @vimeo" />
3293- </xsl : template >
3294-
3295- <!-- A bit different than above, but same mode -->
3296- <!-- When a "datafile" is produced in a static -->
3297- <!-- context, then we append the $baseurl, and -->
3298- <!-- provide the external directory. -->
3299- <xsl : template match =" dataurl[@source]" mode =" static-url" >
3300- <xsl : value-of select =" $baseurl" />
3301- <!-- empty when not using managed directories -->
3302- <xsl : value-of select =" $external-directory" />
3303- <xsl : apply-templates select =" @source" />
3304- </xsl : template >
3305-
3306- <!-- interactive programs -->
3307- <xsl : template match =" program[@interactive != '' and @interactive != 'no']" mode =" static-url" >
3308- <xsl : value-of select =" $baseurl" />
3309- <xsl : apply-templates select =" ." mode =" containing-filename" />
3310- </xsl : template >
3311-
33123223<!-- The contents of a datafile may be encoded as text in an XML -->
33133224<!-- file within the generated/datafile directory. The filename -->
33143225<!-- has this construction, even if we do not always consult it. -->
0 commit comments