USAGE NOTES
static site checker
https://ssc.lu/
(c) 2020 Dylan Harris


running ssc
-----------
To run ssc, install curl (if necessary), bring up the command line, change to the install directory,
and then try:

    Windows: ssc
    Unix: ./ssc

If it is installed correctly, it should respond with (c) info and a simple usage message.

It is possible to set up configuration files, but to start with lets try a simple set of command line
options. It the HTML files belonging to your website is located in DIR, and the main index file is
called index.html, then all you need type is:

ssc DIR

and off it will go, reporting on any issues it finds in all HTML files in DIR and its descendants.


switches
--------
SSC has a number of switches:

-h	Output simple help
-V	Output the version of SSC
-f file	Load a runtime configuration from file
-F	Load a runtime configuration from ~/.ssc/config

-o file Output report to file

-v x	Report level x issues, where x is
	0 None
	1 Catastrophes
	2 Errors
	3 Warnings
	4 Info
	5 Comments
	6 Debug
	7... more and more debug

-I	Process (simple) Server Side Includes
-g dir  set website root directory (defaults to current directory)
-x xxx  treat files with extension xxx as HTML/XHTML (may be repeated)
-i file file is index file in directories (default index.html)
-s dom  dom is the local site’s domain name (may be repeated)
-L arg  Define virtual directory (arg is formatted ‘virtual=physical’) (may be repeated)

-e	Check external links (each link is checked once per run, not once per encounter)
-3	Report HTTP 301 and 308 as errors (e.g. forwarding)
-l	Check internal links
-O	Report each broken link only once, not each time it occurs
-r	Do not check whether https certificates have been revoked
-X	Check crosslinked IDs (e.g. id attribute)

-M	Check microformats.org set using class attribute
-m	Check schema.org data set using WhatWG microdata attributes

-S	Report site statistics

SSC will accept configuration files, making it easy to set up checks that you wish to run from time to time.
They’re in INI format. I’ll going to illustrate more features of the product using example configuration
files, mostly adapted from the tests.


A simple configuration file
---------------------------
[general]
verbose=4
output=ssc.out
class=yes

[site]
domain=example.edu
extension=html
index=index.html
root=~/www/htdocs

The website is for example.edu, which can be found in ~/www.htdocs. Standard index files are called
index.html, and html files always have the html extension.

The configuration outputs errors, warnings and info messages to ssc.out. It also requires analysis of class
identifiers, which means SSC will scan any CSS files it encounters for class names.


Links and virtual directories
-----------------------------
[general]
verbose=4
output=ssc.out

[site]
domain=example.edu
extension=html
index=index.html
root=~/www/htdocs
virtual=/net=tests/virtual

[link]
check=yes
external=yes
xlink=yes

Beyond the previous example, check links, external links, and crosslinked ids.

The configuration file specifies a virtual directory. When a link refers to the directory /net, search for
the corresponding files in tests/virtual (relative to the current directory, not the root).


Microformats
------------
[general]
verbose=4
output=ssc.out
class=yes

[site]
domain=example.edu
extension=html
index=index.html
root=~/www/htdocs

[microformat]
verify=yes

The only new thing here is to turn on microformats analysis (class analysis is necessary too).


Microdata
------------
[general]
verbose=4
output=ssc.out
class=yes

[site]
domain=example.edu
extension=html
index=index.html
root=~/www/htdocs

There need be nothing special in the configuration file for microdata. However, if you use itemref in your
pages, then it is possible that ssc will give false warnings in the section referenced by the itemref. This
is because ssc does not always know that the referenced data is not intended to be used in its own right,
unless you put it under a TEMPLATE element.

Note that you can export the microdata encountered in JSON file format by using the export setting.


Statistics
----------
[general]
ssi=yes
verbose=4
output=ssc.out
class=yes

[site]
domain=example.edu
extension=html
extension=shtml
index=index.html
root=~/www/htdocs

[stats]
summary=yes

Turn on summary statistics, which produces a grand total at the end of a complete run (add page=yes below
summary for individual page stats).

Also note that server side includes have been turned on using general.ssi, and files with the SHTML extension
will be treated as web pages.


MathML 2
--------
This configuration file could be used to test MathML 2. NOTE: MathML is not fully implemented yet

[general]
verbose=4
output=m2.out
class=yes

[link]
check=yes

[site]
domain=example.edu
extension=html
index=index.html
root=~/www/htdocs

[math]
version=2

[validation]
citype=function
citype=list
citype=logical
citype=matrix
citype=set
citype=var-x
citype=vector

What's interesting here is the validation section. The MathML documentation lists a specific set of values that
can be used with the TYPE attribute on the CI element. The examples in the specification give this attribute many
additional, and apparently illegal, values. (This apparent inconsistency is not uncommon amongst web specifications.)
The way to avoid SSC complaining about these extra values is to give CI TYPE additional values in the configuration
file, as noted.

Indeed, many enumerated attribute values can be extended in this way. Use the new --validation switch to get a
complete list.


arts & ego
----------
This is the configuration file I use to analyse my site.

[general]
verbose=4
class=yes
output=ssc.out
ssi=yes

[site]
domain=dylanharris.org
extension=shtml
extension=html
extension=htm
extension=asp
index=index.shtml
root=X:\Site

[link]
check=yes
xlink=yes

[microformat]
verify=yes

[stats]
summary=yes
