HOL icon indicating copy to clipboard operation
HOL copied to clipboard

A broken generated HTML theory in non-Unicode mode

Open binghe opened this issue 2 years ago • 2 comments

Hi,

It seems that for each core theory there are two HTML pages generated in the help page. One is that you directly click the theory names from the HOL Reference Page (help/index.html), the other is that you first go to the Theory Graph (help/theorygraph/theories.html) and then click the graph nodes. The first one contains definitions and theorems with Unicode letters, and the second one doesn't use Unicode. I would say it's not bad to have two different HTML outputs for the same theory file.

But in cardinalTheory, the abbreviation symbol of cardlt (<</=) has caused problems with HTML because part of it looks like a HTML tag:

val _ = set_fixity "<</=" (Infix(NONASSOC, 450));

val _ = Unicode.unicode_version {u = UTF8.chr 0x227A, tmnm = "<</="};
val _ = TeX_notation {hol = "<</=",          TeX = ("\\ensuremath{\\prec}", 1)};
val _ = TeX_notation {hol = UTF8.chr 0x227A, TeX = ("\\ensuremath{\\prec}", 1)};

val _ = overload_on ("cardlt", ``\s1 s2. ~(cardleq s2 s1)``); (* cardlt *)
val _ = overload_on ("<</=", ``cardlt``);

And if you open the non-Unicode version of HTML page of cardinalTheory, you can see something like this: Screenshot 2024-04-23 alle 11 46 00

Either we fix the HTML-generation code to escape the problematic characters (better, but I have no idea where is the related SML code), or we modify the symbols of cardlt (but there could be more such cases that I haven't seen).

Chun

binghe avatar Apr 23 '24 01:04 binghe

The HTML printing is done in src/parse/Hol_pp.sml.

mn200 avatar May 01 '24 01:05 mn200

The HTML printing is done in src/parse/Hol_pp.sml.

Thanks. Then I will try to fix this issue.

binghe avatar May 01 '24 03:05 binghe