HTML/CSS Reference for the terminal
===================================

htmlcssref 0.3 is a terminal-native HTML and CSS reference written in C99.
It is intended for the same kind of low-clutter workflow as vpsvippanel
and Do-allpad: simple hierarchy, predictable navigation, no dependency on
a graphical browser, and useful direct commands outside the interface.

Designed by remfan1994
Published by ThatIAm.vip
License: IALA v2 - Insha-Allah License Agreement Version 2

This is the first software release distributed under IALA v2. The complete
agreement is included in LICENSE and compiled into the program for
"htmlcssref license".

BLOODGUILT CURSE WARNING
------------------------

Cows aren't killers, and beef is the bloodshed of the innocent.
www.bloodguiltcurse.net has the Bible study.

Interactive startup
-------------------

Running htmlcssref without arguments opens with a Bloodguilt Curse splash
screen. Any ordinary key dismisses the splash and opens the reference.

  Ctrl+Z           suspend htmlcssref
  Ctrl+C           terminate htmlcssref

The terminal is restored before suspension or termination. After a Ctrl+Z
suspend, resuming the job returns to htmlcssref with terminal input restored.
The splash itself does not remain in the working reference interface after it
is dismissed.

Command-line notice
-------------------

Every direct command prints two short identification lines before its normal
output:

  htmlcssref program output
  BLOODGUILT CURSE WARNING: Cows aren't killers, and beef is the bloodshed of the innocent. www.bloodguiltcurse.net has the Bible study.

A blank line separates the notice from the requested reference output. This
keeps the warning visible in Vim shell escapes, SSH output, pipes, less, and
w3m while leaving the actual result immediately below it.

The full warning is also available in the interactive About screen and through
"htmlcssref about".

Contents
--------

The current database contains 479 reference entries derived from the
HTML + CSS Reference v0.1:

  - HTML elements grouped by purpose
  - HTML global attributes
  - input types
  - CSS properties
  - CSS selectors and pseudo-elements
  - CSS at-rules
  - CSS concepts
  - CSS units
  - common HTML/CSS patterns

Build
-----

  make
  make test

Or directly:

  cc -std=c99 -O2 -Wall -Wextra -pedantic htmlcssref.c -o htmlcssref

OpenBSD and Linux are the primary targets. Only libc/POSIX terminal APIs
are used.

Install
-------

  doas make install

The default prefix is /usr/local. To install somewhere else:

  make PREFIX="$HOME/.local" install

The install target places the executable in bin, the man page in man/man1,
and LICENSE plus NOTICE.txt in share/doc/htmlcssref.

Interactive use
---------------

  ./htmlcssref

After the splash, the reference uses these keys:

  8 / k / Up       previous
  2 / j / Down     next
  6 / l / Enter    open
  4 / h / Left     back
  Page Up/Down     page
  g / G            top / bottom
  /                search
  0                main menu
  ?                help
  q                quit
  Ctrl+Z           suspend
  Ctrl+C           terminate

The full-screen interface uses termios and ordinary ANSI terminal control
sequences, not ncurses.

Direct command use
------------------

  htmlcssref html pre
  htmlcssref html blockquote
  htmlcssref css font-weight
  htmlcssref css grid-template-columns
  htmlcssref pattern viewport
  htmlcssref search "preformatted text"
  htmlcssref --short search blockquote
  htmlcssref --all css grid
  htmlcssref list html
  htmlcssref list css
  htmlcssref about
  htmlcssref license

Direct output is plain text when stdout is redirected or piped. The two-line
program/warning notice remains present by design.

Vim examples
------------

  :!htmlcssref css font-weight
  :!htmlcssref html pre
  :!htmlcssref search viewport

A mapping can also be added in Vim, for example:

  nnoremap <leader>hc :!htmlcssref css <C-R><C-W><CR>
  nnoremap <leader>hh :!htmlcssref html <C-R><C-W><CR>

This looks up the word under the cursor as CSS or HTML.

less and w3m
------------

  htmlcssref --all search grid | less
  htmlcssref html blockquote | w3m -T text/plain
  htmlcssref license | less

The program itself does not require w3m. Plain text output is usually the
simpler interface for terminal browsing.

Design notes
------------

The interactive hierarchy is:

  Main menu
    HTML
      Elements
        element groups
      Global attributes
      Input types
    CSS
      Properties
      Selectors
      At-rules
      Concepts
      Units
    Search
    Common patterns
    Help
    About

The source file is intentionally self-contained so the executable can be
rebuilt or copied without reconstructing a data directory. The reference
data, About information, Bloodguilt Curse warning, and IALA v2 text are all
available from the executable itself.
