Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about wiki

New mini-project: Gyro

History

Facu­batis­ta: ralsi­na, yo, vos, cerveza, un lo­cal-wik­i-server-he­cho-en-un-­solo-.py-­con-in­ter­faz-web en tres ho­ras, pen­sa­lo

Facu­batis­ta: ralsi­na, you, me, beer, a lo­cal-wik­i-server-­done-in-one-.py-with­-we­b-in­ter­face in three hours, think about it

/images/gyro-1.thumbnail.png

The next day.

So, I could not get to­geth­er with Facu, but I did sort of write it, and it's Gy­ro. [1]

Technical Details

Gy­ro has two part­s: a very sim­ple back­end, im­ple­ment­ed us­ing San­ic [2] which does a few things:

  • Serve stat­ic files out of _stat­ic/

  • Serve tem­plat­ed mark­down out of pages/

  • Save mark­down to pages/

  • Keep an in­dex of file con­tents up­dat­ed in _stat­ic/in­dex.js

The oth­er part is a web­page, im­plem­nt­ed us­ing Boot­strap [3] and JQuery [4]. That page can:

  • Show mark­­down, us­ing Show­­down [5]

  • Ed­it mark­­down, us­ing Sim­­pleMDE [6]

  • Search in your pages us­ing Lunr [7]

And that's it. Open the site on any URL that doesn't start with _static and contains only letters and numbers:

  • http://lo­­cal­host:8000/My­­Page : GOOD

  • http://lo­­cal­host:8000/My­Dir/My­­Page: BAD

  • http://lo­­cal­host:8000/__­­foo­bar__: BAD

At first the page will be sort of empty, but if you edit it and save it, it won't be empty anymore. You can link to other pages (even ones you have not created) using the standard markdown syntax: [go to Foo­Bar](­Foo­Bar)

There is re­al­ly not much else to say about it, if you try it and find bugs, file an is­sue and as usu­al patch­es are wel­come.



Contents © 2000-2024 Roberto Alsina