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

Reimplement Autolinks using only docutils features #144

Merged
merged 2 commits into from
Jun 29, 2017
Merged

Reimplement Autolinks using only docutils features #144

merged 2 commits into from
Jun 29, 2017

Conversation

wagnerflo
Copy link
Contributor

Currently the restructuredText markup implements Autolinks by parsing and modifiying the generated HTML. This implementation is...

  • Unnecessarily complex: The same functionality can be implemented with a modified docutils Writer class only. This allows dropping the dependency on pyquery and is surly much more efficient.
  • Buggy:
    1. Indirect links don't work at all.
    2. A comment in the code promises that embedded URIs would also be turned into links to the wiki. This also doesn't work and - by my understanding of the specs - should only work in the case of the embedded URI being a internal target. As in:
      `long text <meep_>`_
      
      .. _meep: link_
      

This implementation fixes all these problems which should be made clear by the tests I've added. It is based heavily on code from MoinMoin.

It includes the commit from #143 dropping the bundled rst2html5.py since the WalikiHTML5Writer class derives from the external package's HTML5Writer.

@wagnerflo wagnerflo changed the title Autolinks Reimplement Autolinks using only docutils features Jun 29, 2017
@coveralls
Copy link

coveralls commented Jun 29, 2017

Coverage Status

Coverage increased (+3.8%) to 75.0% when pulling 1692fe4 on wagnerflo:autolinks into 8358391 on mgaitan:master.

@mgaitan
Copy link
Owner

mgaitan commented Jun 29, 2017

this is brilliant. thank you so much. @wagnerflo please, feel free to add yourself to the list of contributors, and tell me if you are planning more improvements. I would like to release a new version when you consider appropriate.

In the other hand, one issue that would be nice to fix in the next release (particularly important for deployments with medium-high load like http://python.org.ar) is #134. I wonder if you may be interested in looking at it.

@mgaitan mgaitan merged commit b7db696 into mgaitan:master Jun 29, 2017
@wagnerflo wagnerflo deleted the autolinks branch June 29, 2017 12:14
@wagnerflo
Copy link
Contributor Author

As far as necessary to get the project I'm using Waliki in to a finished state I will continue contributing. Starting next week the frequency will probably drop quite a bit as other tasks will have to take priority.

For a decision when to do a release I currently have no opinion, but I do have a few functions to complete and test for my project that might turn up points of improvement or bugs.

I'll see about #134. That seems to be quite important and not very hard.

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

Successfully merging this pull request may close these issues.

3 participants