id = "tidy"
name = "HTML Tidy"
homepage = "https://www.html-tidy.org"
description = "Tidy tidies HTML and XML: it can tidy your documents by itself, and developers can integrate its features into even more powerful tools."
# The HTML Tidy mark, as the htacg organisation's avatar — html-tidy.org
# declares no icon of its own.
icon = "https://github.com/htacg.png"
executables = ["tidy"]
[dotfiles]
# tidy(1) on this Mac documents only the HTML_TIDY environment variable
# ("Name of the default configuration file"), because Apple's bundled
# /usr/bin/tidy is built without the runtime config-file support — `strings`
# on it finds HTML_TIDY and no path at all.
#
# Upstream HTML Tidy (htacg/tidy-html5) does have it, and names the file in
# CMakeLists.txt: `if ( NOT TIDY_USER_CONFIG_FILE ) set( TIDY_USER_CONFIG_FILE
# "~/.tidyrc" )`, next to TIDY_CONFIG_FILE's "/etc/tidy.conf". console/tidy.c
# reads them in that order — the system file, then $HTML_TIDY if set, and
# otherwise TIDY_USER_CONFIG_FILE. So the user-level file is ~/.tidyrc, a
# literal dot-file in the home directory rather than a base directory.
paths = ["~/.tidyrc"]
exclude = []
# A .tidyrc is Tidy's option list — indent, wrap, output-encoding, the
# new-blocklevel-tags allow lists. None of it is a credential.
secret = []
# No machine_lines: every option in the file is a formatting preference, which
# is exactly what a user wants on their other machine.
# tidy re-reads the file on every invocation and exits, so a rewrite between
# runs is harmless.
side_effect = false
[commands]
format = 1
label = "Tidy HTML/XML"
description = "Clean up and pretty-print an HTML or XML file. Encoding switches and accessibility levels are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = false, short_attached = false, short_bundles = false }
[[commands.source]]
id = "help"
kind = "help"
revision = "tidy -h, Apple build 8433"
evidence = """
-output , -o write output to the specified
-config set configuration options from the specified
-modify, -m modify the original input files
-indent, -i indent element content
-wrap , -w wrap text at the specified . 0 is assumed if
-upper, -u force tags to upper case
-clean, -c replace FONT, NOBR and CENTER tags by CSS
-bare, -b strip out smart quotes and em dashes, etc.
-numeric, -n output numeric rather than named entities
-errors, -e only show errors
-quiet, -q suppress nonessential output
-omit omit optional end tags
-xml specify the input is well formed XML
-asxml, -asxhtml convert HTML to well formed XHTML
-ashtml force XHTML to well formed HTML
Input/Output default to stdin/stdout respectively
"""
[[commands.field]]
id = "input"
label = "Input file"
type = "path"
path = { kind = "file", role = "input" }
position = 0
sources = ["help"]
[[commands.field]]
id = "output"
label = "Write result to"
type = "path"
path = { kind = "file", role = "output" }
option = ["-output", "-o"]
effect = "overwrite"
sources = ["help"]
[[commands.field]]
id = "modify"
label = "Modify input file in place"
type = "boolean"
option = ["-modify", "-m"]
effect = "overwrite"
sources = ["help"]
[[commands.field]]
id = "indent"
label = "Indent element content"
type = "boolean"
option = ["-indent", "-i"]
sources = ["help"]
[[commands.field]]
id = "wrap"
label = "Wrap column"
type = "integer"
option = ["-wrap", "-w"]
sources = ["help"]
[[commands.field]]
id = "clean"
label = "Replace FONT/NOBR/CENTER with CSS"
type = "boolean"
option = ["-clean", "-c"]
sources = ["help"]
[[commands.field]]
id = "errors_only"
label = "Only show errors"
type = "boolean"
option = ["-errors", "-e"]
sources = ["help"]
[[commands.field]]
id = "quiet"
label = "Suppress nonessential output"
type = "boolean"
option = ["-quiet", "-q"]
sources = ["help"]
[[commands.field]]
id = "xml"
label = "Input is well-formed XML"
type = "boolean"
option = ["-xml"]
sources = ["help"]
[[commands.field]]
id = "asxhtml"
label = "Convert HTML to XHTML"
type = "boolean"
option = ["-asxhtml"]
sources = ["help"]
[[commands.field]]
id = "config"
label = "Configuration file"
type = "path"
path = { kind = "file", role = "input" }
option = ["-config"]
sources = ["help"]
[[commands.task]]
id = "pretty"
label = "Pretty-print to a new file"
fields = ["input", "output", "indent", "wrap"]
required = ["input", "output"]
set = { indent = [true] }
[[commands.task]]
id = "check"
label = "Check for errors only"
fields = ["input", "errors_only"]
required = ["input"]
set = { errors_only = [true] }
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["input", "output", "indent", "wrap", "errors_only"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["modify", "clean", "quiet", "xml", "asxhtml", "config"]