Thanks for your previous answer. Now, my understanding is that : 1) Sphinx read the .py files and build a doctree, with one object for one node. I think that there is a object for a python method. 2) The Sphinx writers will read the doctree and produce an HTML code
My idea is to add a RST command : Change_current_method_to_new_type_of_method. This mean that i have to: - add a new attribute into the object that describe a method - or change the current object to a new object derivated from the method object Then change the writers to use my own style if needed (according the atrtribute or the type of object) My question is : Who is responsable to read the RST code : Sphnix or docutils or both ? To add new RST command, I mus interact which the code that read and analyze the RST If docutils is responsable to read RST code, how to change the function_object of sphinx ? Does docutils know the method object for the current object ? Thanks for you pointers, PHL ________________________________ De : [email protected] <[email protected]> de la part de andre seame <[email protected]> Envoyé : jeudi 2 mars 2017 17:05 À : [email protected] Objet : [sphinx-users] Hot wo have different presentation for a method - How to modify the HTML generation ? Hello, For instance I have 2 methods def internal_method(trace=False): :param trace=False: to be completed :return: to be completed def public_methode(trace=True): :param trace=True: to be completed :return: to be completed sphinx does it job and will create 2 HTML divisions: <dl class="function">, one per method. Is it possible to have something like : def internal_method(trace=False): :my_own_definition_for_internal :param .... def public_method(trace=True) :my_own_definition_for_public :param .... Other possibility is to have :my_own_definition (parameter is public) And is it possible to modify the html generator to say function => dl class="function" function with my_own_defintiion => dl class="function_public" or class="function_internal" ... Have you idea to do something like that? The docString is a "body" so it is not possible to add RST directive like .. my_own_definition_for_internal. So the simplest way is : How to extend the docString language and modify the html generation ? Thanks PHL. -- 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]<mailto:[email protected]>. To post to this group, send email to [email protected]<mailto:[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.
