Is a Deviation v4.1 release on the near horizon?

More
11 Jun 2015 19:42 #33869 by PhracturedBlue
Replied by PhracturedBlue on topic Is a Deviation v4.1 release on the near horizon?
Of course, nothing is very easy. As I started on the Transmitter-menu chapter, I immediately ran into a new issue. rst2pdf doesn't support wrapping multiple paragraphs with an image. That turned out to be a major issue, since the current manual relies on that behavior heavily.

So I dug into the code, and learned a lot more about docutils, reportlab and rst2pdf. I have now enhanced rst2pdf to handle the '.. container::' directive which allows grouping multiple objects together (at least as far as wrapping around images goes)

I also figured out how to use virtualenv, which allows us to choose specific version of python modules to use.

So now the build-system should be somewhat robust. I'd appreciate it if someone in the linux/unix world could check out the 'rst' branch of the manual and try to build it.

You need:
python2
pip
virtualenv (pip install -U virtualenv)

Then do 'make pdf' and see what happens

Please Log in or Create an account to join the conversation.

More
11 Jun 2015 21:57 #33877 by mwm
I tried the rts build. Three issues:

1) Python2? Really? Sphinx is supposed to work with Python3, and new projects should really be using it. Does one of the extensions you're using require 2?

2) The recursive make call was broken. Fix is to use $(MAKE) instead of make. Already pushed that to the repository.

3) Sphinx failed to load the pdf building extension. The error was:
Extension error:
Could not import extension rst2pdf.pdfbuilder (exception: No module named pdfbuilder)
Makefile:45: recipe for target 'pdf' failed

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
11 Jun 2015 22:10 #33878 by PhracturedBlue
Replied by PhracturedBlue on topic Is a Deviation v4.1 release on the near horizon?
I don't know. I only write code for python2, so I've only tested there. rst2pdf is quite old and unmaintained, so I'd be surprised if it works. feel free to try it, but I am unlikely to support it.

I need to see the output of the build to determine why rst2pdf didn't install.
remove build/venv and run 'make devbuild' and capture the results

you can also try:
build/venv/bin/pip list
and
cd dist-packages/rst2pdf/ &&../../build/venv/bin/python setup.py install

Please Log in or Create an account to join the conversation.

More
11 Jun 2015 22:28 - 11 Jun 2015 22:31 #33879 by mwm
Well, that would be rst2pdf requiring python2. Using 2 just isn't a long-term solution, as it's already had an EOL announced. Isn't there another tool for building pdf from rst? If that's maintained, maybe it needs a look?

I've attached both the log from makedevbuild and the output of the pip list command.

Edit: Seems you can't attach files that don't have an extension, or use a "text" extensions. I feel like quoting bowie.. Fixed

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.
Attachments:
Last edit: 11 Jun 2015 22:31 by mwm.

Please Log in or Create an account to join the conversation.

More
11 Jun 2015 22:42 #33880 by PhracturedBlue
Replied by PhracturedBlue on topic Is a Deviation v4.1 release on the near horizon?
I program in python a minimum amount, and I don't see any value in learning something new until I need to. I don't think python2 is actually going anywhere. Like Perl5 it is going to be around for a long time. When the time comes and my distro changes 'python' to point at 'python3' I'll decide what to do. There are 2 choices for pdf generation from rst: rst2pdf which is apparently abandonware, but actually works pretty well. It uses ReportLab to do the heavy lifting, and that is actively developed. Or use latex to generate pdf. The latter solution is more difficult to install, harder to debug, and is missing more features than rst2pdf. So I'll personally maintain rst2pdf for the features we need.

Your logs don't show anything interesting. They show that rst2pdf is properly installed. that means the issue is on the sphinx side. You could try:
ln -s dist-packages/rst2pdf/rst2pdf sphinx-ext/rst2pdf

and see if that fixes it. Maybe I need to muck with the paths in conf.py. I don't know how sphinx identifies modules that are installed in the default path.

Please Log in or Create an account to join the conversation.

More
11 Jun 2015 22:49 #33881 by mwm
The symlink didn't fix the problem.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
11 Jun 2015 22:56 - 11 Jun 2015 22:56 #33882 by PhracturedBlue
Replied by PhracturedBlue on topic Is a Deviation v4.1 release on the near horizon?
Got me.
What happens if you do:

build/venv/bin/python
>>> import rst2pdf
>>> import rst2pdf.pdfbuilder

what do you see if you do:
ls build/venv/lib/python2.7/site-packages/r
Last edit: 11 Jun 2015 22:56 by PhracturedBlue.

Please Log in or Create an account to join the conversation.

More
11 Jun 2015 22:58 #33883 by mwm
rst2pdf imports. rst2pdf.pdfbuilder fails with a "no module named pdfbuilder" error..

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
11 Jun 2015 23:31 - 11 Jun 2015 23:31 #33884 by PhracturedBlue
Replied by PhracturedBlue on topic Is a Deviation v4.1 release on the near horizon?
more things to try:
build/venv/bin/python
>>> import sys
>>> print sys.path


