.TH triangle2html 1 "13 March 2019" "triangle2html" "IOCCC 2019" .SH NAME triangle2html \- Generate customisable Pascal triangles in HTML .SH SYNOPSIS \fBtriangle2html\fP [stylesheet] [script] [title] .SH DESCRIPTION \fBtriangle2html\fP .PP This program generates a Pascal's triangle with the rows specified (5 if empty string) to the output file (stdout if empty string) with the optional stylesheet, script and title of the page. The program always refers to the \fIbase.css\fP file but styles can be overridden by the optional stylesheet. Similarly the program always refers to the jQuery file \fIj.js\fP and the jQuery UI CSS file \fIj.css\fP but these can be changed to be another library: the point is the generated HTML page will refer to those files. .PP The included jQuery version is 3.3.1; the jQuery UI CSS is 1.12.1. The file \fIj-ui.js\fP is jQuery catted together with jQuery UI in one file. If this is desired one need only move it over to the \fIj.js\fP file or alternatively make the latter a symlink to whichever file you want. .SH FILES \fIbase.css\fP .RS The base stylesheet for the generated HTML files. This file should be in the same directory as the HTML file but a symlink should work too (depending on set up). .RE \fIpyramid.html\fP .RS A generated 20 row Pascal triangle that is meant to be something akin to the Egyptian pyramids (that were white when first created reportedly). .RE \fIpyramid.css\fP .RS The stylesheet for the \fIpyramid.html\fP file. .RE \fIpyramid-jquery.html\fP .RS The same as the previous HTML file except that it references the \fIpyramid.js\fP file to demonstrate jQuery a little bit. .RE \fIsierpinski.html\fP .RS If you colour the even numbers and the odd numbers in a Pascal triangle different colours you get the fractal known as Sierpinski triangle (sometimes called 'gasket' instead). This only works if the number of rows is a power of 2; in this case it's 16 rows. .RE \fIrandom-colours.js\fP, \fIrandom-colours.html\fP .RS Demonstrates pseudo-randomly colouring every cell in the triangle. .RE \fIj.js\fP, \fIj-ui.js\fP,\fIj.css\fP .RS The jQuery library, the jQuery + jQuery UI library and the jQuery UI stylesheet. .RE \fItriangle.html\fP .RS A basic 20 row Pascal triangle with the default stylesheet. .RE .SH BUGS .PP Due to the nature of the IOCCC it's hard to read and customise the source code itself; modifying the output is much easier. .PP The file names \fIbase.css\fP, \fIj.js\fP and \fIj.css\fP are hard coded. This is also due to the nature of the IOCCC. It might have been an idea to allow specifying a path to override the default but that would overcomplicate matters and it's not necessary: there is no requirement you keep the files I have included the same nor have them there at all; the output won't look the same but I know of no web browser that won't output at least something even if there are errors or missing files. .SH EXAMPLES .RS \fB triangle2html 20 pyramid.html pyramid.css\fP .RE .PP Generates the 20 row \fIpyramid.html\fP file with the \fIpyramid.css\fP stylesheet. .RS \fB triangle2html 16 sierpinski.html sierpinski.css\fP .RE .PP Generates a 16 row Pascal triangle with a Sierpinski triangle over it. .SH SEE ALSO .PP <\fBhttp://jwilson.coe.uga.edu/EMAT6680Su12/Berryman/6690/BerrymanK-Pascals/BerrymanK-Pascals.html\fP> .PP <\fBhttps://en.wikipedia.org/wiki/Sierpinski_triangle\fP> .PP <\fBhttps://en.wikipedia.org/wiki/Pascal%27s_triangle\fP> .PP <\fBhttps://medium.com/i-math/top-10-secrets-of-pascals-triangle-6012ba9c5e23\fI>