[sphinx-dev] Re: Intersphinx: How do I reference another project in general?
Hi everybody, anyone? We have setup an intersphinx_mapping and referencing works great like in :ref:`api:Introduction`. Thanks a lot. Q: Is it possible to just link to another documentation project without naming a special target? Something like :ref:`api:`? This would be comparable to the standard Sphinx way to link to another document in the same project: http://sphinx.pocoo.org/markup/inline.html#cross-referencing-documents thankful as ever ... Martin -- Certified TYPO3 Integrator | TYPO3 Documentation Team Member http://mbless.de -- You received this message because you are subscribed to the Google Groups sphinx-dev group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
[sphinx-dev] Intersphinx: How do I reference another project in general?
We have setup an intersphinx_mapping and referencing works great like in :ref:`api:Introduction`. Thanks a lot. Q: Is it possible to just link to another documentation project without naming a special target? Something like :ref:`api:`? This would be comparable to the standard Sphinx way to link to another document in the same project: http://sphinx.pocoo.org/markup/inline.html#cross-referencing-documents thankful as ever ... Martin -- Certified TYPO3 Integrator | TYPO3 Documentation Team Member http://mbless.de -- You received this message because you are subscribed to the Google Groups sphinx-dev group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
[sphinx-dev] Re: How to override values in conf.py by values read from a Settings.yml (YAML) file?
Hello Takayuki, for k in more: exec(%s = %r % (k, more[k])) I see, this works. index.rst:: Welcome to conf.py test = :release: |release| :version: |version| That looked very promising at first sight - I was very excited. But it's restricted to three values only and no general solution. http://docs.python.org/library/functions.html#locals The contents of this dictionary should not be modified; changes may not affect the values of local and free variables used by the interpreter. Yes, your warning is more than apropriate. But as Sebastian points out, globals() can be used. Thanks for answering - it was really helpful. Martin -- Certified TYPO3 Integrator | TYPO3 Documentation Team Member http://mbless.de -- You received this message because you are subscribed to the Google Groups sphinx-dev group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
[sphinx-dev] Re: How to override values in conf.py by values read from a Settings.yml (YAML) file?
Hi Sebastian, Quick and dirty: globals().update(read_my_dict_from_yaml()) Well, looks like it's even the right and clean solution in my case! Alternativel you can update the settings after Sphinx has parsed conf.py: def setup(app): for key, value in read_my_dict_from_yaml(): setattr(app.config, key, value) I see. But my code will be at the end of the conf.py, so globals() is the one. Use globals() within conf.py. globals() returns all names on module level, and the settings in conf.py are module-level names. Yes, that's the important information I had been looking for. Couldn't remember ... Ah, I'm relieved: I have peace in my mind again knowing better about globals(), locals(), setattr(). Q: One question is left: Is there secret attribute for a module like __dict__ that returns the same dictionary as globals()? Martin -- Certified TYPO3 Integrator | TYPO3 Documentation Team Member http://mbless.de -- You received this message because you are subscribed to the Google Groups sphinx-dev group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
[sphinx-dev] How to override values in conf.py by values read from a Settings.yml (YAML) file?
Hello everybody, maybe there is an obvious solution - but I just don't see it. At the end of 'conf.py' I want to read and parse an additional 'Settings.yml' configuration file and add those settings to what we already have in 'conf.py'. If present settings from the YAML file should take precedence. So I need a way to programmatically define settings like those in the lines of conf.py. For example: html_theme = 'sphinx' So what I need is something like this: ## conf.py: # ... # normal settings ... # ... more = parse_yaml() # return a dictionary for k in more.keys(): # now I'd like to add ((k)) = more[k] # where ((k)) should be a variable in the conf.py namespace. Q: How do I do that? In other words: If in conf.py there is: html_theme = 'sphinx' k = 'html_theme' v = 'basictheme' Q: How do I write `k` = v? In other words: Q: How do I access the dictionary in conf.py that dir() queries? This does not work: _dict_[k] = v This does not work because it turns out that '__name__' has the value '__builtins__': sys.modules[__name__].__dict__[k] = v I just found that this seems to work: html_theme = 'sphinx' k = 'html_theme' v = 'basictheme' L = locals() L[k] = v print html_theme # - gives 'basictheme' Q: Is that the right and best way to do this? ... all the best ... Martin -- http://mbless.de -- You received this message because you are subscribed to the Google Groups sphinx-dev group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
[sphinx-dev] Re: How to include an additional pure Docutils directive as extension?
[Guenter Milde] wrote schrieb: As the Sphinx config file is Python code, you could try to replicate the steps otherwise done in a Docutils front-end, i.e. register the directive with Docutils. I.e. in config.py:: That's a good idea. I didn't think of that. Thanks! Martin -- http://mbless.de -- You received this message because you are subscribed to the Google Groups sphinx-dev group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
[sphinx-dev] How to include an additional pure Docutils directive as extension?
Hello everybody, I have finished my work on implementing a new 'field-list-table' directive for the Docutils. The (great!) idea is from 2005. But it never had been implemented - until now. Please see the code, documentation, demo, ...: http://mbless.de/4us/typo3-oo2rest/06-The-%5Bfield-list-table%5D-directive/README.html Feedback very much appreciated! Actually it's a pure Docutils extension - Sphinx would not be needed. And as such the directive inherits from docutils.parsers.rst.directives.tables.Table and not from Directive. I am hoping that it will make its way at the end into the Docutils core. But until it hasn't I'm encountering a problem. This is because I WANT to use Sphinx AND the new directive. Q: How can I add a pure Docutils directive - that does not inherit from sphinx.util.compat.Directive - to Sphinx? Is that possible? Docutils and Sphinx are in an area of the server that I don't have write access to. Thanks for your attention! Martin -- http://mbless.de -- You received this message because you are subscribed to the Google Groups sphinx-dev group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.