[Bf-docboard] About a new PDF version of the wiki

marco ardito ardito at apiform.to.it
Thu Sep 12 16:25:32 CEST 2013


Hi all, thanks for replying.

Further details that could add discussion points:
1) on a good internet line (10Mbit/s fiber I have here at my job place) 
the whole process take half an hour to complete, download included. If 
run locally (or on a LAN) this could take much less. I can't use wiki 
markup directly, I still need the wiki to generate html (but cached 
static html pages could work...).

2) a PDF version, I think, could be useful in many ways:
- of course when you're offline (I know of people that needs this: eg, 
see 
http://blenderartists.org/forum/showthread.php?290425-Blender-Wiki-Offline-Manual&p=2419755&viewfull=1#post2419755 
and other threads there)
- It's easier to print, and could look better.
- it has page numbers, so if you're teaching in a classroom, you can 
make all students refer to a fixed PDF page, and without the need for an 
internet connection
- It's a kind of a "snapshot" (I can see "what's changed" simply running 
a diff tool :-) )
- it could be rendered in different formats (archive.org kinda helps you 
automatically "deriving" other formats, like an online version, and many 
mobile, dejavu, etc but, eg, honestly their epub conversion really sucks...)
- formats like PDF it can be annotated (someone told me he needs this)
- once it was hosted also here http://pdf.letworyinteractive.com/ a mini 
site Nathan Letwory gently provided me for free (before archive.org), 
but I've lost the admin credentials to check download count, but I 
remember it was huge!
I even created a logo with Inkscape: 
http://pdf.letworyinteractive.com/templates/ja_purity/images/logo.png to 
repalce the standard joomla one.

3) "the process" is actually a php script, but  it could be translated 
it in other scripting langs if better suited (python?): the requirements 
are pretty basic:
=> to get/adapt wiki pages html: remote file downloading, strings 
management, local file creation
=> to create the pdf: http://code.google.com/p/wkhtmltopdf, which should 
run pretty anywhere, should be run by the script with some (cli) arguments.

4) @Mirek: in short, the script
=> downloads the "wiki manual" TOC page, and gets all the (640+) wiki 
pages links, in the same order, in a list.
=> then it downloads all the links as html, one by one.
=> for each downloaded page html, the script;
- cuts off all the stuff not needed (headers/footers, bars, etc)
- scans html tags for images/files and downloads them locally
- converts the images/files links in html to load locally stored 
images/files links
- fixes or strips html that is not useful in "printed" docs (eg: 
embedded video are replaced by a visible link to the same video, if 
possible)
- appends the resulting html to a big, big html file (which ends up 
containing the whole wiki manual...)
=> at the end of the 640+ "download&adapt" cycle, I have one single html 
file and a folder full of images/files, and the big, big html file (~6 
MB latest release) has links for local images/fiels, of course. You 
could open it in a browser, I think!
=> at last, it calls wkhtmltopdf passing the big html file to the guy, 
along with some "formatting" arguments and options. A few seconds, and 
you have a (arguably) nice PDF.

hope this helps you to understand how I did it.

Ok, enough boring stuff..
let me know what you think, if you wish... any suggestion is welcome!

Marco

> Hi all,
> in the past (2.4x) I already did a Blender wiki > PDF conversion, ...



-------------------
[Ai sensi e per  gli  effetti della Legge sulla tutela della privacy
(L. 196/2003), questa  mail  è destinata unicamente alle persone sopra
indicate e le informazioni in essa contenute sono da considerarsi
strettamente riservate. E' proibito leggere, copiare, usare o
diffondere il contenuto della presente mail senza autorizzazione.
Se avete ricevuto questo messaggio per errore, siete pregati di
rispedire la stessa al mittente. Grazie]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-docboard/attachments/20130912/31d4fd1c/attachment.htm 


More information about the Bf-docboard mailing list