DocBook has no ``bold tag'' but it is customary to use the
emphasis element with attribute
role equals to
bold. The following macro automates this:
<command name="convertToBold"> <macro repeatable="true" undoable="true" label="Convert to Bold"> <sequence> <command name="convert" parameter="[implicitElement] emphasis" /> <command name="putAttribute" parameter="role bold" /> </sequence> </macro> </command>
Using a sequence element:
The macro converts anything convertible to an
emphasis element (generally text selection, but not only text selection) to an
If step #1 is successful, the macro adds attribute
role with value
bold to the newly created
Note that if the first step of a sequence cannot be executed (this is tested before attempting to actually execute the sequence construct), the whole sequence construct cannot be executed.
This is often the case. A quick way to learn this is to first perform interactively what needs to be automated by the macro.