use-css-decorator-classes

Repository
Git URL https://github.com/transpect/use-css-decorator-classes.git
SVN URL https://github.com/transpect/use-css-decorator-classes
Base URI http://transpect.io/use-css-decorator-classes/

Source ⬇

css:use-decorator-classes

Matches class names against supplied parsed CSS declarations (of css:expand). The class names may contain keywords, separated by '_-_'. If any of these keywords are found in the parsed CSS as class selectors (.keyword), then the keywords are interpreted as class names on their own. They will be extracted from the remainder of the class name so that they are appended to the remainder, separated by space.

The use case are workflows in which the complete styling is provided via external CSS rather than converted from InDesign or Word styles. By convention, users may include keywords in the style names, separated by tilde characters ('~'). These tildes will be converted to '_-_' in the conversion process. If they supply a class definition for a keyword, the compound typesetting style name will be interpreted as a base name plus decorator(s).

To do: think about a way to skip this step for certain workflows, maybe by creating a front end pipeline that uses dynamic evaluation to optionally just do an identity transform or that supplies a different (identity) XSLT. The former option will be more efficient while the latter will be easier to set up.

Import

<p:import href="http://transpect.io/use-css-decorator-classes/xpl/use-css-decorator-classes.xpl"/>

Dependencies

Synopsis

<css:use-decorator-classes xmlns:css="http://www.w3.org/1996/css">
  <p:input port="source" primary="true"/>
  <p:input port="stylesheet"/>
  <p:output port="result" primary="true"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri" required="false" select="'debug'"/>
  <p:option name="discard-undeclared-styles" required="false" select="'no'"/>
</css:use-decorator-classes>

GitHub sync date: 2024-04-23+02:00