Xenguy's very unofficial web site notes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Xenguy f1bd152e50 Minor edits, plus added table of contents. 2 weeks ago
README.md Minor edits, plus added table of contents. 2 weeks ago

README.md

Xenguy_website-notes

Xenguy’s very unofficial web site notes.

Table of Contents

Todo

  • get-devuan.html: find out if rsync links are syntactically correct (e.g. ‘/’ vs. ‘::')
  • Finalize linkchecking and repair of broken links
    • Chat with fsmithred about a couple of those use cases (involving ‘uboot’ ?).
  • Cosmetic changes (mostly just 2-space indentation of the HTML code), all in one pass.:

Git

  • Spacemacs/Magit
    • Fantastic, the best!
  • Tig
    • Ncurses git repo browser, and a bit more; decent, mostly complete, while Magit is fully complete.

Indentation

The utility ‘tidy’ is able to indent HTML code, but I have so far not found a way to ensure that it does only that. For example, when I used the following command-line (CLI) invocation to indent all HTML files on the web site, Tidy also removed the instances of empty <span> tags on all the pages, which it had no business doing whatsoever:

  • for i in $(find . -iname "*html"); do tidy --show-errors 0 --show-body-only auto -qim -w 0 $i; done
  • This recursively re-indents all HTML files in place. Obviously it requires the ‘tidy’ utility to be installed.

I used the following steps to workaround Tidy’s bad behavior:

  1. Verify whether there are any current files containing string >&nbsp;</span>:
  • `for i in $(find . -iname “*.html”); do grep -il ‘> </span’ $i; done | wc -l
  • Expected result is zero such instances found.
  1. Count the number of web site files currently containing string ></span>:
  • for i in $(find . -iname "*.html"); do grep -il '></span' $i; done | wc -l
  • Expected result is (currently) 86 files, i.e. all web site HTML files.
  1. Open all web site HTML files with the Vim text editor:
  • find . -iname "*html" -exec vim -c "set nobackup" {} \+
  • Issue the following command in Vim to insert, in all files, the string &nbsp; inside all currently empty <span> tags:
    • :bufdo %s!></span>!>\&nbsp;</span>!g
  • Save all files and exit Vim:
    • :wa
    • :qa
  1. Now that the <span> tags are no longer empty, Tidy can be safely invoked to reindent the HTML code of all web site HTML files:
  • for i in $(find . -iname "*html"); do tidy --show-errors 0 --show-body-only auto -qim -w 0 $i; done
  1. Open all web site HTML files again with the Vim text editor:
  • find . -iname "*html" -exec vim -c "set nobackup" {} \+
  • Issue the following command in Vim to remove, in all HTML files, the string &nbsp; currently inside some <span> tags:
    • :bufdo %s!>&nbsp;</span>!></span>!g
  • Save all files and exit Vim:
    • :wa
    • :qa
  1. Finally, verify that all strings >&nbsp;</span have been removed from all site HTML files:
  • `for i in $(find . -iname “*.html”); do grep -il ‘> </span’ $i; done | wc -l
  • Expected result is zero such instances found.

For indenting the file you are currently editing:

  • If you use the Vim editor:
    • :%!tidy --show-errors 0 --show-body-only auto -qi -w 0
    • But remember the issue above with Tidy deleting empty <span> tags : -)

Linkcheckers

Conclusion: Linkchecker wins, unless proven to provide wrong or incomplete results in future. Also it can be supplemented/supported by use of the W3C online link checking tool.

1. linkchecker

  • Seems very fast (e.g. checks the whole site in just under 2 minutes)
  • Easy to use, at the command-line.
  • Has a GUI named ‘linkchecker-gui’ (probably won’t try this, so can’t report back)

2. W3C Linkcheck(?)

  • Free online linkchecking service.
  • Need to specify recursion depth (e.g. ‘7’ levels)
  • Checks more than just links.
    • e.g. Checks for duplicate ‘id="foo”’
  • Very verbose output; haven’t tried checking the ‘Summary’ option...
  • Takes about 10 minutes to run the site (so, slower than ‘linkchecker’ above [2 minutes vs. 10 minutes])

3. Tested, but dropped

  • linklint
  • checkbot
  • webcheck
    • The most promising of this lot, but didn’t seem to want to process our web site, for reasons unknown.

Style Guide

Closing Void Tags

In short, HTML5 will accept either, for example, <br> or <br />. The most important point is probably to just pick one, and then be consistent. The site already uses mainly <br>, so we will continue to use that form, and the same for the <img> tag, etc.