Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about python (old posts, page 19)

Son of Bartleblog VI: The flickr directive

I added a Re­struc­tured Text di­rec­tive that takes as ar­gu­ment the ti­tle of one of your (my) flickr pic­tures, like this:

.. flickr:: pa120071

And pro­duces this:

Which is much nicer than my im­ages have looked for a while.

It can still be im­proved, prob­a­bly add a cap­tion, link to im­age com­ments if avail­able, etc.

The bad side is that if you don't have in­ter­net ac­cess the ren­der­ing fail­s.

Son of bartleblog 5: Menus

Added a Ya­hoo! Ui menubar gen­er­a­tor. It turns this:

a
b
c
 1
 2
  x
  y
d

In­to this:

bartleblog4

Or this if you are us­ing links:

bartleblog5

Or rather in­to this, which ex­plains why it's nec­es­sary (con­sid­er this is a very sim­ple menu!):

<script type="text/javascript">
YAHOO.example.onMenuBarReady = function(p_oEvent)
{
    // Instantiate and render the menu bar

    var oMenuBar = new YAHOO.widget.MenuBar("None",
        {   autosubmenudisplay:true,
            hidedelay:750,
            lazyload:true
        });

    oMenuBar.render();
}

// Initialize and render the menu bar when it is available in the DOM
YAHOO.util.Event.onContentReady("None", YAHOO.example.onMenuBarReady);
</script>
        <div id="None" class="yuimenubar">
            <div class="bd">
                <ul class="first-of-type">
                    <li class="yuimenubaritem first-of-type">a </li>
                    <li class="yuimenubaritem">b</li>
                    <li class="yuimenubaritem"> c
                        <div id="c" class="yuimenu">
                            <div class="bd">
                                <ul>
                                    <li class="yuimenuitem"> 1</li>
                                    <li class="yuimenuitem"> 2
                                        <div id=" 2" class="yuimenu">
                                            <div class="bd">
                                                <ul class="first-of-type">
                                    <li class="yuimenuitem">  x</li>
                                    <li class="yuimenuitem">  y</li>
                                                </ul>
                                            </div>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </li>
                    <li class="yuimenubaritem">d</li>
                </ul>
            </div>
        </div>

Still some miss­ing fea­tures, but a neat thingie al­ready.

Son of Bartleblog IV

An­oth­er morn­ing, an­oth­er fea­ture: ar­chive

bartleblog3

Now I'm work­ing on the im­age tool, im­port­ing PyD­S's im­ages and up­load­ing to flick­r, etc.

Son of Bartleblog III

A cou­ple more hours of hack­ing, and the tem­plates are all new, and more func­tion­al then ev­er.

bartleblog2

I am mak­ing heavy use of Ya­hoo's UI li­brary, which makes lots of things much sim­pler:

  • Lay­out us­ing Ya­hoo Grids

    I spent hours mak­ing the lay­out you see now, and the one with Grids works bet­ter and was done in min­utes. Avoid rein­ven­t­ing the wheel works for we­b­­pages, too.

  • Cal­en­­dar us­ing Ya­hoo Cal­en­­dar

    Is­n't it neat? And it work­s, too. Since the link­ing is han­­dled by javascript I may make it so it loads the posts for a month with­­out reload­­ing the page.

  • Styling us­ing their re­set.c­ss stylesheet.

    That stylesheet re­­moves all styling from your page. That way, if there's some­thing there, you put it.

    I used that, added a slight­­ly sim­­pli­­fied stylesheet based on Fire­­fox's de­­fault, Re­struc­­tured Tex­t's and Sil­ver­ci­­ty's, and all the cus­­tomiz­ing I need­ed to do to achieve a sim­­ple but func­­tion­al lay­out were 30 lines of CSS, com­­pared to the rather mon­strous py­d­s.c­ss my blog cur­ren­t­­ly us­es.

  • Mod­­u­lar thin­­gies.

    I turned all Tech­no­rati/HaloScan/Feed­Burn­er/Talkr thin­­gies in­­­to macros that take as con­­fig­u­ra­­tion your per­­son­al da­­ta (for ex­am­­ple, HaloScan ID) and if nec­es­sary a post.

If the styling was a lit­tle more done and a few bugs were ironed, I may even start up­load­ing the site us­ing bartle­blog in­stead of PyDS soon :-)

Son of Bartlebog II

Af­ter a few more hours hack­ing, it's got the fol­low­ing work­ing:

  • Cher­ry­Tem­­plate tem­­plates that do about the same as the Chee­­tah tem­­plates in PyDS

  • Gen­er­ates the whole site and it looks just the same

  • Ad­vo­ga­­to im­­port (my blog should go all the way back to 2000 when I switch!)

  • PyDS im­­port

The main miss­ing things are:

  • Do a de­­cent tem­­plat­ing sys­tem (right now they are em­bed­d­ed in the code)

  • Do a de­­cent con­­fig sys­tem (right now, glob­al var­i­ables)

  • Do up­­load­­ing (or just trust lft­p)

  • Do post/s­­to­ry cre­a­tion

  • Port the RSS tem­­plate

  • Flickr in­­te­­gra­­tion

  • In­­te­­gra­­tion with all those neat lit­­tle gad­get­s: feed­burn­er flares, HaloScan com­­ments which are cur­ren­t­­ly kin­­da graft­ed (on­­ly work for my ac­­count ;-)

  • Look in­­­to Ya­hoo UI tool­k­it for things like the cal­en­­dar and menus.

  • Add the ex­­tra stuff to Re­struc­­tured Text so it:

    • Fix­es au­­­to­­­mat­i­­­cal­­­ly links to post­s/s­­­to­ries in the blog

    • Pret­­­ty-prints code us­ing Sil­ver­­Ci­­­ty

  • Lots of UI stuff

All in al­l, not re­al­ly a huge amount of work, but I am tak­ing it easy.

When KDE4 is out, a ver­sion with a ful­l-fled­get KHTML in it will be a whole lot nicer.


Contents © 2000-2020 Roberto Alsina