Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Publicaciones sobre rst2pdf (publicaciones antiguas, página 7)

rst2pdf: casi listo para sphinx

Ese tu­to­ria­l, co­mo to­da la do­cu­men­ta­ción nue­va de py­tho­n, usa sphi­nx.

Ya que sphi­nx es muy po­pu­lar, quie­ro que rs­t2­pdf fun­cio­ne lo me­jor po­si­ble pa­ra pro­du­cir sus PDFs. En­ton­ce­s, con dos co­sas pi­can­do, me em­pe­cé a ras­ca­r.

Ha ha­bi­do al­gún pro­gre­so. Si bien los cam­bios en sphi­nx es­tán só­lo en mi com­pu­ta­do­ra, los voy a pu­bli­car pron­to, y los cam­bios en rs­t2­pdf ya es­tán en SVN.

Acá hay una mues­tra pa­ra abrir el ape­ti­to.

AAFigure en rst2pdf

Que sig­ni­fi­ca? Que po­dés po­ner es­to en tu do­cu­men­to:

+-------+       +-------+
|   A   |------>|   B   |
+-------+       +-------+

Y ob­te­nés es­to (y co­mo par­te del PDF, no co­mo ima­gen, así que se pue­de co­piar el tex­to­):

/static/aafigure.png

Así que es una bue­ní­si­ma ma­ne­ra de ha­cer dia­gra­mas sim­ples en tus do­cu­men­tos de res­truc­tu­red text que se ven bien en tex­to pla­no, en la we­b, y en PDF.

Aafi­gu­re pue­de crear mon­to­nes de dia­gra­mas in­te­re­san­tes, mi­rá el ma­nual pa­ra ver ejem­plo­s.

Ac­tual­men­te re­quie­re aafi­gu­re de bzr (0.3 no al­can­za).

Rst2pdf 0.11 liberado!

It's my plea­su­re to an­noun­ce the re­lea­se of rs­t2­pdf ver­sion 0.11, avai­la­ble at http://­co­de.­google.­co­m/­p/rs­t2­pdf/­do­wn­load­s/­list

Rs­t2­pdf is a tool to ge­ne­ra­te PDF fi­les di­rec­tly from res­truc­tu­red text sour­ces via re­por­tla­b.

This ver­sion in­clu­des many bu­gfixes and so­me new fea­tu­res com­pa­red to the pre­vious 0.10.1 ver­sio­n, in­clu­ding but not li­mited to em­be­dding PDF ima­ges, mu­ch im­pro­ved ima­ge si­zin­g, ni­cer list la­you­ts, be­tter sty­lin­g, pa­ge ba­ck­groun­d­s, and mo­re than 15 bugs fixe­d. A fu­ll chan­ge­log is in­clu­ded at the bo­ttom of this me­ss­age.

Rs­t2­pdf ai­ms to su­pport the fu­ll res­truc­tu­red text fea­tu­re se­t, and is ve­ry clo­se to that goa­l, whi­le al­so in­clu­ding so­me of the mo­re ex­pe­ri­men­tal fea­tu­res, like a sour­ce co­de di­rec­ti­ve wi­th syn­tax hi­gh­li­gh­ting and ma­th no­ta­tion su­pport wi­th La­TeX-­like syn­ta­x.

It su­ppor­ts em­be­dding ar­bi­tra­ry fon­ts, bo­th True Ty­pe and PS Ty­pe 1, bo­th ras­ter and vec­tor ima­ges (in­clu­ding SV­G), pa­ge tran­si­tion effec­ts, mul­ti­ple, fle­xi­ble pa­ge la­you­ts, cas­ca­ding sty­le­s, and mu­ch, mu­ch mo­re.

