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


Running SSC
===========
To run SSC, bring up the command line, change to ssc's installation
directory, and type:

    Windows: ssc
    Unix: ./ssc

If it's installed correctly, it should respond with (c) info.

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

ssc .

and off it will go, reporting any issues it finds in all HTML files in
the current directory and its descendants.


reports
-------
When ssc reports issues, it reports the HTML where it spots the
problem, with the approximate line number. This may be after the actual
location of the problem. Consider, for example:

<P>Taost<A href="https://example.com/superdoopersecretrecipe.html"
title="what a wonderful page oh so wow" onclick="haltandcatchfire"
onhover="winkembarrassingly" wimper=frequently>d wombats are a
delicious</A> thing.</P>

The word ssc spots is "Taostd". It knows there's a word to check when
it gets to the end of the word, e.g. at the space that follows it. In
this case, the word is interrupted by rather a lot of HTML, which is
ignored when checking spelling. Because the intervening HTML is so
long, crossing a number of lines, and ssc reports small snippets of
HTML per issue (to avoid spouting too much verbiage), it will not show
sufficient HTML to see the entire misspelt word. That's why, usually,
you should take the snippet and corresponding line number as a hint,
not an absolute. There is an issue, it is near the reported HTML and
line number, but, in this case, is not actually there. Of course, the
report of the misspelt word mentions the word it considers misspelt.


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

-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 a report to file

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

-I	        Process Server Side Includes
-g dir      set the root directory (defaults to current directory)
-x xxx      treat files with extension xxx as HTML/XHTML
-i file     file is the index filename (default index.html)
-s dom      dom is the local sites domain name
-L arg      Define a virtual directory (arg is formatted
            virtual=physical)

-e	        Check external links (each link is checked once per run,
            not once per encounter)
-l	        Check internal links
-O	        Report each broken link once, not each time it's found
-r	        Do not check for https certificate revocation
-X	        Check crosslinked IDs

-M	        Check microformats use of class attribute
-m	        Check ontologies use of WhatWG microdata attributes

-S	        Report site statistics

-Y 1		Disable multithreading

-A			Report switches noticed by ssc, and exit.

A full list of switches is given by the -h switch.

If you find yourself having switch problems, add -A to your command
line to see what switches ssc has noticed. -A kyboshes other
processing.

Unfortunately, some fruity system suppliers sometimes release a buggy
compiler. These bugs can often be avoided by using an alternative
compiler (try gcc), disabling multithreading at runtime (-Y 1), or not
upgrading your system until the fruity supplier releases a bug free
version of their noisy compiler.


Environment
-----------
SSC will process the following environment variables:
SSC_CONFIG  name of configuration file if none given on the command
            line
SSC_ARGS    command line switches

SSC will recognise when it is running in a CGI environment by
processing QUERY_STRING and other CGI environment variables. In such
circumstances, QUERY_STRING must contain a parameter called
html.snippet, with an appropriate value.



Configuration Files
===================

SSC will accept configuration files in INI file format. Here are some
examples, mostly adapted from the tests:


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

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

The website for example.edu 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 analyses class identifiers, so will scan CSS files for
class names.


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

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

[link]
check=
external=
xlink=

Beyond the previous example, SSC will also check links, including
external links and crosslinked ids.

The configuration file specifies a virtual directory. When a link
refers to the local directory /net, SSC will seek the corresponding
file(s) in tests/virtual (relative to the current directory, not the
root).


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

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

[microformat]
verify=

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


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

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

Actually, SSC will report on any microdata it finds, no matter what.
Note that, if you use itemref in your pages, ssc may 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.

You can export the microdata encountered in JSON file format by using
the export setting (not shown).


Statistics
----------
[general]
verbose=5
output=ssc.out
class=

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

[ssi]
verify=

[stats]
summary=

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

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.

[general]
verbose=5
output=m2.out
class=

[link]
check=

[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 --validation switch to get a complete list.


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

[general]
verbose=info
output=~/www/live.out
ignore=pre
rpt=
progress=
class=
classic=
no-rel=

[css]
verify=
extension=css
version=2023++

[html]
version=2023/10/01
title=80
rfc1942=
rfc2070=
ie=
safari=

[link]
no-external=
xlink=
pretend=cgi-bin
local=

[nits]
silence=use_double_quote_code
silence=use_quote_code
silence=missing_itemtype

[shadow]
copy=dedu
root=~/www/live
file=~/www/live.ndx
ignore=inc
info=
msg=arts & ego (c) 1978-2025 dylan harris

[site]
domain=dylanharris.org
extension=shtml
extension=html
extension=htm
extension=asp
index=index.shtml
root=|/Sites

[spell]
no-check=

[ssi]
verify=

[stats]
summary=

[validation]
lang=ma
fontname=Marain
fontname=droid-sans-mono
fontname=ArialMT
fontname=Arial-BoldMT
fontname=Times-Italic
fontname=Times-Roman
fontname=TimesNewRomanPSMT
fontname=TrebuchetMS
fontname=TrebuchetMS-Italic

My site has been built by hand over the decades, and is full of errors.
I wrote ssc because I was frustrated that I could find no tool to
properly check it. Unfortunately, SSC is too successful: it finds
a gadzillion errors in arts & ego. I am slowly making the repairs.


OpenBSD website
---------------
Perhaps you've grabbed a copy of the OpenBSD website from github
(https://github.com/openbsd/www.git):

[general]
verbose=info
output=~/www.out
git=
progress=
sloven=

[css]
version=2023++
device=3

[html]
version=2023/10/01
title=80
force=

[link]
check=
no-xlink=

[nits]
comment=ftp_protocol

[site]
domain=openbsd.org
root=~/github/www
index=index.html

[stats]
summary=



Potential gotchas
=================

Versions
--------
For HTML, ssc defaults to a version of the living standard that's
contemporary to the version of ssc. The same applies to other document
types. In all cases, though, if the document itself specifies a
particular version (such as HTML 3.2), then that applies.

The version indicated by the DOCTYPE can be very broad. For example,
the HTML 5 doctype specifies HTML 5 alone, but not which flavour (W3 or
living standard), nor which revision.

If you are verifying HTML, and it contains some CSS, MathML, SVG, or
other content, then ssc will attempt to guess the version of the latter
from the former (unless you tell it which to use).

All this is why that, if you want to be precise about document
verification, specify versions, either with a switch or an entry in a
configuration file. If your HTML contains MathML/SVG/etc. snippets,
then specify those versions too.


More info
=========
The ssc source root includes some text files with more information.

gen.text			Command line man page
build.txt			How to make your own copy of ssc
releasenotes.txt	A history of features and featurettes
README.txt			An introduction to ssc
LICENCE.txt			Component licences
LICENSE.txt			The GNU General Licence Version 3
