Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
spec:dfn-patterns [2013/07/30 11:41] – Filled in page tabatkins | spec:dfn-patterns [2013/07/30 11:45] – [Manually Specifying the Definition Type] tabatkins |
---|
| |
This page documents the patterns and attributes that are recognized by [[http://wiki.csswg.org/tools|Shepherd, our spec parsing tool, and Tab's preprocessor]]. By using these in your own specs, you make your life and the lives of other editors easier, and contribute to better automatically-generated CSS documentation. | This page documents the patterns and attributes that are recognized by [[http://wiki.csswg.org/tools|Shepherd, our spec parsing tool, and Tab's preprocessor]]. By using these in your own specs, you make your life and the lives of other editors easier, and contribute to better automatically-generated CSS documentation. |
| |
| ===== Summary ===== |
| |
| All ''<dfn>'' elements have a definition type. This can usually be inferred from the contents or context, but might need to be explicitly specified. |
| |
| Some types of definitions are part of some higher construct. This should be indicated with a ''data-dfn-for'' attribute on the definition or a container. |
| |
| Getting this metadata right is easy and helps with auto-crossreferencing (in Tab's preprocessor) and automatically generated documentation (in Shepherd), so please get it right. |
| |
===== <dfn> Types ===== | ===== <dfn> Types ===== |
Finally, one may manually specify the definition type. This is very simple - just add a ''data-dfn-type'' attribute to the definition, with its value set to one of the definition types above (the types, like "property", not the classes or prefixes like "propdef"). | Finally, one may manually specify the definition type. This is very simple - just add a ''data-dfn-type'' attribute to the definition, with its value set to one of the definition types above (the types, like "property", not the classes or prefixes like "propdef"). |
| |
If using [[http://wiki.csswg.org/tools|Tab's preprocessor]], this is easier - just add the definition type as a boolean attribute. That is, instead of writing ''<dfn data-dfn-type=function>foo()</dfn>'', just write ''<dfn function>foo()</dfn>''. The preprocessor will automatically canonicalize this into a valid ''data-dfn-type'' attribute in the output. | If using [[http://wiki.csswg.org/tools|Tab's preprocessor]], this is easier - just add the definition type as a boolean attribute. That is, instead of writing: |
| |
| ''<dfn data-dfn-type=function>foo()</dfn>'' |
| |
| just write |
| |
| ''<dfn function>foo()</dfn>'' |
| |
| The preprocessor will automatically canonicalize this into a valid ''data-dfn-type'' attribute in the output. |
| |
===== Specifying What A Definition Is For ===== | ===== Specifying What A Definition Is For ===== |