reStructuredText export
I'd like to see reStructuredText as an export option. Do you think pybtex could be used as bibliographic tool for Docutils (http://docutils.sf.net~)?
Comments (9)
-
-
Seems like I can't attach a file. Anyway, the patch is trivial, let me paste it here.
modified file 'pybtex/backends/__init__.py'
--- pybtex/backends/__init__.py 2011-03-03 14:15:55 +0000 +++ pybtex/backends/__init__.py 2011-03-24 15:31:24 +0000 @@ -48,6 +48,10 @@
raise NotImplementedError
+ def render_sequence(self, text): + """Render a sequence of rendered text objects.""" + return "".join(text) + def write_entry(self, label, key, text): raise NotImplementedError
modified file 'pybtex/richtext.py'
--- pybtex/richtext.py 2011-01-06 18:14:02 +0000 +++ pybtex/richtext.py 2011-03-24 15:30:30 +0000 @@ -125,7 +125,7 @@ text.append(backend.format_text(item)) else: text.append(item.render(backend)) - return "".join(text) + return backend.render_sequence(text)
def enumerate(self): for n, child in enumerate(self):
-
Doctree fork now maintained here:
-
Ticket moved from /p/pybtex/feature-requests/4/
Can't be converted:
- _milestone:
- _priority: 5
-
- status: open --> closed-fixed
- Version: --> trunk
-
Guess it's time to close this bug. :) We have https://pypi.python.org/pypi/sphinxcontrib-bibtex now.
-
How with sphinxcontrib-bibtex can we do the equivalent of
pybtex-format Rnews.bib out.rst
to get restructured text citation in out.rst ?
-
You cannot directly export the bibliography to .rst, but you can use sphinxcontrib-bibtex to include bibliographies into .rst documents.
-
ok but here is not cli in sphinxcontrib-bibtex ;(
I'm not using sphinx, so does that mean that I have to use the API and create my own script ?
- Log in to comment
I'm working on a bibtex sphinx extension and I've created a doctree backend for pybtex:
https://bitbucket.org/mtroffaes/sphinx-contrib/src/tip/bibtex/sphinxcontrib/bibtex/backends/doctree.py
I had to patch the pybtex source to allow backends with non-string rendering. Will try to attach it...