Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Publicaciones sobre python (publicaciones antiguas, página 87)

La Matemática Funciona

Do­cu­tils so­por­ta usar ma­te­má­ti­ca en tus tex­tos des­de ha­ce un tiem­po. Eso de­be­ría sig­ni­fi­car que Niko­la tam­bién lo so­por­ta. Pe­ro nun­ca fun­cio­nó por­que... bue­no, por­que na­die lo ha­bía in­ten­ta­do?

¡Pe­ro aho­ra sí fun­cio­na por­que Da­mian Avi­la lo arre­gló!

Leer más…

Nikola 5.3 released

I am ha­ppy to an­noun­ce the re­lea­se of ver­sion 5.3 of Niko­la a sta­tic blo­g/­si­te ge­ne­ra­to­r. It in­clu­des so­me mi­nor fea­tu­res and a good amount of bu­gfi­xin­g. Upgra­ding to it should not cau­se you any trou­ble, as far as I kno­w.

He­re's the chan­ge­lo­g:


  • Boots­­trap 2.3.0

  • Op­­tio­­­na­­lly use co­n­­tent dis­­tri­­bu­­tion ne­­two­­­rks for jque­­ry and twi­­tte­­r-­­boots­­trap (U­SE_­­CDN op­­tio­­n)

  • Im­­pro­­­ve pro­­­gres­­si­­ve ren­­de­­ring by mo­­­ving ja­­va­s­­cript to the bo­­­ttom of pa­­ges

  • New Bra­­zi­­lian po­r­­tu­­gue­­se tran­s­­la­­tio­­n.

  • New pla­­ne­­toid ex­­pe­­ri­­men­­tal ex­­tra_­­plu­­gin


  • Make rea­­lly su­­re we im­­port the ri­­ght co­n­­f.­­py

  • Make SLU­­G_­­TA­­G_­­PA­­TH a co­n­­fig dep for most pa­­ges

  • Re­­mo­­­ved me­­ta ti­­tle tag for be­­­tter HT­­ML va­­li­­da­­tion

  • Re­­mo­­­ved #999 ba­­ck­­ground from footno­­­te ba­­ck­­li­nk.

  • Ma­­de footno­­­te re­­fe­­ren­­ces be su­­per­s­­cri­p­­te­­d.

  • Cen­­te­­red fi­­gu­­re's ima­­ge and ca­p­­tio­­n.

  • Re­­mo­­­ved ou­­tset bo­r­­der from ad­­mo­­­ni­­tio­n­s.

  • Use de­­fault the­­me as last re­­sou­r­­ce for me­ss­a­ges/­­tran­s­­la­­tions

  • DA­­TE_­­FO­R­­MAT op­­tion was being ig­­no­­­red

  • Re­­mo­­­ve trai­­ling "" on wi­n­­do­­ws ga­­lle­­ry li­nks (Is­­sue #298)

  • In­­co­n­­sis­­tent brea­­d­­crumbs in ga­­lle­­ry pa­­ges (Is­­sue #303)

  • Use sou­r­­ce fi­­les as bun­d­­le de­­pen­­den­­cies in­s­­tead of ou­­tpu­­ts (Is­­sue #294)


Nikola 5.2 released!

I am th­ri­lled to an­noun­ce that you can now do­wn­load Niko­la 5.2. a new ver­sion of my sta­tic blo­g/­si­te ge­ne­ra­to­r.

Wha­t's new in this ver­sio­n? A LOT. Do­n't let the mi­nor ver­sion ti­ck fool you, this ver­sion is pa­cked wi­th good­ness. Le­t's start wi­th fea­tu­res:

You can ea­si­ly em­bed mo­re con­ten­t:

  • New vi­­meo di­­re­c­­ti­­ve for res­­tru­c­­tu­­red tex­­t.

  • Cus­­tom "gis­­t" di­­re­c­­ti­­ve pro­­­vi­­ding reS­­tru­c­­tu­­red text su­­pport for Gi­­tHub gis­­ts.

You can wri­te your con­tent in al­most any ma­rku­p:

  • Tex­­ti­­le ma­­rkup su­­ppo­r­­t.

  • Creo­­­le Wiki ma­­rkup su­­ppo­r­­t.

  • tx­­t2­­tags ma­­rkup su­­ppo­r­­t.

  • bb­­co­­­de ma­­rkup su­­ppo­r­­t.

  • And of cou­r­se, it sti­­ll su­­ppo­r­­ts reS­­tru­c­­tu­­red tex­­t, Ma­­rk­­do­­wn and HT­­M­­L.

Mo­re lan­gua­ges:

  • New Ca­­ta­­lá tran­s­­la­­tion

  • New po­­­lish tran­s­­la­­tio­­n.

  • New Si­m­­pli­­fied Chi­­ne­­se tran­s­­la­­tio­­n.

  • Use mu­l­­ti­­li­n­­gual Dis­­qus (a­l­­thou­­gh it does­n't seem to wo­­­rk)

You can im­port your da­ta:

  • New Blo­­­gge­­r/­­Blogs­­pot im­­po­r­­ter

  • Mu­­ch im­­pro­­­ved Wo­r­­dpress im­­po­r­­ter

  • Ex­­tract me­­ta­­da­­ta from fi­­le­­na­­me by using re­­gexp (he­l­­pful for im­­po­r­­ting from oc­­to­­­press or other sys­­te­­ms).

You can do fan­cier and mo­re con­fi­gu­ra­ble si­tes:

  • One-­­pa­­ge, dy­­na­­mi­­c-­­loadi­n­­g, clien­­t-­­ren­­de­­red si­­te plu­­gin (ta­sk_­­mus­­ta­­che)

  • Re­­cu­r­­si­­ve po­s­­t/s­­to­­­ry fo­l­­ders

  • New CO­­­M­­MEN­­TS_I­N_­­GA­­LLE­­RIES and CO­­­M­­MEN­­TS_I­N_S­­TO­­­RIES op­­tio­n­s.

  • Lo­­­cal sea­r­­ch ba­s­ed on Ti­­pue (ex­­tra_­­plu­­gi­n­s/­­ta­sk_­­lo­­­ca­l­­sea­r­­ch)

  • Added co­­­m­­men­­ts to ima­­ge ga­­lle­­ries

  • New op­­tion RSS_­­TEA­­SERS

  • New STO­­­R­­Y_I­N­­DEX op­­tion to ge­­ne­­ra­­te in­­dex.h­t­­ml in sto­­­ry fo­l­­de­r­s.

  • Add multi si­­ze fa­­vi­­con su­­ppo­r­­t.

You can use Py­thon 2.6 or hi­gher ... in­clu­ding Py­thon 3. The on­ly mis­sing bit for fu­ll Py­thon 3 su­pport is Google site­map ge­ne­ra­tio­n.

And of cour­se, a lot of bugs got smas­he­d:

  • Added sa­­ne de­­fau­l­­ts for most op­­tio­n­s, so you can ha­­ve a lean co­n­­fig fi­­le.

  • Ma­­de la­­yout of the si­­te the­­me res­­po­n­­si­­ve, wi­­th co­­­lla­p­­sing na­­v­­ba­­r.

  • Use ti­­me­­li­­ne in­s­­tead of pa­r­­sing po­s­­t_­­pa­­ges in ge­­ne­­ri­­c_­­pa­­ge_­­ren­­de­­rer and ta­sk_­­ren­­de­­r_­­pa­­ges.

  • Up­­dated dis­­qus in­­te­­gra­­tion co­­­de, added iden­­ti­­fiers so it wo­­­rks on any UR­­L.

  • Make su­­re fo­l­­der li­nks end in "/" in the ga­­lle­­ry co­­­de.

  • Re­­mo­­­ved co­­­py of Py­R­SS2­­Gen, ma­­de it a de­­pen­­den­­c­­y.

  • De­­tect "na­­me­s­­pa­­ce" de­­pen­­den­­cies for Mako te­m­­pla­­tes.

  • Use co­n­­sis­­tent en­­co­­­dings in RSS fee­­d­s.

  • Re­­fa­c­­to­­­red dis­­qus co­­­de in­­to se­­pa­­ra­­te he­l­­pers

  • Use the co­­­rrect ex­­ten­­sion (or rai­­se an erro­­­r) on new_­­post

  • Fix ti­­tles that in­­clu­­de quo­­­tes

  • Up­­dated to cu­­rrent CSS from do­­­cu­­tils (was using ve­r­­sion from 2005)

  • Avoid nee­­d­­le­ss re­­ge­­ne­­ra­­tion of ga­­lle­­ry in­­dexes.

  • Alwa­­ys en­­su­­re the fo­l­­der for the new post exis­­ts.

  • Get ti­­tle from fi­­le­­na­­me if not avai­­la­­ble in me­­ta­­da­­ta.

  • Do­­n't co­­­py sou­r­­ces if they end in ".h­t­­m­­l"

  • Do­­n't li­nk to une­­xis­­ting tran­s­­la­­tio­n­s.

  • Sort tags ca­­se in­sen­­si­­ti­­ve.


Feature del almuerzo en Nikola: Importador de Blogger

Hoy al me­dio­día, hi­ce un im­por­ta­dor pa­ra blogs de blo­gger (pue­de ser que tam­bién blo­gpos­t? Pa­re­cen ser lo mis­mo) en Niko­la mi mo­tor de si­tios y blogs es­tá­ti­co­s.

¿Qué funciona?

Bue­no, el úni­co si­tio que tra­té fun­cio­na, pa­re­ce.

  • Po­s­­ts

  • Pa­­ges

  • Tags

  • Dra­­fts

  • Blog Me­­ta­­da­­ta (s­a­l­­vo len­­gua­­je)

  • Re­­di­­re­c­­ts pa­­ra man­­te­­ner las URLs es­­ta­­bles (¡­­lo in­­ten­­ta!)

  • Rees­­cri­­tu­­ra de URLs en los po­s­­ts (¡­­tra­­ta!)

¿Qué falta?
  • Im­­po­r­­tar co­­­men­­ta­­rios (tie­­ne mas sen­­ti­­do im­­po­r­­ta­r­­los via Dis­­qus)

  • Atta­­ch­­men­­ts (i­­má­­ge­­nes y eso)

  • Pro­­­ba­r­­lo

Es­tá mas o me­nos a la par del im­por­ta­dor de Wor­dpress, sal­vo que na­die lo usó de ver­da­d. ¡A­sí que sién­tan­se li­bres de pro­bar­lo!

(Es niko­la im­por­t_­blo­gger nom­bre_­de­l_­dum­p.­x­m­l)

Refreshed rst-cheatsheet

A whi­le ago, I created a 2-­pa­ge PDF ver­sion of the res­truc­tu­red text qui­cks­tart meant to be printe­d, fol­ded in half and kept handy un­til you fi­na­lly re­mem­ber how to do footno­tes (10 years and sti­ll wai­tin­g, in my ca­se).

It was brou­ght to my atten­tion that the gi­thub pro­ject did not men­tion how to build it. Then I no­ti­ced that not on­ly it did­n't ex­plain tha­t, it was al­so mis­sing cri­ti­cal fi­le­s.

So, I added the fi­le­s, fixed a cou­ple of things that we­re not wo­rking per­fec­tly wi­th the la­test rs­t2­pdf and the­re is now a fresh PDF ready for you!

Contents © 2000-2022 Roberto Alsina