- Posts: 4402
Is a Deviation v4.1 release on the near horizon?
- PhracturedBlue
- Offline
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.
- mwm
- Offline
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.
- PhracturedBlue
- Offline
- Posts: 4402
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.
- mwm
- Offline
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.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.
- mwm
- Offline
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.
- PhracturedBlue
- Offline
- Posts: 4402
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
Please Log in or Create an account to join the conversation.
- mwm
- Offline
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.
- PhracturedBlue
- Offline
- Posts: 4402
build/venv/bin/python
>>> import sys
>>> print sys.path
find . -name pdfbuilder.py
also, what version of python are you getting?
Please Log in or Create an account to join the conversation.
- mwm
- Offline
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.
- PhracturedBlue
- Offline
- Posts: 4402
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.
- mwm
- Offline
- I had to install inkscape first. Presumably to deal with the svg images.
- 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.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- mwm
- Offline
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.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.
- mwm
- Offline
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.
Please Log in or Create an account to join the conversation.
- mwm
- Offline
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.
- Moeder
- Offline
- Posts: 796
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.
- PhracturedBlue
- Offline
- Posts: 4402
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.
- mwm
- Offline
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.
- Home
- Forum
- Development
- Development
- Is a Deviation v4.1 release on the near horizon?