find . -name pdfbuilder.py

also, what version of python are you getting?
Last edit: 11 Jun 2015 23:31 by PhracturedBlue.

Please Log in or Create an account to join the conversation.

More
11 Jun 2015 23:41 #33885 by mwm
No pdfbuilder.py found. No *builder.py found, either.

Python version 2.7.9.

Here's sys.path

>>> pprint.pprint(sys.path)
['',
'/export/mwm/src/bitbucket/deviation/team-manual/build/venv/lib/python2.7/site-packages/rst2pdf-0.93.dev_r0-py2.7.egg',
'/export/mwm/src/bitbucket/deviation/team-manual/build/venv/lib/python27.zip',
'/export/mwm/src/bitbucket/deviation/team-manual/build/venv/lib/python2.7',
'/export/mwm/src/bitbucket/deviation/team-manual/build/venv/lib/python2.7/plat-freebsd10',
'/export/mwm/src/bitbucket/deviation/team-manual/build/venv/lib/python2.7/lib-tk',
'/export/mwm/src/bitbucket/deviation/team-manual/build/venv/lib/python2.7/lib-old',
'/export/mwm/src/bitbucket/deviation/team-manual/build/venv/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7',
'/usr/local/lib/python2.7/plat-freebsd10',
'/usr/local/lib/python2.7/lib-tk',
'/export/mwm/src/bitbucket/deviation/team-manual/build/venv/lib/python2.7/site-packages',
'/export/mwm/src/bitbucket/deviation/team-manual/build/venv/lib/python2.7/site-packages']


Possibly easier to figure out what you're looking for:

>>> pprint.pprint([x[len("/export/mwm/src/bitbucket/deviation/team-manual/"):] for x in sys.path if "deviation" in x])
['build/venv/lib/python2.7/site-packages/rst2pdf-0.93.dev_r0-py2.7.egg',
'build/venv/lib/python27.zip',
'build/venv/lib/python2.7',
'build/venv/lib/python2.7/plat-freebsd10',
'build/venv/lib/python2.7/lib-tk',
'build/venv/lib/python2.7/lib-old',
'build/venv/lib/python2.7/lib-dynload',
'build/venv/lib/python2.7/site-packages',
'build/venv/lib/python2.7/site-packages']


Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
12 Jun 2015 00:34 #33891 by PhracturedBlue
Replied by PhracturedBlue on topic Is a Deviation v4.1 release on the near horizon?
Aha.
the .hgignore was preventing pdfbuilder.py from being grabbed by hg. Do a new pull. Make sure you remove any changes you made during testing. You likely need to removethe build/venv dir again.

Please Log in or Create an account to join the conversation.

More
12 Jun 2015 02:56 #33898 by mwm
Ok, I got it to build. Two issues:
  1. I had to install inkscape first. Presumably to deal with the svg images.
  2. I also got errors about missing fonts: the Bold, Oblique and BoldOblique versions of Times-Roman.


An experiments to consider.

Since I've already got all the parts installed - including the LaTeX bits - I used pandoc to generate a PDF from some of the chapters. it doesn't deal with the svg images because pandoc doesn't convert them automatically, and LaTeX doesn't grok svg. No complaints about missing fonts, but it didn't grok "source" macro/css class stuff. The results are absolutely lovely, in part because it didn't use helvetica for missing fonts. But not the format you want. Attached the install chapter anyway.

If you think the LaTeX output looks good enough to justify having to install all the bits, let me know what builders to install in the virtualenv & the builder name, and I can try that with sphinx

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
12 Jun 2015 05:24 #33904 by PhracturedBlue
Replied by PhracturedBlue on topic Is a Deviation v4.1 release on the near horizon?
bit again by the attachment code. either prvide a link, a zip or verify the size is small enough (<2MB)

Please Log in or Create an account to join the conversation.

More
12 Jun 2015 05:27 #33905 by mwm
Sigh. It's a 139K file. I guess we can't upload pdf's.

Let's try zipping it up.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.
Attachments:

Please Log in or Create an account to join the conversation.

More
12 Jun 2015 15:45 #33926 by PhracturedBlue
Replied by PhracturedBlue on topic Is a Deviation v4.1 release on the near horizon?
I have added latex and latexpdf targets to the makefile that you can play with if you like. sphinx isn't dealing with the svg files, it is done by rst2pdf (via inkscape as you noticed), so I think you'll be stuck there in trying to get it handled properly. The other extensions I'm using should work though.

Honestly, your manual looks like it was generated by latex. Most manuals I've seen that are generated by latex have a distinctive style. There are probably ways around that (the symfony manual doesn't have that look for example). But I don't know what I get by using latex if I can do everything I want with rst2pdf.

