Metadata TypeMetal May Add to HTML Files
TypeMetal is decidedly minimalist when it comes to your markup. There are only two custom metadata elements that TypeMetal will add to an HTML file when necessary. Both are ignored by Web browsers, and you can safely remove them without causing any problems.
Snippet Set Association
If an HTML file has an associated TypeMetal snippet set, TypeMetal tracks this using a custom <link>
element of the following format in the document’s <head>
:
<link rel="typemetal-snippet-set" href="relative/path/to/YourSnippetSet.typemetalsnippets" />
Putting the association in the HTML file like this makes the association hold for anyone who receives and opens the file (via a version control system, perhaps). When a recipient opens the HTML file using TypeMetal, TypeMetal will automatically find and load the associated snippet set (which, ideally, is distributed together with the HTML files), leaving them ready to write and edit.
Removing the snippet set association (using the snippet set picker or File menu provision) will remove this <link>
element from the HTML file. You’re also free to remove it yourself when using another editor.
TypeMetal’s “typemetal-snippet-set
” <link>
extension has been submitted to the HTML5 link type extensions registry.
Per-File HTML Formatting Settings
If an HTML file has its own HTML formatting settings, TypeMetal tracks this using a custom <meta>
element of the following format in the document’s <head>:
<meta name="typemetal.formatprefs" content="4,8-icn" />
Putting this info in the HTML file ensures that anyone who edits the file using TypeMetal will maintain the desired formatting (leading to minimal diffs if the file is under version control).
Switching the file to instead use your “User Settings” for HTML formatting (using the formatting settings picker or File menu provision) will remove this <meta>
element. You’re also free to remove it yourself when using another editor.
This <meta>
element’s “content
” string is a compact representation of the document’s custom HTML formatting settings. It begins with the number of spaces per indent, followed by a comma, followed by the number of spaces per tab. Then, if any of the remaining HTML formatting settings is switched “off”, there is a dash, followed by one character for each formatting preference that is switched off, encoded as follows:
Character | Setting |
---|---|
t | “Use tabs” is disabled |
i | “Indent block-level elements” is disabled |
x | “Don’t indent <head> or <body>” is disabled |
b | “Put block-level elements on a new line” is disabled |
e | “Close empty element tags with a /” is disabled |
s | “Leave a space before the /” is disabled |
h | “Leave a blank line before and after <h1>-<h6> elements” is disabled |
q | “Enclose attribute values in “double quotes”” is disabled |
o | “Use lowercase tag names” is disabled |
r | “Move to a new line after a <br>” is disabled |
a | “Indent to same level” (after new line after a <br>) is disabled |
c | Write special characters “directly as characters, when possible” is disabled |
n | Write special characters “as named references, when possible” is disabled |
d | Write special characters “as numeric references” is set to hexadecimal, not decimal |
Thus, “4,8-icn
” in the example above indicates:
- 4 spaces per indent
- 8 spaces per tab
- block-level elements are not indented
- special characters are written using decimal numeric references such as
½
, since the preferred alternatives of writing them “directly as characters” and “as named references” are disabled
TypeMetal’s “typemetal.formatprefs
” <meta>
extension has been registered with the WHATWG Wiki MetaExtensions page.