Hi all,

I'm trying to write an extension  that add options to existing directives.  I've
read:  http://sphinx.pocoo.org/extensions.html and  understand how to  write new
directives, but not how to add options to existing directives.

Is there a  regular way to do  it?  Or must I create a  new directives?  In that
case,  is it  possible to dynamically  inherit from the  exsiting directive,  or
should I copy the source code?

If needed,  below are examples of options I want to add to math, literalinclude,
and code-block.  (I've already tested the extention codes by modifiying directly
the files sphinx/directives/code.py and sphinx/ext/mathbase.py)

Thanks for your any help!

Best,
David.


1.  an 'input' options to math that insert  the lines of a file before the lines
of the latex code, for example:

.. math::
    :nowrap:
    :input: macro.tex

    latex code

2.  a 'remove_head_comments'  option to  literalinclude,  that remove  the usual
licence hearder comments in a file, for example:

.. literalinclude:: main.cpp
   :language: c++
   :remove_head_comments: c++

3.  a 'check_presence_in_file' option to code-block, to be warned if a part of a
file  included in  the documentation  is out  of  date  (if  the  file  has been
modified).  (I know  I can include  a file from  line L1  to line  L2,  but what
happen if lines are added or removed in the file...).

.. code-block:: c++
   :check_presence_in_file: main.cpp

   some lines
   of code
-- 

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to