New mini-project: Gyro
History
Facubatista: ralsina, yo, vos, cerveza, un local-wiki-server-hecho-en-un-solo-.py-con-interfaz-web en tres horas, pensalo
Facubatista: ralsina, you, me, beer, a local-wiki-server-done-in-one-.py-with-web-interface in three hours, think about it
So, I could not get together with Facu, but I did sort of write it, and it's Gyro. 1
Technical Details
Gyro has two parts: a very simple backend, implemented using Sanic 2 which does a few things:
Serve static files out of
_static/
Serve templated markdown out of
pages/
Save markdown to
pages/
Keep an index of file contents updated in
_static/index.js
The other part is a webpage, implemnted using Bootstrap 3 and JQuery 4. That page can:
Show markdown, using Showdown 5
Edit markdown, using SimpleMDE 6
Search in your pages using 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://localhost:8000/MyPage
: GOODhttp://localhost:8000/MyDir/MyPage
: BADhttp://localhost:8000/__foobar__
: 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 FooBar](FooBar)
There is really not much else to say about it, if you try it and find bugs, file an issue and as usual patches are welcome.
- 1
-
Why Gyro? Gyros are delicious fast food. Wiki means quick. Also, I like Gyros. to check it out. So, since this was a toy project, why not?
- 2
-
Why Sanic? Ever since Alejandro Lozanoff mentioned a flask-like framework done with the intention to be fast and async I wanted
- 3
-
Why bootstrap? I know more or less what it does, and the resulting page is not totally horrible.
- 4
-
Why JQuery? It's easy, small and I sort of know how it works.
- 5
-
Why Showdown? It's sort of the standard to show markdown on the web.
- 6
-
Why SimpleMDE? It looks and works awesome!
- 7
-
Why Lunr? It works and is smaller than Tipue which is the only other similar thing I know.
Muy lindo!
P.D.: A Batista le faltó terminar la propuesta con el clásico "ol de nait" XD