Skip to main content

Ralsina.Me — Roberto Alsina's website

New Nikola Feature: code listings

This is a new fea­ture in Niko­la, my stat­ic web­site and blog gen­er­a­tor.

It's aimed at show­ing pieces of files in the post­s, and giv­ing you a link to the full file, does rea­son­able syn­tax high­light thanks to pyg­ments, and the syn­tax for em­bed­ding in your posts is not ex­ces­sive­ly aw­ful, so I can use it for some of my tu­to­ri­al / book project­s.

Here's an ex­am­ple:

.. listing:: md.py python
   :start-at: def compile_html
   :end-before: output =

This is not merged in­to mas­ter yet, but should be soon.

PyCamp Day 1

Go­ing to sleep, so here's a quick run­down of my 1st day at Py­cam­p:

  • Woke up at 6AM, and af­ter tak­ing train­s, bus­es and au­­to­­mo­­biles, ar­rived around noon. Place is nice, wheather is cold. Beds are bunks.

  • Pre­sen­t­ed ideas, vot­ed work­ing slots

  • Im­­ple­­men­t­ed a Niko­la fea­­ture to get themes from http://­­bootswatch.­­com

  • Im­­ple­­men­t­ed first draft of pipe­­lines for post-pro­cess­ing gen­er­at­ed files

  • Martín Gaitán is work­ing on im­prov­ing the im­age gal­­leries

  • Hugo Rus­c­it­ti is do­ing some cel­ery+flask mag­ic to cre­ate a Niko­la host­ing ser­vice

  • Had fun with lots of oth­­er things and talk­ing with a lot of peo­­ple.

  • Played some ta­ble ten­­nis (won 1, lost 1)

  • Got a fire­­fox t-shirt

  • Got a Nin­­ja-IDE mug that changes colour with tem­per­a­­ture.

Now, ex­haust­ed, go­ing to bed.

BA Chili Cookoff

Last sat­ur­day I at­tend­ed the 2nd Buenos Aires Chili Cookof­f. Lots of peo­ple, lots of great food. I was with my kid and he can't eat any­thing that spicy, but hey, there were cook­ies :-)

//ralsina.me/galleries/random/chili.thumbnail.jpg

How crowd­ed was it? About three times this crowd was there.

I had lit­tle ex­pe­ri­ence with Chili, be­cuase it's not ex­act­ly a com­mon dish around here, so, sur­prised by the va­ri­ety, and most were quite nice, and de­spite ex­haus­tive warn­ings by the cook­s, none was uned­i­bly spicy (the dread­ed Zom­bie Chili which promised to melt my mouth? Kin­da sweet and bland.)

Favourite? Lafit­te's re­venge, which re­al­ly was a sort of bean-free bour­guignon. Al­so, the smoked veg­gie chili was quite awe­some. And the cook­ies were killer­s!

Next year, my wife is talk­ing about cook­ing for it. I have had her chili, and I trust she can do bet­ter than 80% of the con­tes­tants this year. Plus I get to be­ta test her recipes, so win/win for me.

Nikola Ideas for PyCamp

This fri­day is the be­gin­ning of Py­Cam­p, four days of python hack­ing with­out dis­trac­tion or pause. And I want to code a lot. My main tar­get is fea­tures for Niko­la my stat­ic blog gen­er­a­tor.

If you are at­tend­ing Py­Camp (or even if you are not), you are wel­come to join me in im­ple­ment­ing these in a marathon of kick­ass cod­ing start­ing this fri­day and last­ing all week­end.

I have a few ideas in my head, but I want more. These are the ones I have, please add more in the com­ments if you have any:

Code Gallery

Like im­age gal­leries but for code. Put code in a fold­er and it will be beau­ti­ful­ly dis­played. With the ad­di­tion of a "list­ings" do­cu­tils di­rec­tive, it will make show­ing code in de­tail and in con­text easy and pow­er­ful, and make Niko­la more at­trac­tive to pro­gram­mer-blog­ger­s.

Gallery Polishing

Im­age gal­leries are im­ple­ment­ed and work, but they could use a lot of pol­ish. From mak­ing them more net­work-­ef­fi­cien­t, to im­age RSS feed­s, re­cur­sive gal­leries, gallery meta­data, im­age texts, and much more.

File Pipelines

Want to min­i­mize your CSS? Tidy your HTM­L? pngcrush your im­ages? ap­ply HTML trans­for­ma­tion­s? Oth­er things I can't imag­ine?

File pipe­lines would bring the pow­er of the unix shell to a site gen­er­a­tor, let­ting you con­nect lego-­like fil­ter­s, some pro­vid­ed, some from the com­mu­ni­ty, in­to a pow­er­ful ma­chin­ery.

Online Editing (Alva)

While stat­ic site gen­er­a­tors have lots of ben­e­fit­s, they have one sig­nif­i­cant down­sid­e: you ed­it the files in your own de­vice. A on­line ed­i­tor for Niko­la lets you ed­it them through a web in­ter­face for blog­ging-from-ay­where good­ness.

Nikola Hosting (Shoreham)

Why not cre­ate a ser­vice where the us­er feeds posts to a serv­er and then the serv­er pub­lish­es them? The feed­ing can be via a DVC­S, or a file sync ser­vice, or via on­line ed­i­tors, and the out­put is pub­lished au­to­mat­i­cal­ly or at the push of a but­ton.

Drafts

I don't do draft­s. I type and that's it. But oth­ers pre­fer more cau­tious and sane ap­proach­es. So, how should drafts work? While the fea­ture may be easy to im­ple­men­t, it's a good be­gin­ner pro­gram­mer's task, where you have to think more about what you want to achieve and pro­vid­ing a good us­er ex­pe­ri­ence than about just bang­ing code.

So, is there some­thing you saw in an­oth­er stat­ic blog gen­er­a­tor and Niko­la lack­s? Any cool ideas and want a friend­ly code­base to hack them on? Do you have any crazy ideas noone would touch with a ten-­foot-pole but you think would be awe­some to have?

Well, now's a good time to talk about it!


Contents © 2000-2023 Roberto Alsina