Is there a standard Serif font?
You can go into source/styles/devo.style and try replacing 'TimesRoman' with 'Serif' and see what happens

I have completed the 'Transmitter' chapter for both devo10 and devo8.

you can:
make pdf TARGET=devo10
to get the devo10 version

I cleaned up the conditional syntax a bit too. The text isn't as readable as I'd like, but I'm not sure what options exist for managing the differences in text and layout between the manuals. The only thing I can think of that I haven't tried yet is a 2-column page with text on the left and images on the right (i.e. without using flow). The Range Test page would benefit from that layout I think. If I can get that working, I can't think of anything else in the other chapters that I haven't handled in the 1st 7.

Please Log in or Create an account to join the conversation.

More
12 Jun 2015 19:21 #33952 by mwm
The point of TeX (at least to me) is that you get a design from someone who actually knows about designing books, rather than the typical tech manual look of a pastiche of things from computer UI people. To paraphrase Tufte, after reading tech manuals for a while, I want to read a well-designed book.

TeX has a number of different styles available. You can set them by adding setting 'docclass' in the latex_elements For instance, I set it to IEEE Transactions format, and got the attached document. Note that you get two-column output, but the images are unusable. You can also set options for the document clas there.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.
Attachments:

Please Log in or Create an account to join the conversation.

More
12 Jun 2015 19:45 #33957 by mwm
Cool. I added an epub target, and actually got a reasonable document. I have much nicer readers for epub than pdf on my android phones, so this is definitely a win!

Do you mind if I push these epub/latex changes to the repository? They should impact the pdf build at all.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
12 Jun 2015 20:10 #33961 by Moeder
That one looks really nice to me. Just needs some new and properly scaled images. But very readable and appealing (ok, I admit, I am LaTeX fan... :whistle: )!

mwm wrote: For instance, I set it to IEEE Transactions format, and got the attached document. Note that you get two-column output, but the images are unusable. You can also set options for the document clas there.

Please Log in or Create an account to join the conversation.

More
13 Jun 2015 00:05 #33976 by PhracturedBlue
Replied by PhracturedBlue on topic Is a Deviation v4.1 release on the near horizon?
I checked in epub support, though the html view looks much nicer.

What are the changes for latex? probably I'd rather you submit a pull request so I can see what needs changing

I am personally happy with the layout I've been using for the manual since the beginning and would rather not change it. With a couple small images per section, I haven't seen an alternative which is as space-efficient.

I've got rst2pdf working the way I like now, so I'll work on adding the rest of the chapters.

Please Log in or Create an account to join the conversation.

More
13 Jun 2015 04:14 #33983 by mwm
I'd be surprised if the HTML version looked better in my ebook reader. While it can load HTML, the results are generally so unreadable it's configured to mostly ignore HTML formatting. But epub isn't about looks, it's about using it as an ebook. Trying to use HTML for that generally sucks because HTML has never been intended for that. The needs of the two end uses are sufficiently different that ebook readers make lousy HTML display devices, and web browsers make lousy ebook readers. For instance, epub has a standard format for the ToC, so my ebook reader has a command to open the ToC and then jump to a section. Never seen that work on an HTML file, or a web browser with such a feature.

I probably won't do much with the latex stuff, and definitely not before you're finished with it. You were so obviously unhappy with the formatting from other tools, I figured you were happy with the formatting you had and wouldn't really want to change to something TeXish. I only bothered to try the pandoc version because I already had all the tools in place. I do feel obligated to point out that pandoc can convert the RST verion to LaTeX, which would then allow us to use the LyX GUI editor. Not sure how it will deal with conditional text, and it preserves structure as opposed to layout, so probably not interesting either.

I did notice that both the LaTeX and epub version managed to not get the chapters right. They both seem to start with the sections in the overview as chapters, then switch to finding the right thing in later chapters. I thought this might be an issue with the SVG files not being handled by latexpdf, but the epub builder doesn't complain about them, and also has the problem. Possibly a difference in the interpretation of the rst structure between the rst2pdf builder and the other two? Maybe something you introduced? If you don't feel like looking into it, I'll try and get to it after you're done. The epub version is something I'm interested in having, as opposed to a pdf-generated-by-latex, which is really only interesting for the differences in the tool set.

On the font issues - where did you get those Times-Roman-Oblique fonts? My normal font set is a commercial postscript package I bought ages ago. I installed the urwfont package recommended for use on FreeBSD for "high-quality common fonts". Both of them are missing those fonts. They both have Times-<variant> with Roman as a variant instead of Times-Roman<-Variant>, and Italic instead of Oblique variants of the font. Googling for Times-Roman-Oblique doesn't turn up anything. Changing the devo.style file to use the fonts I actually have does solve the problem, And the manual looks a lot better that way. Sans headers with serif body fonts is one of the abominations practiced by tech manuals.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum