Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for links #15

Closed
myint opened this issue Mar 31, 2013 · 5 comments
Closed

Support for links #15

myint opened this issue Mar 31, 2013 · 5 comments

Comments

@myint
Copy link

myint commented Mar 31, 2013

rst2rst is translating links into garbage. Is this due to incompatibility with the latest docutils? (I noticed that I had to get rid of a bunch of unused imports just to get rst2rst to run without import errors.)

$ pip-2.7 freeze | grep docutils
docutils==0.10
$ rst2rst
ImportError: No module named error_reporting

After removing many unused imports, it runs.

diff --git a/rst2rst/writer.py b/rst2rst/writer.py
index 1e6ca81..a1cb9f4 100644
--- a/rst2rst/writer.py
+++ b/rst2rst/writer.py
@@ -4,13 +4,8 @@ __docformat__ = 'reStructuredText'

 from textwrap import TextWrapper

-import docutils
-from docutils import frontend, nodes, utils, writers, languages, io
-from docutils.error_reporting import SafeString
-from docutils.transforms import writer_aux
-from docutils.math import unichar2tex, pick_math_environment
-from docutils.math.latex2mathml import parse_latex_math
-from docutils.math.math2html import math2html
+from docutils import nodes
+from docutils import writers


 class Options(object):
$ cat input.rst
pyformat
========

.. image:: https://travis-ci.org/myint/pyformat.png?branch=master
   :target: https://travis-ci.org/myint/pyformat
   :alt: Build status

Formats Python code (using autoflake_, autopep8_, docformatter_, etc.).

.. _autoflake: https://github.com/myint/autoflake
.. _autopep8: https://github.com/hhatto/autopep8
.. _docformatter: https://github.com/myint/docformatter
$ rst2rst input.rst
########
pyformat
########

Formats Python code (using

autoflake

,

autopep8

,

docformatter

, etc.).
@benoitbryon
Copy link
Owner

rst2rst is translating links into garbage. Is this due to incompatibility with the latest docutils?

It's because links aren't implemented yet in the rst2rst writer. See:

rst2rst is an in-development project. Currently there are many reStructuredText elements that are not implemented. Feel free to send a pull request if you can, I'll be glad to review it ;)

@benoitbryon
Copy link
Owner

I noticed that I had to get rid of a bunch of unused imports just to get rst2rst to run without import errors.

How did you install rst2rst? with pip install rst2rst? (so that I can reproduce it).
Agreed: there are many unused imports. Some cleanup would be useful.
Note: I may move this topic in an another issue, since it is not directly related to support of links.

@benoitbryon
Copy link
Owner

.. image:: https://travis-ci.org/myint/pyformat.png?branch=master

Support for images isn't implemented either.

@myint
Copy link
Author

myint commented Mar 31, 2013

I just ran python2.7 setup.py install to install rst2rst. What version of docutils are you using? (As I mentioned above, I'm using the latest version.)

This is a great idea for a tool, by the way.

@benoitbryon
Copy link
Owner

@myint : I created #16 to follow the install problems with docutils 0.10.

I also created #17 about "development status in README", so that people who discover the project don't feel fooled.

In this thread, let's focus on "support for links".

Note: I wonder about creating one ticket per unsupported docutils element... there are a lot. Perhaps it would help developers contribute, or users know what is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants