asciidoc-py / asciidoc-py2

Deprecated python2 implementation of AsciiDoc.py. See asciidoc-py/asciidoc-py for current work.
https://asciidoc.org/
GNU General Public License v2.0
466 stars 128 forks source link

Quick support for inclusion of vector-rendered graphviz into PDF #123

Open fidergo-stephane-gourichon opened 6 years ago

fidergo-stephane-gourichon commented 6 years ago

Following #122.

Solution based on "the (not very tested) example" provided by Lex Trotman on https://groups.google.com/forum/#!topic/asciidoc/IddY7N7aIl4

Works for me on Ubuntu 16.04: generated good PDF, html, tex.

Save the text below to test it:

== Exemple of vector graphviz in PDF

Assuming this is saved as
`asciidoc_graphviz_svg_docbook_pdf.asciidoc.txt`, render with:

       a2x -f pdf asciidoc_graphviz_svg_docbook_pdf.asciidoc.txt

["graphviz", "helloworld.svg", format="svg"]
---------------------------------------------------------------------
digraph helloworld {
hello->world;
}
---------------------------------------------------------------------

Open for discussion.

Regards.

elextr commented 6 years ago

Looks ok by inspection, but I don't have access to a docbook toolchain, so somebody (other than the OP :) needs to test that it works and doesn't modify any non-svg graphviz uses.

fidergo-stephane-gourichon commented 6 years ago

Okay! I offer to adjust the PR on top of the fixed build. It makes a better impression what all checks pass. :-)

elextr commented 6 years ago

Okay! I offer to adjust the PR on top of the fixed build. It makes a better impression what all checks pass. :-)

For sure, sadly Travis can't look at the output and say it looks good :)

aerostitch commented 6 years ago

@fidergo-stephane-gourichon It seems this repo will no longer accept PR as the latest release has been cut a while ago but https://github.com/asciidoc/asciidoc-py3 would. If you still want this PR integrated in asciidoc, do you mind pushing it there please? Once done I think you can close this one. Thanks!

elextr commented 6 years ago

@aerostitch is essentially correct, as it says at the top of the repository, due to the EOL of Python2 the lifetime of this implementation is limited so it is kept as stable until then unless some major bug is to be fixed. Changes and improvements should be applied to the Python 3 version and/or Asciidoctor.

@aerostitch thanks for noting it on relevant PRs.

mojavelinux commented 6 years ago

I second what @elextr said. The only types of changes that would be accepted into asciidoc/asciidoc (AsciiDoc Python 2) would be to address critical issues, and even then we might think hard about it. Now that distributions have moved on to Python 3, any changes should be invested into AsciiDoc Python 3.

My opinion is that AsciiDoc Python as a whole should still be considered a legacy implementation of AsciiDoc (the original, of course). The AsciiDoc language is evolving in the Asciidoctor project.

@elextr and I have been discussing the prospect of creating an AsciiDoc language definition, which would accommodate multiple, compatible implementations. If/when that were to happen, I see a new implementation for Python emerging that doesn't have all the legacy parsing rules / bugs / baggage of AsciiDoc Python.