answering my own question: I just had to copy the standard domain, and 
rename py-modules as mat-modules. see the source on bitbucket in the 
sphinxcontrib repo

On Thursday, April 25, 2013 4:39:31 PM UTC-7, Mark Mikofski wrote:
>
> * I have created a domain specific for MATLAB called, "MATLABDomain" 
> hosted in a fork of sphinx-contrib here:
> https://bitbucket.org/bwanamarko/sphinx-contrib
> * It is basically a copy of the pythonDomain with [pP]y converted to 
> [mM]at and [pP]ython converted to matlab | MATLAB conserving case.
> * added the setup function to add the domain as an extension at then end 
> of matlab.py
>     def setup(app):
>         app.add_domain(MATLABDomain)
> * I created it by running make-ext, then adding the domain module, 
> matlab.py.
> * I installed it using python setup.py install - no warnings
> * I then added 'sphinxcontrib.matlab' to extensions and made the primary 
> domain matlab
> extensions = ['sphinx.ext.pngmath', 'sphinx.ext.mathjax', 
> 'sphinxcontrib.matlab']
> primary_domain = 'mat'
> * I use domains as usual, .. module: is a module
> * It works perfectly, except for one thing, when I make html, the 
> :ref:`modindex` on the index.rst page still links to
> ... /_build/html/py-modindex.html instead of ... 
> /_build/html/mat-modindex.html
> * in fact if I use that ref anywhere it always points to py-modindex.html, 
> which isn't created
> * mat-modindex.html actually is created and interestingly the "modules" 
> link in the upper right hand corner in between "next" and "index" works 
> fine, and links to the correct page.
> ... /_build/html/mat-modindex.html
> * now for another twist, if I build latexpdf (using MikTeX), the link on 
> the index page, :ref:`modindex` actually does work, and links to the MATLAB 
> module index - weird.
>
> * I have tried to debug exactly when the href to py-modindex actually gets 
> written, but it is like looking for a needle in a haystack!
>
> <li><a class="reference internal" href="py-modindex.html"><em>Module Index
> </em></a></li>
>
> Can anyone who has worked extensively with html writers and builders give 
> me a clue to what is going on?
>
> Jinja2==2.6
> Pygments==1.5
> Sphinx==1.1.3
> distribute==0.6.36
> docutils==0.10
> sphinxcontrib-matlabdomain==0.1dev-20130425
> Python 2.7.3 x64
> Windows 7 x64
> ReportLab
> MikTeX-2.9
>
> Thanks
> Mark
>

-- 
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 http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to