/usr/share/yelp-xsl/xslt/common/html.xsl is in yelp-xsl 3.10.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 | <?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
<!--
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program; see the file COPYING.LGPL. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:exsl="http://exslt.org/common"
xmlns:set="http://exslt.org/sets"
xmlns:its="http://www.w3.org/2005/11/its"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="html mml set its"
extension-element-prefixes="exsl"
version="1.0">
<!--!!==========================================================================
HTML Output
Common utilities and CSS for transformations to HTML.
:Requires: l10n color icons
:Revision:version="1.0" date="2010-05-26" status="final"
This stylesheet contains common templates for creating HTML output. The
*{html.output} template creates an output file for a node in the source XML
document, calling *{html.page} to create the actual output. Output files can
be either XHTML or HTML, depending on the @{html.xhtml} parameter.
This stylesheet matches #{/} and calls *{html.output} on the root XML element.
This works for most input formats. If you need to do something different, you
should override the match for #{/}.
-->
<xsl:template match="/">
<xsl:call-template name="html.output">
<xsl:with-param name="node" select="*"/>
</xsl:call-template>
</xsl:template>
<!--@@==========================================================================
html.basename
The base filename of the primary output file.
:Revision:version="1.0" date="2010-05-25" status="final"
This parameter specifies the base filename of the primary output file, without
the filename extension. This is used by *{html.output} to determine the output
filename, and may be used by format-specific linking code. By default, it uses
the value of an #{id} or #{xml:id} attribute, if present. Otherwise, it uses
the static string #{index}.
-->
<xsl:param name="html.basename">
<xsl:choose>
<xsl:when test="/*/@xml:id">
<xsl:value-of select="/*/@xml:id"/>
</xsl:when>
<xsl:when test="/*/@id">
<xsl:value-of select="/*/@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>index</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!--@@==========================================================================
html.xhtml
Whether to output XHTML.
:Revision:version="1.0" date="2010-05-25" status="final"
If this parameter is set to true, this stylesheet will output XHTML. Otherwise,
the output is assumed to be HTML. Note that for HTML output, the importing
stylesheet still needs to call #{xsl:namespace-alias} to map the XHTML namespace
to #{#default}. The @{html.namespace} will be set automatically based on this
parameter. Stylesheets can use this parameter to check the output type, for
example when using #{xsl:element}.
-->
<xsl:param name="html.xhtml" select="true()"/>
<!--@@==========================================================================
html.namespace
The XML namespace for the output document.
:Revision:version="1.0" date="2010-05-25" status="final"
This parameter specifies the XML namespace of all output documents. It will be
set automatically based on the ${html.xhtml} parameter, either to the XHTML
namespace, or to the empty namespace. Stylesheets can use this parameter when
using #{xsl:element}.
-->
<xsl:param name="html.namespace">
<xsl:choose>
<xsl:when test="$html.xhtml">
<xsl:value-of select="'http://www.w3.org/1999/xhtml'"/>
</xsl:when>
<xsl:otherwise>
<xsl:text></xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!--@@==========================================================================
html.mathml.namespace
The XML namespace for the output document.
:Revision:version="3.8" date="2012-11-13" status="final"
This parameter specifies the XML namespace for MathML in output documents. It
will be set automatically based on the ${html.xhtml} parameter, either to the
MathML namespace namespace, or to the empty namespace. Stylesheets can use this
parameter when using #{xsl:element}.
-->
<xsl:variable name="html.mathml.namespace">
<xsl:choose>
<xsl:when test="$html.xhtml">
<xsl:value-of select="'http://www.w3.org/1998/Math/MathML'"/>
</xsl:when>
<xsl:otherwise>
<xsl:text></xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!--@@==========================================================================
html.extension
The filename extension for all output files.
:Revision:version="1.0" date="2010-05-25" status="final"
This parameter specifies a filename extension for all HTML output files. It
should include the leading dot. By default, #{.xhtml} will be used if
@{html.xhtml} is true; otherwise, #{.html} will be used.
-->
<xsl:param name="html.extension">
<xsl:choose>
<xsl:when test="$html.xhtml">
<xsl:text>.xhtml</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>.html</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!--@@==========================================================================
html.css.root
The URI root for external CSS files.
:Revision:version="1.0" date="2010-12-06" status="final"
This parameter provides a root URI for any external CSS files that are
referenced from the output HTML file. If non-empty, it must end with
a trailing slash character.
-->
<xsl:param name="html.css.root" select="''"/>
<!--@@==========================================================================
html.js.root
The URI root for external JavaScript files.
:Revision:version="1.0" date="2010-12-06" status="final"
This parameter provides a root URI for any external JavaScript files that are
referenced from the output HTML file. If non-empty, it must end with
a trailing slash character.
-->
<xsl:param name="html.js.root" select="''"/>
<!--@@==========================================================================
html.syntax.highlight
Whether to include syntax highlighting support for code blocks.
:Revision:version="1.0" date="2010-12-06" status="final"
This parameter specifies whether syntax highlighting should be enabled for
code blocks in the output HTML. Syntax highlighting is done at document load
time by JavaScript.
-->
<xsl:param name="html.syntax.highlight" select="true()"/>
<!--**==========================================================================
html.output
Create an HTML output file.
:Revision:version="1.0" date="2010-05-26" status="final"
$node: The node to create an output file for.
$href: The output filename.
This template creates an HTML output file for the source element ${node}. It
uses #{exsl:document} to output the file, and calls *{html.page} with the
${node} parameter to output the actual HTML contents.
If ${href} is not provided, this template will attempt to generate a base
filename and append @{html.extension} to it. The base filename is generated
as follows: If an #{xml:id} attribute is present, it is used; otherwise, if
an #{id} attribute is present, it is uses; otherwise, if ${node} is the root
element, @{html.basename} is used; otherwise, #{generate-id()} is called.
After calling #{exsl:document}, this template calls the %{html.output.after.mode}
mode on ${node}. Importing stylesheets that create multiple output files can
use this to process output files without blocking earlier output.
-->
<xsl:template name="html.output">
<xsl:param name="node" select="."/>
<xsl:param name="href">
<xsl:choose>
<xsl:when test="$node/@xml:id">
<xsl:value-of select="concat($node/@xml:id, $html.extension)"/>
</xsl:when>
<xsl:when test="$node/@id">
<xsl:value-of select="concat($node/@id, $html.extension)"/>
</xsl:when>
<xsl:when test="set:has-same-node($node, /*)">
<xsl:value-of select="concat($html.basename, $html.extension)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(generate-id(), $html.extension)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<exsl:document href="{$href}">
<xsl:call-template name="html.page">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</exsl:document>
<xsl:apply-templates mode="html.output.after.mode" select="$node"/>
</xsl:template>
<!--%%==========================================================================
html.output.after.mode
Process an element after its content are output.
:Revision:version="1.0" date="2010-05-26" status="final"
This mode is called by *{html.output} after #{exsl:document} has finished. It
can be used to create further output files without blocking the output of
parent elements.
-->
<xsl:template mode="html.output.after.mode" match="*"/>
<!--**==========================================================================
html.page
Create an HTML document.
:Revision:version="1.0" date="2010-05-26" status="final"
$node: The node to create HTML for.
This template creates the actual HTML output for ${node}. It outputs top-level
elements and container divs, and calls various templates and modes to output
the inner content. Importing stylesheets should implement at least
%{html.title.mode} and %{html.body.mode} for any elements that could be passed
as ${node} to this template.
-->
<xsl:template name="html.page">
<xsl:param name="node" select="."/>
<html>
<head>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=yes"/>
<title>
<xsl:apply-templates mode="html.title.mode" select="$node"/>
</title>
<xsl:call-template name="html.css">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="html.js">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="html.head.custom">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</head>
<body>
<xsl:call-template name="html.lang.attrs">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:apply-templates mode="html.body.attr.mode" select="$node"/>
<xsl:call-template name="html.top.custom">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<div class="page" role="main">
<div class="header">
<xsl:call-template name="html.header.custom">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:apply-templates mode="html.header.mode" select="$node"/>
</div>
<div class="body">
<xsl:apply-templates mode="html.body.mode" select="$node"/>
</div>
<div class="footer">
<xsl:apply-templates mode="html.footer.mode" select="$node"/>
<xsl:call-template name="html.footer.custom">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</div>
</div>
<xsl:call-template name="html.bottom.custom">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</body>
</html>
</xsl:template>
<!--%%==========================================================================
html.title.mode
Output the title of an element.
:Revision:version="1.0" date="2010-05-26" status="final"
This mode is called by *{html.page} to output the contents of the HTML #{title}
element inside the #{head} element. Importing stylesheets should implement this
mode for any element that will be passed to *{html.page}. Because this is used
in the #{head}, the output should be text-only.
-->
<xsl:template mode="html.title.mode" match="*"/>
<!--%%==========================================================================
html.body.attr.mode
Output attributes for the HTML #{body} element.
:Revision:version="1.0" date="2010-06-08" status="final"
This mode is called by *{html.page} to output attributes on the HTML #{body}
element. No attributes are output by default. Importing stylesheets may
implement this node to add attributes for styling, data, or other purposes.
-->
<xsl:template mode="html.body.attr.mode" match="*"/>
<!--**==========================================================================
html.top.custom
Stub to output HTML at the top of the page.
:Stub: true
:Revision: version="1.0" date="2011-11-01" status="final"
$node: The node a page is being created for.
This template is a stub, called by *{html.page}. It is called before the
#{div.page} wrapper div. Override this template to provide site-specific HTML
at the top of the page.
-->
<xsl:template name="html.top.custom">
<xsl:param name="node" select="."/>
</xsl:template>
<!--**==========================================================================
html.bottom.custom
Stub to output HTML at the bottom of the page.
:Stub: true
:Revision: version="1.0" date="2011-11-01" status="final"
$node: The node a page is being created for.
This template is a stub, called by *{html.page}. It is called after the
#{div.page} wrapper div. Override this template to provide site-specific HTML
at the bottom of the page.
-->
<xsl:template name="html.bottom.custom">
<xsl:param name="node" select="."/>
</xsl:template>
<!--**==========================================================================
html.header.custom
Stub to output custom header content.
:Stub: true
:Revision: version="1.0" date="2011-10-27" status="final"
$node: The node a page is being created for.
This template is a stub, called by *{html.page}. It is called inside the header
div, before %{html.header.mode} is applied to ${node}. You can override this
template to provide additional content at the top of the page.
-->
<xsl:template name="html.header.custom">
<xsl:param name="node" select="."/>
</xsl:template>
<!--%%==========================================================================
html.header.mode
Output the header content for an element.
:Revision:version="1.0" date="2010-05-26" status="final"
This mode is called by *{html.page} to output the contents of the header div
above the main content. Importing stylesheets may implement this mode for any
element that will be passed to *{html.page}. If they do not, the header div
will be empty.
-->
<xsl:template mode="html.header.mode" match="*"/>
<!--**==========================================================================
html.footer.custom
Stub to output custom footer content.
:Stub: true
:Revision: version="1.0" date="2011-10-27" status="final"
$node: The node a page is being created for.
This template is a stub, called by *{html.page}. It is called inside the footer
div, after %{html.footer.mode} is applied to ${node}. You can override this
template to provide additional content at the bottom of the page.
-->
<xsl:template name="html.footer.custom">
<xsl:param name="node" select="."/>
</xsl:template>
<!--%%==========================================================================
html.footer.mode
Output the footer content for an element.
:Revision:version="1.0" date="2010-05-26" status="final"
This mode is called by *{html.page} to output the contents of the footer div
below the main content. Importing stylesheets may implement this mode for any
element that will be passed to *{html.page}. If they do not, the footer div
will be empty.
-->
<xsl:template mode="html.footer.mode" match="*"/>
<!--%%==========================================================================
html.body.mode
Output the main contents for an element.
:Revision:version="1.0" date="2010-05-26" status="final"
This mode is called by *{html.page} to output the main contents of an HTML
page, below the header content and above the footer content. Titles, block
content, and sections should be output in this mode.
-->
<xsl:template mode="html.body.mode" match="*"/>
<!--**==========================================================================
html.head.custom
Stub to output custom content for the HTML #{head} element.
:Stub: true
:Revision: version="1.0" date="2010-05-25" status="final"
$node: The node a page is being created for.
This template is a stub, called by *{html.page}. You can override this template
to provide additional elements in the HTML #{head} element of output files.
-->
<xsl:template name="html.head.custom">
<xsl:param name="node" select="."/>
</xsl:template>
<!--**==========================================================================
html.class.attr
Output a #{class} attribute for an HTML element.
:Revision: version="3.10" date="2013-07-10" status="final"
$node: The source node for which an HTML element is being output.
$class: The value of the #{class} attribute provided by the calling template.
This template is called by templates that output an HTML element corresponding
to a source element. This template applies %{html.class.attr.mode} to ${node}
to gather a value from extensions stylesheets. It combines this value with the
value passed in the ${class} parameter and, if the result is non-empty, outputs
a #{class} attribute.
-->
<xsl:template name="html.class.attr">
<xsl:param name="node" select="."/>
<xsl:param name="class"/>
<xsl:variable name="fclass">
<xsl:value-of select="$class"/>
<xsl:text> </xsl:text>
<xsl:apply-templates mode="html.class.attr.mode" select="$node"/>
</xsl:variable>
<xsl:variable name="nclass" select="normalize-space($fclass)"/>
<xsl:if test="$nclass != ''">
<xsl:attribute name="class">
<xsl:value-of select="$nclass"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<!--%%==========================================================================
html.class.attr.mode
Output additional values for an HTML #{class} attribute.
:Revision:version="3.10" date="2013-07-10" status="final"
This mode is called by *{html.class.attr} on a source element. This mode is
intended for extensions to have an easy way to add additional HTML class values
for styling.
Note that these stylesheets use CSS classes extensively for styling and for
certain JavaScript functionality. Extensions should be careful to output class
values that do not conflict with those used in these stylesheets.
-->
<xsl:template mode="html.class.attr.mode" match="*"/>
<!--**==========================================================================
html.css
Output all CSS for an HTML output page.
:Revision:version="1.0" date="2010-12-23" status="final"
$node: The node to create CSS for.
$direction: The directionality of the text, either #{ltr} or #{rtl}.
$left: The starting alignment, either #{left} or #{right}.
$right: The ending alignment, either #{left} or #{right}.
This template creates the CSS for an HTML output page, including the enclosing
HTML #{style} element. It calls the templates *{html.css.content} to output the
actual CSS contents.
The ${direction} parameter specifies the directionality of the text for the
language of the document. The ${left} and ${right} parameters are based on
${direction}, and can be used to set beginning and ending margins or other
dimensions. All parameters can be automatically computed if not provided.
-->
<xsl:template name="html.css">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
<xsl:call-template name="l10n.direction"/>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:param name="right">
<xsl:call-template name="l10n.align.end">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<style type="text/css">
<xsl:call-template name="html.css.content">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="direction" select="$direction"/>
<xsl:with-param name="left" select="$left"/>
<xsl:with-param name="right" select="$right"/>
</xsl:call-template>
</style>
</xsl:template>
<!--**==========================================================================
html.css.content
Output actual CSS content for an HTML output page.
:Revision:version="1.0" date="2010-12-23" status="final"
$node: The node to create CSS for.
$direction: The directionality of the text, either #{ltr} or #{rtl}.
$left: The starting alignment, either #{left} or #{right}.
$right: The ending alignment, either #{left} or #{right}.
This template creates the CSS content for an HTML output page. It is called by
*{html.css}. It calls the templates *{html.css.core}, *{html.css.elements}, and
*{html.css.syntax}. It then calls the mode %{html.css.mode} on ${node} and
calls the template *{html.css.custom}.
-->
<xsl:template name="html.css.content">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
<xsl:call-template name="l10n.direction"/>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:param name="right">
<xsl:call-template name="l10n.align.end">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:call-template name="html.css.core">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="direction" select="$direction"/>
<xsl:with-param name="left" select="$left"/>
<xsl:with-param name="right" select="$right"/>
</xsl:call-template>
<xsl:call-template name="html.css.elements">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="direction" select="$direction"/>
<xsl:with-param name="left" select="$left"/>
<xsl:with-param name="right" select="$right"/>
</xsl:call-template>
<xsl:call-template name="html.css.syntax">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="direction" select="$direction"/>
<xsl:with-param name="left" select="$left"/>
<xsl:with-param name="right" select="$right"/>
</xsl:call-template>
<xsl:apply-templates mode="html.css.mode" select="$node">
<xsl:with-param name="direction" select="$direction"/>
<xsl:with-param name="left" select="$left"/>
<xsl:with-param name="right" select="$right"/>
</xsl:apply-templates>
<xsl:call-template name="html.css.custom">
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="direction" select="$direction"/>
<xsl:with-param name="left" select="$left"/>
<xsl:with-param name="right" select="$right"/>
</xsl:call-template>
</xsl:template>
<!--%%==========================================================================
html.css.mode
Output CSS specific to the input format.
:Revision:version="1.0" date="2010-05-26" status="final"
$direction: The directionality of the text, either #{ltr} or #{rtl}.
$left: The starting alignment, either #{left} or #{right}.
$right: The ending alignment, either #{left} or #{right}.
This template is called by *{html.css.content} to output CSS specific to the
input format. Importing stylesheets may implement this for any element that
will be passed to *{html.page}. If they do not, the output HTML will only have
the common CSS.
-->
<xsl:template mode="html.css.mode" match="*">
<xsl:param name="direction">
<xsl:call-template name="l10n.direction"/>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:param name="right">
<xsl:call-template name="l10n.align.end">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
</xsl:template>
<!--**==========================================================================
html.css.core
Output CSS that does not reference source elements.
:Revision: version="1.0" date="2010-05-25" status="final"
$node: The node to create CSS for.
$direction: The directionality of the text, either #{ltr} or #{rtl}.
$left: The starting alignment, either #{left} or #{right}.
$right: The ending alignment, either #{left} or #{right}.
This template outputs CSS that can be used in any HTML. It does not reference
elements from DocBook, Mallard, or other source languages. It provides the
common spacings for block-level elements lik paragraphs and lists, defines
styles for links, and defines four common wrapper divs: #{header}, #{side},
#{body}, and #{footer}.
All parameters can be automatically computed if not provided.
-->
<xsl:template name="html.css.core">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
<xsl:call-template name="l10n.direction"/>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:param name="right">
<xsl:call-template name="l10n.align.end">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:text>
html { height: 100%; }
body {
font-family: sans-serif;
margin: 0; padding: 0;
background-color: </xsl:text>
<xsl:value-of select="$color.background"/><xsl:text>;
color: </xsl:text>
<xsl:value-of select="$color.text"/><xsl:text>;
direction: </xsl:text><xsl:value-of select="$direction"/><xsl:text>;
}
div.page {
margin: 1em auto 1em auto;
max-width: 60em;
border: solid 1px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
}
div.body {
margin: 0;
padding-left: 1em;
padding-right: 1em;
padding-bottom: 1em;
min-height: 20em;
background-color: </xsl:text><xsl:value-of select="$color.background"/><xsl:text>;
}
div.header { margin: 0; }
div.footer { margin: 0; }
div.sect {
margin-top: 2.4em;
clear: both;
}
div.sect div.sect {
margin-top: 1.44em;
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em;
}
div.trails {
margin: 0;
padding: 0.5em 1em 0.5em 1em;
background-color: </xsl:text><xsl:value-of select="$color.gray_background"/><xsl:text>;
}
div.trail {
margin: 0.2em 0 0 0;
padding: 0 1em 0 1em;
text-indent: -1em;
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
a.trail { white-space: nowrap; }
div.hgroup {
margin: 1em 0 0.5em 0;
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
div.sect div.hgroup {
margin-top: 0;
border-bottom: solid 1px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
}
div.sect-links div.hgroup {
border-bottom: solid 2px </xsl:text>
<xsl:value-of select="$color.blue_border"/><xsl:text>;
}
div.sect div.sect-links {
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
}
div.sect div.sect-links div.hgroup {
border: none;
}
h1, h2, h3, h4, h5, h6, h7 {
margin: 0; padding: 0;
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
font-weight: bold;
}
h1 { font-size: 2em; }
h2 { font-size: 1.44em; }
h3.title, h4.title, h5.title, h6.title, h7.title { font-size: 1.2em; }
h3, h4, h5, h6, h7 { font-size: 1em; }
p { line-height: 1.72em; }
div, pre, p { margin: 1em 0 0 0; padding: 0; }
div.contents > *:first-child,
th > *:first-child, td > *:first-child,
dt > *:first-child, dd > *:first-child,
li > *:first-child { margin-top: 0; }
div.inner, div.region, div.contents, pre.contents { margin-top: 0; }
pre.contents div { margin-top: 0 !important; }
p img { vertical-align: middle; }
p.lead { font-size: 1.2em; }
div.clear {
margin: 0; padding: 0;
height: 0; line-height: 0;
clear: both;
}
.center { text-align: center; }
div.about {
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
div.about > div.inner > div.hgroup {
margin: 0; padding: 0;
text-align: center;
border: none;
}
div.about > div.inner > div.hgroup > h2 {
margin: 0; padding: 0.2em;
font-size: inherit;
}
div.about.ui-expander > div.inner > div.hgroup span.title:before {
content: "";
}
div.copyrights {
margin: 1em;
text-align: center;
}
div.copyright {
margin: 0;
}
div.aboutblurb {
display: inline-block;
vertical-align: top;
text-align: left;
max-width: 18em;
margin: 0 1em 1em 1em;
}
ul.credits, ul.credits li {
margin: 0; padding: 0;
list-style-type: none;
}
ul.credits li {
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1em;
text-indent: -1em;
}
table {
border-collapse: collapse;
border-color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
border-width: 1px;
}
td, th {
padding: 0.5em;
vertical-align: top;
border-color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
border-width: 1px;
}
thead td, thead th, tfoot td, tfoot th {
font-weight: bold;
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
background-color: </xsl:text><xsl:value-of select="$color.dark_background"/><xsl:text>;
}
th {
text-align: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
font-weight: bold;
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
ul, ol, dl { margin: 0; padding: 0; }
li {
margin: 1em 0 0 0;
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 2.4em;
padding: 0;
}
li:first-child { margin-top: 0; }
dt { margin-top: 1em; }
dt:first-child { margin-top: 0; }
dt + dt { margin-top: 0; }
dd {
margin: 0.2em 0 0 0;
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em;
}
dd + dd { margin-top: 1em; }
ol.compact li { margin-top: 0.2em; }
ul.compact li { margin-top: 0.2em; }
ol.compact li:first-child { margin-top: 0; }
ul.compact li:first-child { margin-top: 0; }
dl.compact dt { margin-top: 0.2em; }
dl.compact dt:first-child { margin-top: 0; }
dl.compact dt + dt { margin-top: 0; }
a {
text-decoration: none;
color: </xsl:text><xsl:value-of select="$color.link"/><xsl:text>;
}
a:visited { color: </xsl:text>
<xsl:value-of select="$color.link_visited"/><xsl:text>; }
a:hover {
border-bottom: dotted 1px </xsl:text>
<xsl:value-of select="$color.blue_border"/><xsl:text>;
}
p a {
border-bottom: dotted 1px </xsl:text>
<xsl:value-of select="$color.blue_border"/><xsl:text>;
}
a img { border: none; }
@media only screen and (max-width: 400px) {
div.page {
margin: 0;
border: none;
}
div.body {
padding-left: 0;
padding-right: 0;
}
div.body > div.hgroup,
div.body > div.region > div.contents > *,
div.body > div.region > div.sect > div.inner > div.hgroup > *,
div.body > div.region > div.sect > div.inner > div.region > div.contents > * {
margin-left: 12px;
margin-right: 12px;
}
div.body > div.region > div.sect-links {
margin-left: 0;
margin-right: 0;
}
div.trails {
padding: 12px;
}
li {
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em;
}
}
</xsl:text>
</xsl:template>
<!--**==========================================================================
html.css.elements
Output CSS for common elements from source formats.
:Revision: version="1.0" date="2010-05-25" status="final"
$node: The node to create CSS for.
$direction: The directionality of the text, either #{ltr} or #{rtl}.
$left: The starting alignment, either #{left} or #{right}.
$right: The ending alignment, either #{left} or #{right}.
This template outputs CSS for elements from source languages like DocBook and
Mallard. It defines them using common class names. The common names are often
the simpler element names from Mallard, although there some class names which
are not taken from Mallard. Stylesheets which convert to HTML should use the
appropriate common classes.
All parameters can be automatically computed if not provided.
-->
<xsl:template name="html.css.elements">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
<xsl:call-template name="l10n.direction"/>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:param name="right">
<xsl:call-template name="l10n.align.end">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:text>
div.title {
margin: 0 0 0.2em 0;
font-weight: bold;
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
div.title h1, div.title h2, div.title h3, div.title h4, div.title h5, div.title h6 {
margin: 0;
font-size: inherit;
font-weight: inherit;
color: inherit;
}
div.desc { margin: 0 0 0.2em 0; }
div.contents + div.desc { margin: 0.2em 0 0 0; }
pre.contents {
padding: 0.5em 1em 0.5em 1em;
}
div.links-center { text-align: center; }
div.links .desc { color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>; }
div.links > div.inner > div.region > div.desc { font-style: italic; }
div.links ul { margin: 0; padding: 0; }
div.links ul ul {
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1em;
}
li.links {
margin: 0.5em 0 0.5em 0;
padding: 0;
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1em;
list-style-type: none;
}
div.sectionlinks {
display: inline-block;
padding: 0 1em 0 1em;
background-color: </xsl:text>
<xsl:value-of select="$color.blue_background"/><xsl:text>;
border: solid 1px </xsl:text>
<xsl:value-of select="$color.blue_border"/><xsl:text>;
}
div.sectionlinks ul { margin: 0; }
div.sectionlinks li { padding: 0; }
div.sectionlinks div.title { margin: 0.5em 0 0.5em 0; }
div.sectionlinks div.sectionlinks {
display: block;
margin: 0.5em 0 0 0;
padding: 0;
border: none;
}
div.sectionlinks div.sectionlinks li {
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em;
}
div.nextlinks {
font-size: 1.2em;
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.2em;
float: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
clear: both;
}
div.nextlinks a {
background-color: </xsl:text><xsl:value-of select="$color.gray_background"/><xsl:text>;
display: inline-block;
position: relative;
height: 1.44em;
padding: 0.2em 0.83em;
margin-bottom: 1em;
}
a.nextlinks-prev { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0.72em; }
a.nextlinks-next { margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 0.72em; }
a.nextlinks-prev:after, a.nextlinks-next:after {
border: solid transparent;
content: " ";
position: absolute;
height: 0; width: 0;
border-width: 0.92em;
top: 50%;
margin-top: -0.92em;
}
a.nextlinks-prev:after {
</xsl:text><xsl:value-of select="$right"/><xsl:text>: 100%;
border-</xsl:text><xsl:value-of select="$right"/><xsl:text>-color: </xsl:text>
<xsl:value-of select="$color.gray_background"/><xsl:text>;
}
a.nextlinks-next:after {
</xsl:text><xsl:value-of select="$left"/><xsl:text>: 100%;
border-</xsl:text><xsl:value-of select="$left"/><xsl:text>-color: </xsl:text>
<xsl:value-of select="$color.gray_background"/><xsl:text>;
}
div.nextlinks a:hover {
border: none;
background: </xsl:text><xsl:value-of select="$color.blue_background"/><xsl:text>
}
a.nextlinks-prev:hover:after {
border-</xsl:text><xsl:value-of select="$right"/><xsl:text>-color: </xsl:text>
<xsl:value-of select="$color.blue_background"/><xsl:text>
}
a.nextlinks-next:hover:after {
border-</xsl:text><xsl:value-of select="$left"/><xsl:text>-color: </xsl:text>
<xsl:value-of select="$color.blue_background"/><xsl:text>
}
div.serieslinks {
display: inline-block;
padding: 0 1em 0 1em;
background-color: </xsl:text>
<xsl:value-of select="$color.blue_background"/><xsl:text>;
border: solid 1px </xsl:text>
<xsl:value-of select="$color.blue_border"/><xsl:text>;
}
div.serieslinks ul { margin: 0; }
div.serieslinks li { padding: 0; }
div.serieslinks div.title { margin: 0.5em 0 0.5em 0; }
pre.numbered {
margin: 0;
padding: 0.5em;
float: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 0.5em;
text-align: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
background-color: </xsl:text>
<xsl:value-of select="$color.yellow_background"/><xsl:text>;
}
div.code {
background: url('</xsl:text>
<xsl:value-of select="$icons.code"/><xsl:text>') no-repeat top </xsl:text>
<xsl:value-of select="$right"/><xsl:text>;
border: solid 1px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
}
div.example {
border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 4px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1em;
}
div.figure {
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em;
padding: 4px;
color: </xsl:text>
<xsl:value-of select="$color.text_light"/><xsl:text>;
border: solid 1px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
background-color: </xsl:text>
<xsl:value-of select="$color.gray_background"/><xsl:text>;
}
div.figure > div.inner > a.zoom {
float: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
}
div.figure > div.inner > div.region > div.contents {
margin: 0;
padding: 0.5em 1em 0.5em 1em;
clear: both;
text-align: center;
color: </xsl:text>
<xsl:value-of select="$color.text"/><xsl:text>;
border: solid 1px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
background-color: </xsl:text>
<xsl:value-of select="$color.background"/><xsl:text>;
}
div.list > div.inner > div.title { margin-bottom: 0.5em; }
div.listing > div.inner { margin: 0; padding: 0; }
div.listing > div.inner > div.region > div.desc { font-style: italic; }
div.note {
padding: 6px;
border: solid 1px </xsl:text>
<xsl:value-of select="$color.dark_background"/><xsl:text>;
background-color: </xsl:text>
<xsl:value-of select="$color.gray_background"/><xsl:text>;
}
div.note > div.inner > div.title {
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
<xsl:value-of select="$icons.size.note + 6"/><xsl:text>px;
}
div.note > div.inner > div.region > div.contents {
margin: 0; padding: 0;
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
<xsl:value-of select="$icons.size.note + 6"/><xsl:text>px;
}
div.note > div.inner {
margin: 0; padding: 0;
background-image: url("</xsl:text>
<xsl:value-of select="$icons.note"/><xsl:text>");
background-position: </xsl:text><xsl:value-of select="$left"/><xsl:text> top;
background-repeat: no-repeat;
min-height: </xsl:text><xsl:value-of select="$icons.size.note"/><xsl:text>px;
}
div.note-advanced > div.inner { <!-- background-image: url("</xsl:text>
<xsl:value-of select="$icons.note.advanced"/><xsl:text>"); --> }
div.note-bug > div.inner { background-image: url("</xsl:text>
<xsl:value-of select="$icons.note.bug"/><xsl:text>"); }
div.note-important > div.inner { background-image: url("</xsl:text>
<xsl:value-of select="$icons.note.important"/><xsl:text>"); }
div.note-tip > div.inner { background-image: url("</xsl:text>
<xsl:value-of select="$icons.note.tip"/><xsl:text>"); }
div.note-warning > div.inner { background-image: url("</xsl:text>
<xsl:value-of select="$icons.note.warning"/><xsl:text>"); }
div.note-sidebar {
float: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
max-width: 40%;
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 6px;
padding: 6px;
}
div.note-sidebar > div.inner { background-image: none; }
div.note-sidebar > div.inner > div.title { margin-</xsl:text>
<xsl:value-of select="$left"/><xsl:text>: 0px; }
div.note-sidebar > div.inner > div.region > div.contents { margin-</xsl:text>
<xsl:value-of select="$left"/><xsl:text>: 0px; }
div.note-plain > div.inner { background-image: none; }
div.note-plain > div.inner > div.title { margin-</xsl:text>
<xsl:value-of select="$left"/><xsl:text>: 0px; }
div.note-plain > div.inner > div.region > div.contents { margin-</xsl:text>
<xsl:value-of select="$left"/><xsl:text>: 0px; }
div.quote {
padding: 0;
min-height: </xsl:text>
<xsl:value-of select="$icons.size.quote"/><xsl:text>px;
}
div.quote > div.inner:before {
float: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
content: '</xsl:text>
<xsl:variable name="quote">
<xsl:for-each select="$node[1]">
<xsl:call-template name="l10n.gettext">
<xsl:with-param name="msgid" select="'quote.format'"/>
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="quotc" select="substring(concat($quote, '“'), 1, 1)"/>
<xsl:choose>
<xsl:when test="contains('«‹', $quotc)">
<xsl:text>«</xsl:text>
</xsl:when>
<xsl:when test="contains('»›', $quotc)">
<xsl:text>»</xsl:text>
</xsl:when>
<xsl:when test="contains('”„’‚', $quotc)">
<xsl:text>”</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>“</xsl:text>
</xsl:otherwise>
</xsl:choose><xsl:text>';
font-family: "Century Schoolbook L";
font-size: </xsl:text>
<xsl:value-of select="$icons.size.quote"/><xsl:text>px;
font-weight: bold;
line-height: </xsl:text>
<xsl:choose>
<xsl:when test="contains('«»‹›', $quotc)">
<xsl:text>0.5</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose><xsl:text>em;
margin: 0; padding: 0;
height: </xsl:text>
<xsl:value-of select="$icons.size.quote"/><xsl:text>px;
width: </xsl:text>
<xsl:value-of select="$icons.size.quote"/><xsl:text>px;
text-align: center;
color: </xsl:text>
<xsl:value-of select="$color.dark_background"/><xsl:text>;
}
div.quote > div.inner > div.title {
margin: 0;
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
<xsl:value-of select="$icons.size.quote"/><xsl:text>px;
}
blockquote {
margin: 0; padding: 0;
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
<xsl:value-of select="$icons.size.quote"/><xsl:text>px;
}
blockquote > *:first-child { margin-top: 0; }
div.quote > div.inner > div.region > div.cite {
margin-top: 0.5em;
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
<xsl:value-of select="$icons.size.quote"/><xsl:text>px;
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
div.quote > div.inner > div.region > div.cite::before {
<!-- FIXME: i18n -->
content: '― ';
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
div.screen {
background-color: </xsl:text>
<xsl:value-of select="$color.gray_background"/><xsl:text>;
border: solid 1px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
}
ol.steps, ul.steps {
margin: 0;
padding: 0.5em 1em 0.5em 1em;
border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 4px </xsl:text>
<xsl:value-of select="$color.yellow_border"/><xsl:text>;
-moz-box-shadow: 0 1px 2px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
-webkit-box-shadow: 0 1px 2px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
box-shadow: 0 1px 2px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
}
ol.steps .steps {
padding: 0;
border: none;
background-color: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
li.steps { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em; }
li.steps li.steps { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 2.4em; }
div.synopsis > div.inner > div.region > div.contents,
div.synopsis > div.contents, div.synopsis > pre.contents {
padding: 0.5em 1em 0.5em 1em;
border-top: solid 1px;
border-bottom: solid 1px;
border-color: </xsl:text>
<xsl:value-of select="$color.blue_border"/><xsl:text>;
background-color: </xsl:text>
<xsl:value-of select="$color.gray_background"/><xsl:text>;
}
div.synopsis > div.inner > div.region > div.desc { font-style: italic; }
div.synopsis div.code {
background: none;
border: none;
padding: 0;
}
div.synopsis div.code > pre.contents { margin: 0; padding: 0; }
div.table > div.desc { font-style: italic; }
tr.shade {
background-color: </xsl:text><xsl:value-of select="$color.gray_background"/><xsl:text>;
}
td.shade {
background-color: </xsl:text><xsl:value-of select="$color.gray_background"/><xsl:text>;
}
tr.shade td.shade {
background-color: </xsl:text><xsl:value-of select="$color.dark_background"/><xsl:text>;
}
span.app { font-style: italic; }
span.cmd {
font-family: monospace;
background-color: </xsl:text>
<xsl:value-of select="$color.gray_background"/><xsl:text>;
padding: 0 0.2em 0 0.2em;
}
span.cmd span.cmd { background-color: none; padding: 0; }
pre span.cmd { background-color: none; padding: 0; }
span.code {
font-family: monospace;
border-bottom: solid 1px </xsl:text><xsl:value-of select="$color.dark_background"/><xsl:text>;
}
span.code span.code { border: none; }
pre span.code { border: none; }
span.em { font-style: italic; }
span.em-bold {
font-style: normal; font-weight: bold;
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
pre span.error {
color: </xsl:text><xsl:value-of select="$color.text_error"/><xsl:text>;
}
span.file { font-family: monospace; }
span.gui, span.guiseq { color: </xsl:text>
<xsl:value-of select="$color.text_light"/><xsl:text>; }
span.input { font-family: monospace; }
pre span.input {
font-weight: bold;
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
kbd {
font-family: inherit;
font-size: inherit;
color: </xsl:text>
<xsl:value-of select="$color.text_light"/><xsl:text>;
background-color: </xsl:text>
<xsl:value-of select="$color.gray_background"/><xsl:text>;
border: solid 1px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
-moz-box-shadow: 1px 1px 2px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
-webkit-box-shadow: 1px 1px 2px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
box-shadow: 1px 1px 2px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
margin: 0 0.2em 0 0.2em;
padding: 0 0.5em 0 0.5em;
white-space: nowrap;
}
kbd.key-Fn {
font-weight: bold;
color: </xsl:text>
<xsl:value-of select="$color.blue_border"/><xsl:text>;
}
span.key a {
border-bottom: none;
}
a > kbd {
color: </xsl:text><xsl:value-of select="$color.link"/><xsl:text>;
border-color: </xsl:text><xsl:value-of select="$color.blue_border"/><xsl:text>;
}
span.keyseq {
color: </xsl:text>
<xsl:value-of select="$color.text_light"/><xsl:text>;
white-space: nowrap
}
span.output { font-family: monospace; }
pre span.output {
color: </xsl:text><xsl:value-of select="$color.text"/><xsl:text>;
}
pre span.prompt {
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
span.sys { font-family: monospace; }
span.var { font-style: italic; }
.ui-tile-img .media-controls { display: none; }
span.media-audio, span.media-video { display: inline-block; }
audio, video { display: block; margin: 0; }
div.media > div.inner { display: inline-block; text-align: center; }
div.media-controls {
min-width: 24em;
height: 24px;
margin: 0; padding: 0;
border-left: solid 1px </xsl:text><xsl:value-of select="$color.text"/><xsl:text>;;
border-right: solid 1px </xsl:text><xsl:value-of select="$color.text"/><xsl:text>;;
border-bottom: solid 1px </xsl:text><xsl:value-of select="$color.text"/><xsl:text>;;
background-color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
color: </xsl:text><xsl:value-of select="$color.background"/><xsl:text>;
-moz-border-bottom-left-radius: 4px;
-moz-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
div.media-controls-audio {
border-top: solid 1px </xsl:text><xsl:value-of select="$color.text"/><xsl:text>;;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
button.media-play {
height: 24px;
padding: 0 2px 0 2px; line-height: 0;
float: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
background-color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
border: none;
border-</xsl:text><xsl:value-of select="$right"/><xsl:text>: solid 1px </xsl:text>
<xsl:value-of select="$color.text"/><xsl:text>;;
}
button.media-play:hover, button.media-play:focus {
background-color: </xsl:text><xsl:value-of select="$color.blue_border"/><xsl:text>;
}
button.media-play canvas { margin: 0; }
div.media-range {
display: inline-block;
margin: 2px 8px 0 8px;
padding: 0;
height: 20px;
}
div.media-time {
float: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
margin: 0;
font-size: 16px;
height: 24px;
line-height: 24px;
}
div.media-time > span {
padding-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 8px;
}
span.media-duration {
font-size: 12px;
color: </xsl:text><xsl:value-of select="$color.dark_background"/><xsl:text>;
opacity: 0.8;
}
div.media-ttml { margin: 0; padding: 0; }
.media-ttml-pre { white-space: pre; }
.media-ttml-nopre { white-space: normal; }
div.media-ttml-div {
text-align: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
display: none;
margin: 0; padding: 0;
}
div.media-ttml-p {
text-align: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
display: none;
margin: 6px auto 0 auto;
padding: 6px;
max-width: 24em;
border: solid 1px </xsl:text>
<xsl:value-of select="$color.yellow_border"/><xsl:text>;
background-color: </xsl:text>
<xsl:value-of select="$color.yellow_background"/><xsl:text>;
-moz-box-shadow: 2px 2px 4px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
-webkit-box-shadow: 2px 2px 4px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
box-shadow: 2px 2px 4px </xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text>;
}
div.yelp-data { display: none; }
div.ui-expander > div.inner > div.title span.title,
div.ui-expander > div.inner > div.hgroup span.title {
cursor: default;
}
div.ui-expander > div.inner > div.title span.title:before,
div.ui-expander > div.inner > div.hgroup span.title:before {
font-size: 2em;
font-weight: normal;
content: "⌃";
display: inline-block;
line-height: 0.2em;
vertical-align: bottom;
color: </xsl:text><xsl:value-of select="$color.link"/><xsl:text>;
}
div.ui-expander-c > div.inner > div.hgroup { border-bottom: none; }
div.ui-expander-e > div.inner > div.title span.title:before,
div.ui-expander-e > div.inner > div.hgroup span.title:before {
content: "⌄";
vertical-align: top;
}
div.ui-expander > div.inner > div.title:hover,
div.ui-expander > div.inner > div.hgroup:hover * {
color: </xsl:text><xsl:value-of select="$color.link"/><xsl:text>;
}
div.ui-expander > div.inner > div.hgroup > .subtitle {
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 2em;
}
@media only screen and (max-width: 400px) {
div.links {
margin-left: 12px;
margin-right: 12px;
}
li.links { padding: 0; }
div.body > div.region > div.contents > div.example,
div.body > div.region > div.contents > div.steps,
div.body > div.region > div.contents > div.note,
div.body > div.region > div.sect > div.inner > div.region > div.contents > div.example,
div.body > div.region > div.sect > div.inner > div.region > div.contents > div.steps,
div.body > div.region > div.sect > div.inner > div.region > div.contents > div.note {
margin-left: 0;
margin-right: 0;
}
div.steps > div.inner > div.title {
margin-left: 18px;
margin-right: 18px;
}
ol.steps, ul.steps {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
div.note-sidebar {
float: none;
max-width: none;
margin-left: inherit;
margin-right: inherit;
padding-left: inherit;
padding-right: inherit;
}
div.note-sidebar > div.inner > div.title,
div.note-sidebar > div.inner > div.region > div.contents {
margin-left: 12px;
margin-right: 12px;
}
}
</xsl:text>
</xsl:template>
<!--**==========================================================================
html.css.syntax
Output CSS for syntax highlighting.
:Revision: version="1.0" date="2010-12-06" status="final"
$node: The node to create CSS for.
$direction: The directionality of the text, either #{ltr} or #{rtl}.
$left: The starting alignment, either #{left} or #{right}.
$right: The ending alignment, either #{left} or #{right}.
This template outputs CSS to support syntax highlighting of code blocks. Syntax
highlighting is done at document load time with JavaScript. Text in code blocks
is broken up into chunks and wrapped in HTML elements with particular classes.
This template outputs CSS to match those elements and style them with the
built-in themeable colors from !{color}.
All parameters can be automatically computed if not provided.
-->
<xsl:template name="html.css.syntax">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
<xsl:call-template name="l10n.direction"/>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:param name="right">
<xsl:call-template name="l10n.align.end">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:if test="$html.syntax.highlight">
<xsl:text>
pre.syntax span.function, pre.syntax span.keyword, pre.syntax span.tag {
color: </xsl:text><xsl:value-of select="$color.blue_border"/><xsl:text>;
}
pre.syntax span.string, pre.syntax span.operator {
color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
}
</xsl:text>
</xsl:if>
</xsl:template>
<!--**==========================================================================
html.css.custom
Stub to output custom CSS common to all HTML transformations.
:Stub: true
:Revision: version="1.0" date="2010-05-25" status="final"
$node: The node to create CSS for.
$direction: The directionality of the text, either #{ltr} or #{rtl}.
$left: The starting alignment, either #{left} or #{right}.
$right: The ending alignment, either #{left} or #{right}.
This template is a stub, called by *{html.css.content}. You can override this
template to provide additional CSS that will be used by all HTML output.
-->
<xsl:template name="html.css.custom">
<xsl:param name="node" select="."/>
<xsl:param name="direction">
<xsl:call-template name="l10n.direction"/>
</xsl:param>
<xsl:param name="left">
<xsl:call-template name="l10n.align.start">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
<xsl:param name="right">
<xsl:call-template name="l10n.align.end">
<xsl:with-param name="direction" select="$direction"/>
</xsl:call-template>
</xsl:param>
</xsl:template>
<!--**==========================================================================
html.js
Output all JavaScript for an HTML output page.
:Revision:version="1.0" date="2010-12-31" status="final"
$node: The node to create JavaScript for.
This template creates the JavaScript for an HTML output page. It calls the
template *{html.js.jquery} to output references to jQuery files. It then
calls *{html.js.custom} to output references to custom JavaScript files.
Finally, it outputs an HTML #{script} tag and calls *{html.js.content} to
ouput the contents of that tag.
-->
<xsl:template name="html.js">
<xsl:param name="node" select="."/>
<xsl:call-template name="html.js.jquery">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="html.js.mathjax">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="html.js.custom">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<script type="text/javascript">
<xsl:call-template name="html.js.content">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</script>
</xsl:template>
<!--**==========================================================================
html.js.jquery
Output references to jQuery JavaScript files.
:Revision: version="1.0" date="2010-12-31" status="final"
$node: The node to create JavaScript for.
This template outputs HTML #{script} tags to reference any necessary jQuery files.
It always includes a reference to #{jquery.js}. If @{html.syntax.highlight} is
#{true}, it will also include a reference to #{jquery.syntax.js} along with an
additional #{script} tag to initialize syntax highlighting. All references are
output relative to @{html.js.root}.
-->
<xsl:template name="html.js.jquery">
<xsl:param name="node" select="."/>
<script type="text/javascript">
<xsl:attribute name="src">
<xsl:value-of select="$html.js.root"/>
<xsl:text>jquery.js</xsl:text>
</xsl:attribute>
</script>
<xsl:if test="$html.syntax.highlight">
<script type="text/javascript">
<xsl:attribute name="src">
<xsl:value-of select="$html.js.root"/>
<xsl:text>jquery.syntax.js</xsl:text>
</xsl:attribute>
</script>
</xsl:if>
</xsl:template>
<!--**==========================================================================
html.js.mathjax
Output #{script} element to include MathJax.
:Revision: version="1.0" date="2012-11-13" status="final"
$node: The node to create JavaScript for.
This template outputs an HTML #{script} tag to reference MathJax. It only
outputs a #{script} element if ${node} has MathML descendent content. By
default, this template uses #{cnd.mathjax.org}. If you wish to use a local
copy, override this template and provide the necessary files.
-->
<xsl:template name="html.js.mathjax">
<xsl:param name="node" select="."/>
<xsl:if test="$node//mml:*[1]">
<script type="text/javascript">
<xsl:attribute name="src">
<xsl:text>http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=MML_HTMLorMML</xsl:text>
</xsl:attribute>
</script>
</xsl:if>
</xsl:template>
<!--**==========================================================================
html.js.content
Output JavaScript content for an HTML output page.
:Revision:version="3.4" date="2011-11-04" status="final"
$node: The node to create JavaScript for.
This template is called by *{html.js} to output JavaScript content. It does not
output an HTML #{script} tag. The JavaScript output by this template or templates
it calls may depend on the jQuery code referenced by *{html.js.jquery}. This
template calls the templates *{html.js.core}, *{html.js.ui}, *{html.js.media},
and *{html.js.syntax}. It then calls the mode
%{html.js.mode} on ${node} and calls the template *{html.js.content.custom}.
-->
<xsl:template name="html.js.content">
<xsl:param name="node" select="."/>
<xsl:call-template name="html.js.core">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="html.js.ui">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="html.js.media">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:call-template name="html.js.syntax">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
<xsl:apply-templates mode="html.js.mode" select="$node"/>
<xsl:call-template name="html.js.content.custom">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
</xsl:template>
<!--**==========================================================================
html.js.core
Output JavaScript for core features.
:Revision: version="3.4" date="2011-11-04" status="final"
$node: The node to create JavaScript for.
This template outputs JavaScript to support basic features used by all documents.
Currently, it outputs code to highlight a section when #{location.hash} is set.
-->
<xsl:template name="html.js.core">
<xsl:param name="node" select="."/>
<xsl:text>
var __yelp_generate_id_counter__ = 0;
function yelp_generate_id () {
var ret = 'yelp--' + (++__yelp_generate_id_counter__).toString();
if ($('#' + ret).length != 0)
return yelp_generate_id();
else
return ret;
};
$(document).ready (function () {
var highlight_hash = function () {
if (location.hash != '') {
var sect = $(location.hash);
sect.css('background-color', '</xsl:text><xsl:value-of select="$color.yellow_background"/><xsl:text>');
window.setTimeout(function () {
sect.css({
'-webkit-transition': 'background-color 2s linear',
'-moz-transition': 'background-color 2s linear',
'transition': 'background-color 2s linear',
'background-color': 'rgba(1, 1, 1, 0)'
});
}, 200);
}
};
$(window).bind('hashchange', highlight_hash);
highlight_hash();
});
</xsl:text>
</xsl:template>
<!--**==========================================================================
html.js.ui
Output JavaScript for UI extensions.
:Revision: version="1.0" date="2011-06-17" status="final"
$node: The node to create JavaScript for.
This template outputs JavaScript that implements certain common UI extensions,
such as expandable blocks and sections.
-->
<xsl:template name="html.js.ui">
<xsl:param name="node" select="."/>
<xsl:text><![CDATA[
$.fn.yelp_ui_expander_toggle = function (onlyopen, callback) {
var expander = $(this);
var region = expander.children('.inner').children('.region');
var yelpdata = expander.children('div.yelp-data-ui-expander');
var compfunc = function () {
if (expander.is('div.figure')) { expander.yelp_auto_resize(); }
if (callback) { callback(); }
return true;
};
var title = expander.children('.inner').children('.title');
if (title.length == 0)
title = expander.children('.inner').children('.hgroup');
var title = title.find('span.title:first');
if (expander.is('.ui-expander-e')) {
if (!onlyopen) {
expander.removeClass('ui-expander-e').addClass('ui-expander-c');
region.attr('aria-expanded', 'false').slideUp('fast', compfunc);
title.html(yelpdata.children('div.yelp-title-collapsed').html());
}
}
else {
expander.removeClass('ui-expander-c').addClass('ui-expander-e');
region.attr('aria-expanded', 'true').slideDown('fast', compfunc);
title.html(yelpdata.children('div.yelp-title-expanded').html());
}
};
$(document).ready(function () {
$('.ui-expander').each(function () {
var expander = $(this);
var yelpdata = expander.children('div.yelp-data-ui-expander');
var region = expander.children('.inner').children('.region');
var title = expander.children('.inner').children('.title');
var issect = false;
if (title.length == 0) {
title = expander.children('.inner').children('.hgroup');
issect = true;
}
if (title.length == 0) {
return;
}
if (region.attr('id') == '')
region.attr('id', yelp_generate_id());
title.attr('role', 'button').attr('aria-controls', region.attr('id'));
var titlespan = title.find('span.title:first');
var title_e = yelpdata.children('div.yelp-title-expanded');
var title_c = yelpdata.children('div.yelp-title-collapsed');
if (title_e.length == 0)
yelpdata.append($('<div class="yelp-title-expanded"></div>').html(titlespan.html()));
if (title_c.length == 0)
yelpdata.append($('<div class="yelp-title-collapsed"></div>').html(titlespan.html()));
if (yelpdata.attr('data-yelp-expanded') == 'false') {
expander.addClass('ui-expander-c');
region.attr('aria-expanded', 'false').hide();
if (title_c.length != 0)
titlespan.html(title_c.html());
} else {
expander.addClass('ui-expander-e');
region.attr('aria-expanded', 'true');
if (title_e.length != 0)
titlespan.html(title_e.html());
}
title.click(function () {
expander.yelp_ui_expander_toggle(false);
});
});
});
$(document).ready(function () {
var expand_hash = function () {
if (location.hash != '') {
var target = $(location.hash);
var parents = target.parents('div.ui-expander');
if (target.is('div.ui-expander'))
parents = parents.andSelf();
parents.each(function () {
$(this).yelp_ui_expander_toggle(true, function () {
window.scrollTo(0, $(target).offset().top);
});
});
}
};
$(window).bind('hashchange', expand_hash);
expand_hash();
});
]]></xsl:text>
</xsl:template>
<!--**==========================================================================
html.js.media
Output JavaScript to control media elements.
:Revision: version="1.0" date="2010-01-01" status="final"
$node: The node to create JavaScript for.
This template outputs JavaScript that controls media elements. It provides
control for audio and video elements as well as support for captions.
-->
<xsl:template name="html.js.media">
<xsl:param name="node" select="."/>
<xsl:text><![CDATA[
yelp_color_text_light = ']]></xsl:text>
<xsl:value-of select="$color.text_light"/><xsl:text><![CDATA[';
yelp_color_gray_background = ']]></xsl:text>
<xsl:value-of select="$color.gray_background"/><xsl:text><![CDATA[';
yelp_color_gray_border = ']]></xsl:text>
<xsl:value-of select="$color.gray_border"/><xsl:text><![CDATA[';
yelp_paint_zoom = function (zoom, zoomed) {
var ctxt = zoom.children('canvas')[0].getContext('2d');
ctxt.strokeStyle = ctxt.fillStyle = yelp_color_text_light;
ctxt.clearRect(0, 0, 10, 10);
ctxt.strokeRect(0.5, 0.5, 9, 9);
if (zoomed) {
ctxt.fillRect(1, 1, 9, 4);
ctxt.fillRect(5, 5, 4, 4);
zoom.attr('title', zoom.attr('data-zoom-out-title'));
}
else {
ctxt.fillRect(1, 5, 4, 4);
zoom.attr('title', zoom.attr('data-zoom-in-title'));
}
}
$.fn.yelp_auto_resize = function () {
var fig = $(this);
if (fig.is('img'))
fig = fig.parents('div.figure').eq(0);
if (fig.data('yelp-zoom-timeout') != undefined) {
clearInterval(fig.data('yelp-zoom-timeout'));
fig.removeData('yelp-zoom-timeout');
}
var imgs = fig.find('img');
for (var i = 0; i < imgs.length; i++) {
var img = $(imgs[i]);
if (img.data('yelp-load-bound') == true)
img.unbind('load', fig.yelp_auto_resize);
if (!imgs[i].complete) {
img.data('yelp-load-bound', true);
img.bind('load', fig.yelp_auto_resize);
return false;
}
}
$(window).unbind('resize', yelp_resize_imgs);
var zoom = fig.children('div.inner').children('a.zoom');
if (fig.find('div.contents:first').is(':hidden')) {
zoom.hide();
return;
}
for (var i = 0; i < imgs.length; i++) {
var img = $(imgs[i]);
if (img.data('yelp-original-width') == undefined) {
var iwidth = parseInt(img.attr('width'));
if (!iwidth)
iwidth = img[0].width;
img.data('yelp-original-width', iwidth);
var iheight = parseInt(img.attr('height'));
if (!iheight)
iheight = img[0].height * (iwidth / img[0].width);
img.data('yelp-original-height', iheight);
}
if (img.data('yelp-original-width') > img.parent().width()) {
if (img.data('yelp-zoomed') != true) {
img[0].width = img.parent().width();
img[0].height = (parseInt(img.data('yelp-original-height')) *
img.width() / parseInt(img.data('yelp-original-width')));
}
zoom.show();
}
else {
img[0].width = img.data('yelp-original-width');
img[0].height = img.data('yelp-original-height');
zoom.hide();
}
}
/* The image scaling above can cause the window to resize if it causes
* scrollbars to disappear or reapper. Unbind the resize handler before
* scaling the image. Don't rebind immediately, because we'll still get
* that resize event in an idle. Rebind on the callback instead.
*/
var reresize = function () {
$(window).unbind('resize', reresize);
$(window).bind('resize', yelp_resize_imgs);
}
$(window).bind('resize', reresize);
return false;
};
yelp_resize_imgs = function () {
$('div.figure img').parents('div.figure').each(function () {
var div = $(this);
if (div.data('yelp-zoom-timeout') == undefined)
div.data('yelp-zoom-timeout', setTimeout(function () { div.yelp_auto_resize() }, 1));
});
return false;
};
$(document).ready(function () {
$('div.figure img').parents('div.figure').each(function () {
var fig = $(this);
var zoom = fig.children('div.inner').children('a.zoom');
zoom.append($('<canvas width="10" height="10"/>'));
yelp_paint_zoom(zoom, false);
zoom.data('yelp-zoomed', false);
zoom.click(function () {
var zoomed = !zoom.data('yelp-zoomed');
zoom.data('yelp-zoomed', zoomed);
zoom.parent().find('img').each(function () {
var zimg = $(this);
zimg.data('yelp-zoomed', zoomed);
if (zoomed) {
zimg[0].width = zimg.data('yelp-original-width');
zimg[0].height = zimg.data('yelp-original-height');
} else {
zimg[0].width = zimg.parent().width();
zimg[0].height = (parseInt(zimg.data('yelp-original-height')) *
zimg.width() / parseInt(zimg.data('yelp-original-width')));
}
yelp_paint_zoom(zoom, zoomed);
});
return false;
});
});
yelp_resize_imgs();
$(window).bind('resize', yelp_resize_imgs);
});
function yelp_init_video (element) {
var video = $(element);
video.removeAttr('controls');
var controls = $('<div class="media-controls media-controls-' + element.nodeName + '"></div>');
var playControl = $('<button class="media-play"></button>').attr({
'data-play-label': video.attr('data-play-label'),
'data-pause-label': video.attr('data-pause-label'),
'value': video.attr('data-play-label')
});
var playCanvas = $('<canvas width="20" height="20"></canvas>');
playControl.append(playCanvas);
var rangeCanvas = $('<canvas width="104" height="20"></canvas>');
var rangeCanvasCtxt = rangeCanvas[0].getContext('2d');
rangeCanvasCtxt.strokeStyle = yelp_color_gray_border;
rangeCanvasCtxt.strokeWidth = 1;
rangeCanvasCtxt.strokeRect(0.5, 0.5, 103, 19);
var currentSpan = $('<span class="media-current">0:00</span>');
var durationSpan = $('<span class="media-duration">-:--</span>');
controls.append(playControl,
$('<div class="media-range"></div>').append(rangeCanvas),
$('<div class="media-time"></div>').append(currentSpan, durationSpan));
video.after(controls);
var playCanvasCtxt = playCanvas[0].getContext('2d');
var paintPlayButton = function () {
playCanvasCtxt.fillStyle = yelp_color_gray_background;
playCanvasCtxt.clearRect(0, 0, 20, 20);
playCanvasCtxt.beginPath();
playCanvasCtxt.moveTo(5, 5); playCanvasCtxt.lineTo(5, 15);
playCanvasCtxt.lineTo(15, 10); playCanvasCtxt.lineTo(5, 5);
playCanvasCtxt.fill();
}
var paintPauseButton = function () {
playCanvasCtxt.fillStyle = yelp_color_gray_background;
playCanvasCtxt.clearRect(0, 0, 20, 20);
playCanvasCtxt.beginPath();
playCanvasCtxt.moveTo(5, 5); playCanvasCtxt.lineTo(9, 5);
playCanvasCtxt.lineTo(9, 15); playCanvasCtxt.lineTo(5, 15);
playCanvasCtxt.lineTo(5, 5); playCanvasCtxt.fill();
playCanvasCtxt.beginPath();
playCanvasCtxt.moveTo(11, 5); playCanvasCtxt.lineTo(15, 5);
playCanvasCtxt.lineTo(15, 15); playCanvasCtxt.lineTo(11, 15);
playCanvasCtxt.lineTo(11, 5); playCanvasCtxt.fill();
}
paintPlayButton();
var video_el = video[0];
var mediaChange = function () {
if (video_el.ended)
video_el.pause()
if (video_el.paused) {
playControl.attr('value', playControl.attr('data-play-label'));
paintPlayButton();
}
else {
playControl.attr('value', playControl.attr('data-pause-label'));
paintPauseButton();
}
}
video_el.addEventListener('play', mediaChange, false);
video_el.addEventListener('pause', mediaChange, false);
video_el.addEventListener('ended', mediaChange, false);
var playClick = function () {
if (video_el.paused || video_el.ended)
video_el.play();
else
video_el.pause();
};
playControl.click(playClick);
var ttmlDiv = video.parent().children('div.media-ttml');
var ttmlNodes = ttmlDiv.find('.media-ttml-node');
var timeUpdate = function () {
var pct = (element.currentTime / element.duration) * 100;
rangeCanvasCtxt.fillStyle = yelp_color_gray_border;
rangeCanvasCtxt.clearRect(2, 2, 100, 16);
rangeCanvasCtxt.fillRect(2, 2, pct, 16);
var mins = parseInt(element.currentTime / 60);
var secs = parseInt(element.currentTime - (60 * mins))
currentSpan.text(mins + (secs < 10 ? ':0' : ':') + secs);
ttmlNodes.each(function () {
var ttml = this;
if (element.currentTime >= parseFloat(ttml.getAttribute('data-ttml-begin')) &&
(!ttml.hasAttribute('data-ttml-end') ||
element.currentTime < parseFloat(ttml.getAttribute('data-ttml-end')) )) {
if (ttml.tagName == 'span')
ttml.style.display = 'inline';
else
ttml.style.display = 'block';
}
else {
ttml.style.display = 'none';
}
});
};
element.addEventListener('timeupdate', timeUpdate, false);
var durationUpdate = function () {
if (!isNaN(element.duration)) {
mins = parseInt(element.duration / 60);
secs = parseInt(element.duration - (60 * mins));
durationSpan.text(mins + (secs < 10 ? ':0' : ':') + secs);
}
};
element.addEventListener('durationchange', durationUpdate, false);
rangeCanvas.click(function (event) {
var pct = event.clientX - Math.floor(rangeCanvas.offset().left);
if (pct < 0)
pct = 0;
if (pct > 100)
pct = 100;
element.currentTime = (pct / 100.0) * element.duration;
});
};
$(document).ready(function () {
$('video, audio').each(function () { yelp_init_video(this) });;
});
]]></xsl:text>
</xsl:template>
<!--**==========================================================================
html.js.syntax
Output JavaScript for syntax highlighting
:Revision: version="1.0" date="2011-04-16" status="final"
$node: The node to create JavaScript for.
This template outputs JavaScript that does syntax highlighting. JavaScript
@{html.syntax.highlight} is #{true}. Note that this content just initializes
the syntax highlighting. The real work is done by #{jquery.syntax.js}, which
is included by *{html.js.syntax}.
-->
<xsl:template name="html.js.syntax">
<xsl:param name="node" select="."/>
<xsl:if test="$html.syntax.highlight">
<xsl:text><![CDATA[
$(document).ready( function () { jQuery.syntax({root: ']]></xsl:text>
<xsl:value-of select="$html.js.root"/><xsl:text><![CDATA[', blockLayout: 'yelp',
theme: false, linkify: false}); });
]]></xsl:text>
</xsl:if>
</xsl:template>
<!--%%==========================================================================
html.js.mode
Output JavaScript specific to the input format.
:Revision:version="1.0" date="2010-01-01" status="final"
This template is called by *{html.js.content} to output JavaScript specific to
the input format. Importing stylesheets may implement this for any element that
will be passed to *{html.page}. If they do not, the output HTML will only have
the common JavaScript.
-->
<xsl:template mode="html.js.mode" match="*">
</xsl:template>
<!--**==========================================================================
html.js.custom
Stub to reference custom JavaScript common to all HTML transformations.
:Stub: true
:Revision: version="1.0" date="2010-04-16" status="final"
$node: The node to create JavaScript for.
This template is a stub, called by *{html.js}. You can override this template
to reference additional external JavaScript files. If you want to include
JavaScript into the main #{script} tag instead, use *{html.js.content.custom}.
-->
<xsl:template name="html.js.custom">
<xsl:param name="node" select="."/>
</xsl:template>
<!--**==========================================================================
html.js.content.custom
Stub to output custom JavaScript common to all HTML transformations.
:Stub: true
:Revision: version="1.0" date="2010-04-16" status="final"
$node: The node to create JavaScript for.
This template is a stub, called by *{html.js.content}. You can override this
template to provide additional JavaScript that will be used by all HTML output.
This template is called inside a #{script} tag, and is intended to include
JavaScript code in the output page. See *{html.js.custom} to include a custom
reference to an external JavaScript file.
-->
<xsl:template name="html.js.content.custom">
<xsl:param name="node" select="."/>
</xsl:template>
<!--**==========================================================================
html.lang.attrs
Output #{lang} and #{dir} attributes.
:Revision: version="1.0" date="2010-06-10" status="final"
$node: The current element in the input document.
$parent: A parent node to take ${lang} and ${dir} from.
$lang: The language for ${node}.
$dir: The text directionality for ${node}.
This template outputs #{lang}, #{xml:lang}, or #{dir} attributes if necessary.
If ${lang} is not set, it will be taken from the #{xml:lang} or #{lang}
attribute of ${node}. If ${dir} is not set, it will be taken from the #{its:dir}
attribute of ${node} or computed based on ${lang}.
The ${parent} parameter defaults to an empty node set. If it is set to a
non-empty node set, this template will attempt to get ${lang} and ${dir} from
${parent} if they are not set on ${node}. This is occasionally useful when a
wrapper element in a source language doesn't directly create any output
elements.
This template outputs either an #{xml:lang} or a #{lang} attribute, depending
on whether @{html.xhtml} is #{true}. It only outputs an #{xml:lang} or #{lang}
attribute if $lang is non-empty. This template also outputs a #{dir} attribute
if ${dir} is non-empty.
-->
<xsl:template name="html.lang.attrs">
<xsl:param name="node" select="."/>
<xsl:param name="parent" select="/false"/>
<xsl:param name="lang">
<xsl:choose>
<xsl:when test="$node/@xml:lang">
<xsl:value-of select="$node/@xml:lang"/>
</xsl:when>
<xsl:when test="$node/@lang">
<xsl:value-of select="$node/@lang"/>
</xsl:when>
<xsl:when test="$parent/@xml:lang">
<xsl:value-of select="$parent/@xml:lang"/>
</xsl:when>
<xsl:when test="$parent/@lang">
<xsl:value-of select="$parent/@lang"/>
</xsl:when>
</xsl:choose>
</xsl:param>
<xsl:param name="dir">
<xsl:choose>
<xsl:when test="$node/@its:dir">
<xsl:value-of select="$node/@its:dir"/>
</xsl:when>
<xsl:when test="($node/@xml:lang or $node/@lang) and (string($lang) != '')">
<xsl:call-template name="l10n.direction">
<xsl:with-param name="lang" select="$lang"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$parent/@its:dir">
<xsl:value-of select="$node/@its:dir"/>
</xsl:when>
<xsl:when test="string($lang) != ''">
<xsl:call-template name="l10n.direction">
<xsl:with-param name="lang" select="$lang"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:param>
<xsl:if test="string($lang) != ''">
<xsl:choose>
<xsl:when test="$html.xhtml">
<xsl:attribute name="xml:lang">
<xsl:value-of select="$lang"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="lang">
<xsl:value-of select="$lang"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="string($dir) != ''">
<xsl:attribute name="dir">
<xsl:value-of select="$dir"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
|