HTML: variables or parameters

5 views
Skip to first unread message

Rob Beezer

unread,
Nov 19, 2022, 7:05:37 PM11/19/22
to prete...@googlegroups.com
Likely of most interest to David, but if you are a use case, please speak up.

An XSL "variable" is scoped within a stylesheet, while an XSL "param" can
communicate with it's surroundings. In other words, to communicate with a
stylesheet at the command-line, or from Python, you must start by defining a
"param". I say some stylesheets are "parameterized".

We have in the HTML conversion:

<xsl:param name="html.css.server" select="'https://pretextbook.org'"/>

<xsl:param name="html.css.version" select="'0.4'"/>

<xsl:param name="html.js.server" select="'https://pretextbook.org'"/>

<xsl:param name="html.js.version" select="'0.13'"/>

We edit the select value as necessary. Does anybody pass in these values from
outside? Can I switch these to "variable"?

On a quest to clean up how parameters are defined, initialized, employed, etc.

Thanks,
Rob




David W. Farmer

unread,
Nov 19, 2022, 7:17:56 PM11/19/22
to prete...@googlegroups.com

Those were probably motivated by me. All I need for my current
use case is to have those values appear in the HTML files.

This also means those are only changed via a pull request.

The upcoming React JS will need to know about those values.
It that will come from information in the HTML file, then it looks
safe to switch those to 'variable'.

We will want the option of having all CSS and JS packaged
with the HTML. I don't know enough to say whether that can
be accomplished with a 'variable' instead of a 'parameter'.

Regards,

David, who is on a quest to learn as little XSL as possible
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pretext-dev...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-dev/8eaa64e9-e4b5-2f12-3d70-ec1faf2ee211%40ups.edu.
>
>

Rob Beezer

unread,
Nov 19, 2022, 7:45:50 PM11/19/22
to prete...@googlegroups.com
On 11/19/22 16:17, David W. Farmer wrote:
> This also means those are only changed via a pull request.

Perfect. As expected. Thanks. I'll let this sit for a bit, but make a switch
soon if there is no more chatter. And trivial to switch back.

> We will want the option of having all CSS and JS packaged
> with the HTML.  I don't know enough to say whether that can
> be accomplished with a 'variable' instead of a 'parameter'.

We'll cross that bridge when we get there.

> Regards,
>
> David, who is on a quest to learn as little XSL as possible

Sorry!!! I tried to sneak in just a little bit of education there. ;-)

Rob, who is trying to learn as little JS as possible

Rob Beezer

unread,
Nov 20, 2022, 2:20:48 PM11/20/22
to prete...@googlegroups.com
Replied just now to another thread, and realize that the urgency of my quest may
have caused me to speak too soon.

If somebody (Tom S) wants to *develop* a new style for HTML via new CSS files,
they will want to point to a different server and it miht be convenient to have
these as parameters (rather than working on a git branch).

So I think I'll hold off until overhaul and React settle down.

Rob
Reply all
Reply to author
Forward
0 new messages