You can find mo­re in­for­ma­tion about rs­t2­pdf in its ho­me pa­ge ( http://rs­t2­pdf.­google­co­de.­com), and ask an­y­thing you want in the rs­t2­pdf- dis­cuss mai­ling list (http://­group­s.­google.­co­m/­grou­p/rs­t2­pdf-­dis­cuss)

He­re are the chan­ges in this ver­sion com­pa­red to 0.10.1:

  • De­­gra­­de mo­­­re gra­­ce­­fu­­lly when one or mo­­­re wo­r­­da­­xe hy­­phe­­na­­tors are bro­­ken (cu­­rren­­tly DWC is the bro­­ken one)

  • Fixed is­­sue 132: in so­­­me ca­ses, wi­­th use­­r-­­de­­fi­­ned fo­n­­tA­­lia­s, bold and ita­­lic would get co­n­­fu­s­ed (ge­­tting ita­­lic in­s­­tead of bold in in­­li­­ne ma­­rku­­p, for in­s­­tan­­ce).

  • New sty­­le­s­heet no­­-­­co­m­­pa­c­­t-­­lis­­ts to make lis­­ts... le­ss co­m­­pact

  • SVG ima­­ges now han­d­­le % as a wi­­dth unit co­­­rre­c­­tl­­y.

  • Im­­ple­­men­ted is­­sue 127: su­­pport ima­­ges in PDF fo­r­­ma­­t. Ri­­ght now they are ra­s­­te­­ri­­ze­­d, so it's not idea­­l. Perhaps so­­­me­­thing be­­­tter wi­­ll co­­­me up la­­te­­r.

  • Fixed is­­sue 129: make it wo­­­rk around a pr­­blem wi­­th Kee­p­­To­­­ge­­ther in RL 2.1 it pro­­­ba­­bly makes the ou­­tput look wo­r­­se in so­­­me ca­­ses when using tha­­t. RL 2.1 is not rea­­lly su­­ppor­te­­d, so added a wa­r­­ni­n­­g.

  • Fixed is­­sue 130: use os.­­pa­­thsep in­s­­tead of ":" si­n­­ce ":" in wi­n­­do­­ws is us­ed in disk na­­mes (and we sti­­ll pay for DOS idio­­­c­­y, in 2009)

  • Fixed is­­sue 128: hea­­dings le­­vel 3+ all looked the sa­­me

  • Ugly bu­­gfix for Is­­sue 126: cra­s­hes when using ima­­ges in hea­­der + TOC

  • New ts­­ty­­les se­c­­tion in the sty­­le­s­heet pro­­­vi­­des mo­­­re co­n­­fi­­gu­­ra­­ble list la­­you­­ts and mo­­­re po­­we­r­­ful ta­­ble sty­­li­n­­g.

  • Be­­­tter syn­­tax hi­­gh­­li­­gh­­ting (su­­ppo­r­­ts bo­l­­d/i­­ta­­li­­c)

  • Wo­­­rka­­round for is­­sue 103 so you can use bo­r­­de­r­­Pa­­dding as a list (but it wi­­ll look wrong if you are using wo­r­­da­­xe <= 0.3.2)

  • Added fie­l­­d­­va­­lue sty­­le for field lis­­ts

  • Added op­­tio­n­­list ts­­ty­­le, for op­­tion lis­­ts

  • Added co­­­lle­c­­tion of uti­­li­­ty sty­­le­s­hee­­ts and do­­­cu­­men­ted it

  • Im­­pro­­­ved co­­­m­­mand li­­ne pa­r­­sing and sty­­le­s­heet loading (guess ex­­ten­­sion like la­­test rs­­t2­­la­­tex does)

  • Fixed Is­­sue 67: co­m­­ple­­te­­ly new list la­­you­­ting co­­­de

  • Fixed Is­­sue 116: cra­s­hes cau­s­ed by hu­­ge ima­­ges

  • Be­­­tter su­­pport for %wi­­dth in ima­­ges, n2ow it's % of the co­n­­tai­­ner fra­­me's wi­­dth, not of the text area.

  • Fixed bug in SVG sca­­ling

  • Be­­­tter han­d­­ling of mis­­sing ima­­ges

  • Added mis­­sing sty­­les abs­­tra­c­­t, co­n­­ten­­ts, de­­di­­ca­­tion to the de­­fault sty­­le­s­heet

  • Ta­­bles sty­­le su­­pport spa­­ce­­Be­­­fo­­­re and spa­­ceA­­fter

  • New to­­­pi­­c-­­ti­­tle sty­­le for to­­­pic ti­­tles (o­b­­vious ;-)

  • Ve­r­­ti­­cal ali­g­n­­ment for in­­li­­ne ima­­ges (:­a­­li­g­n: pa­­ra­­me­­te­­r)

  • Is­­sue 118: Su­­pport for :s­­ca­­le: in ima­­ges and han­d­­le re­­si­­zing of in­­li­­ne ima­­ges

  • Is­­sue 119: Fix pla­­ce­­ment of hea­­ders and footers

  • New ba­­ck­­ground pro­­­pe­r­­ty for pa­­ge te­m­­pla­­tes (ni­­ce for pre­sen­­ta­­tio­n­s, for exa­m­­ple)

  • De­­fault to px for ima­­ge wi­­dth spe­­ci­­fi­­ca­­tions in­s­­tead of pt

  • Su­­pport all re­­qui­­red mea­­su­­re­­ment uni­­ts ("e­­m" "ex" "px" "i­n" "cm" "m­­m" "p­­t" "p­­c" "%" "")

  • New au­­to­­­mated scri­p­­ts to che­­ck test ca­­ses for "vi­­sual di­­ffe­­ren­­ce­s"

  • Res­­pect ima­­ges DPI pro­­­pe­r­­ty a bit like rs­­t2­­la­­tex does.

  • Is­­sue 110: New --i­n­­li­­ne-­­footno­­­tes op­­tion

  • Tes­ted wi­­th re­­po­r­­tlab from SVN trunk

  • Su­­pport for Di­­nu Ghe­r­­man's sv­­gli­­b. If bo­­­th sv­­glib and uni­­co­n­­ve­r­­tor are avai­­la­­ble, sv­­glib is pre­­fe­­rred (for SV­­G, of cou­r­se). Pa­­tch ori­­gi­­na­­lly by ru­­te.

  • Is­­sue 109: Se­­pa­­ra­­te sty­­les for ea­­ch kind of ad­­mo­­­ni­­tion

  • For Is­­sue 109: mis­­sing sty­­les are not a fa­­tal error

  • Is­­sue 117: TO­­­Cs wi­­th mo­­­re than 6 le­­vels now su­­pported (rai­s­ed li­­mit to 9, whi­­ch is si­­lly dee­­p)

Reporte de avances en rst2pdf

Al fi­nal de es­te post vas a en­con­trar una lis­ta (tal vez in­com­ple­ta), pe­ro que­ría com­par­tir un par de avan­ces re­la­ti­va­men­te gran­de­s.


Pre­sen­ta­cio­nes

Ven­go que­rien­do ha­cer que rs­t2­pdf sea útil pa­ra pre­sen­ta­cio­nes des­de ha­ce bas­tan­te tiem­po. Y se es­tá acer­can­do.

Es­toy es­cri­bien­do un pe­que­ño tu­to­rial del te­ma, pe­ro ya se pue­de ver una de­mo.

Los cam­bios que la han he­cho po­si­ble so­n:

  • Arre­­glé bugs en el la­­yout de la pá­­gi­­na

  • Agre­­gué so­­­po­r­­te pa­­ra fo­n­­dos de pá­­gi­­na (i­n­­clu­­yen­­do SV­­G!)

Es­to es en gran me­di­da gra­cias a que`­Cé­sar Ro­da­s`_ que­ría usar al­go sim­ple y ba­sa­do en tex­to pa­ra su pre­sen­ta­ción a Zen­dCo­n, me pre­gun­tó y me da­ba ver­güen­za dar­le una co­sa que no fun­cio­na­ba.

Ven co­mo fun­cio­na? Me ma­ne­ja la ver­güen­za. Que ver­güen­za.


Gran­des me­jo­ras en es­ti­los

Los cam­bios re­la­cio­na­dos son mu­chí­si­mos (ver aba­jo­), pe­ro tam­bién fué por un mo­ti­vo: quie­ro ha­cer do­cu­men­tos más lin­do­s.

En­ton­ce­s, ya que a mu­cha gen­te pa­re­ce gus­tar­le es es­ti­lo de Sphi­n­x, qui­se ha­cer uno si­mi­la­r.

Lo lo­gré? Si y no, mi­ren:

web-sphinxrst2pdf-sphinx

Igual eso es só­lo un bo­rra­do­r, no mi­ré los fon­ts, ni el pe­so de los en­ca­be­za­do­s, ni si­quie­ra que es­que­ma de co­lo­res usa pa­ra el có­di­go.

De to­das ma­ne­ra­s, aún es­te sty­les­heet mí­ni­mo me hi­zo en­con­trar una do­ce­na de bugs y pro­ble­mas en rs­t2­pdf.

Mo­ra­le­ja: por fa­vor dí­gan­me que pue­den y qué no pue­den ha­cer con rs­t2­pdf por­que hay áreas que ni mi­ro!


Lo úl­ti­mo es... el pr­óxi­mo re­lea­se va a es­tar bue­ní­si­mo. Pe­ro siem­pre di­go lo mis­mo, no?


Cam­bios has­ta ho­y:

  • Wo­­­rka­­round for is­­sue 103 so you can use bo­r­­de­r­­Pa­­dding as a list (but it wi­­ll look wrong if you are using wo­r­­da­­xe <= 0.3.2)

  • Added fie­l­­d­­va­­lue sty­­le for field lis­­ts

  • Added op­­tio­n­­list ts­­ty­­le, for op­­tion lis­­ts

  • Added co­­­lle­c­­tion of uti­­li­­ty sty­­le­s­hee­­ts and do­­­cu­­men­ted it

  • Im­­pro­­­ved co­­­m­­mand li­­ne pa­r­­sing and sty­­le­s­heet loading (guess ex­­ten­­sion like la­­test rs­­t2­­la­­tex does)

  • Fixed Is­­sue 67: co­m­­ple­­te­­ly new list la­­you­­ting co­­­de

  • Fixed Is­­sue 116: cra­s­hes cau­s­ed by hu­­ge ima­­ges

  • Be­­­tter su­­pport for %wi­­dth in ima­­ges, n2ow it's % of the co­n­­tai­­ner fra­­me's wi­­dth, not of the text area.

  • Fixed bug in SVG sca­­ling

  • Be­­­tter han­d­­ling of mis­­sing ima­­ges

  • Added mis­­sing sty­­les abs­­tra­c­­t, co­n­­ten­­ts, de­­di­­ca­­tion to the de­­fault sty­­le­s­heet

  • Ta­­bles sty­­le su­­pport spa­­ce­­Be­­­fo­­­re and spa­­ceA­­fter

  • New to­­­pi­­c-­­ti­­tle sty­­le for to­­­pic ti­­tles (o­b­­vious ;-)

  • Ve­r­­ti­­cal ali­g­n­­ment for in­­li­­ne ima­­ges (:­a­­li­g­n: pa­­ra­­me­­te­­r)

  • Is­­sue 118: Su­­pport for :s­­ca­­le: in ima­­ges and han­d­­le re­­si­­zing of in­­li­­ne ima­­ges

  • Is­­sue 119: Fix pla­­ce­­ment of hea­­ders and footers

  • New ba­­ck­­ground pro­­­pe­r­­ty for pa­­ge te­m­­pla­­tes (ni­­ce for pre­sen­­ta­­tio­n­s, for exa­m­­ple)

  • De­­fault to px for ima­­ge wi­­dth spe­­ci­­fi­­ca­­tions in­s­­tead of pt

  • Su­­pport all re­­qui­­red mea­­su­­re­­ment uni­­ts ("e­­m" "ex" "px" "i­n" "cm" "m­­m" "p­­t" "p­­c" "%" "")

  • New au­­to­­­mated scri­p­­ts to che­­ck test ca­­ses for "vi­­sual di­­ffe­­ren­­ce­s"

  • Res­­pect ima­­ges DPI pro­­­pe­r­­ty a bit like rs­­t2­­la­­tex does.

  • Is­­sue 110: New --i­n­­li­­ne-­­footno­­­tes op­­tion

  • Tes­ted wi­­th re­­po­r­­tlab from SVN trunk

  • Su­­pport for Di­­nu Ghe­r­­man's sv­­gli­­b. If bo­­­th sv­­glib and uni­­co­n­­ve­r­­tor are avai­­la­­ble, sv­­glib is pre­­fe­­rred (for SV­­G, of cou­r­se). Pa­­tch ori­­gi­­na­­lly by ru­­te.

  • Is­­sue 109: Se­­pa­­ra­­te sty­­les for ea­­ch kind of ad­­mo­­­ni­­tion

  • For Is­­sue 109: mis­­sing sty­­les are not a fa­­tal error

  • Is­­sue 117: TO­­­Cs wi­­th mo­­­re than 6 le­­vels now su­­pported (rai­s­ed li­­mit to 9, whi­­ch is si­­lly dee­­p)


Contents © 2000-2024 Roberto Alsina