Hi,

Sphinx and docutils have many transform modules. I believe they are
good example for transforms.
https://github.com/sphinx-doc/sphinx/tree/master/sphinx/transforms

Sphinx is based on docutils framework. And the transform is a
component of docutils.
So you need to learn it to create transform module.

Thanks,
Takeshi KOMIYA

2018-03-08 23:56 GMT+09:00 Aaron Carlisle <[email protected]>:
> Can you give an example of using Sphinx.add_transform? I am having a hard
> time understanding the documentation.
> I can open a PR that includes this example to help others in the future.
>
> On Tue, Mar 6, 2018 at 1:44 AM, Komiya Takeshi <[email protected]> wrote:
>>
>> Hi Aaron,
>>
>> You don't need to make any extensions to specify styles. Almost of
>> directives supports :class: option to do that:
>>
>>     .. hint:: Hello
>>        :class: responsive foo-style
>>
>>
>> As an alternative, you can do it with a Transform module. It is used
>> to modify doctrees before converting.
>> For more details, please read the document of docutils'.
>>
>> http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_transform
>> http://docutils.sourceforge.net/docs/ref/transforms.html
>>
>> Of course, you can extend HTML Builder with inheritance. But I think
>> it is too much to add class attributes.
>>
>> Thanks,
>> Takeshi KOMIYA
>>
>> 2018-03-06 4:06 GMT+09:00 Aaron Carlisle <[email protected]>:
>> > Hi,
>> >
>> > So I want to know how I can extend the default html builder to use my
>> > own
>> > class attribute?
>> >
>> > So for example, I want it the note admonition to have the class
>> > "responsive
>> > myclassName"
>> >
>> > Or for tables to use class 'table responsive'.
>> >
>> > Thanks,
>> >
>> > --
>> > Aaron Carlisle
>> >
>> > Picture taker | Bit cruncher | Pixel pusher | Document writer |
>> > Project administrator for the Blender 3D Documentation Project
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "sphinx-users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to [email protected].
>> > To post to this group, send email to [email protected].
>> > Visit this group at https://groups.google.com/group/sphinx-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sphinx-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/sphinx-users.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Aaron Carlisle
>
> Picture taker | Bit cruncher | Pixel pusher | Document writer |
> Project administrator for the Blender 3D Documentation Project
>
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sphinx-users.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to