From: Mark N. <Mar...@fr...> - 2005-09-30 14:53:28
|
David Goodger wrote: > > > David Goodger wrote: > >> So, given the definition above, how would the following usage be > >> represented in the doctree? > >> > >> colored :red:`text` > > [Mark Nodine] > > The problem really is trying to get communication between the > > role's definition and the use of the role, which is impeded > > by the fact that the role directive has no representation in > > the doctree. > > No, the problem is getting you to show us a concrete example of what > you mean! I thought I had given an example in my first email under the shot-down-because-unscalable category. But here goes. Given this input (I've arbitrarily picked one of the alternatives you suggested) .. role:: red html :prefix: <font color="red"> :suffix: </font> latex :prefix: {\color{red} :suffix: } colored :red:`text` I'd suggest the following doctree representation <role_definition names="red" base-role="inline"> <definition_list> <definition_list_item> <term> html <definition> <field_list> <field> <field_name> prefix <field_body> <paragraph> <font color="red"> <field> <field_name> suffix <field_body> <paragraph> </font> <definition_list_item> <term> latex <definition> <field_list> <field> <field_name> prefix <field_body> <paragraph> {color{red} <field> <field_name> suffix <field_body> <paragraph> } <paragraph> colored <inline classes="red" custom-role="red"> text > Are you under the impression that all directive-created roles use the > "inline" element? Of course not. However, inline seems the most natural element to use when you want to specify writer-specific output. --Mark |