From c5521ba10117854911fb449e1a89f540c5f5d8f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=81scar=20M=2E=20Lage?= Date: Sat, 19 Mar 2022 00:35:53 +0100 Subject: [PATCH] Organize docs --- README.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++- TODO.md | 18 ++++++++++++ doc/wip.md | 78 --------------------------------------------------- 3 files changed, 99 insertions(+), 79 deletions(-) create mode 100644 TODO.md delete mode 100644 doc/wip.md diff --git a/README.md b/README.md index df159f1..97c31ad 100644 --- a/README.md +++ b/README.md @@ -1 +1,81 @@ -# wikingo +# Wikingo + +A minimal personal wiki written in Go Lang + +## Features + +* Markdown -> HTML +* Basic HTML (with Water CSS, for example) + * requires serving static content +* One level pages (e.g. http://host/PageName/) + * view version (default latest) + * old version -> restore + * delete + * edit + * list history (changes -> view version) +* Normalize URLs + * e.g. reidrect page/ -> page + +### Stretch goals + +1. List pages + * optionally filter by tag + * pagination +2. Search + * query into title (e.g. PageName), tags + * full text? + * n results, pagination not needed +3. Auth for protected pages + * edit, restore +4. Atom feed for updated pages (last n) +5. Detect the page has changed before post + * show warning + +## Stack + +* Storage: sqlite with [GORM](https://gorm.io/) + * easy queries + * struct -> tables + * auto-migrations +* HTTP server: [Echo](https://echo.labstack.com/) + * easy to use + * routes + * static content + * middleware (e.g. auth, remove trailing slash) +* Templates + * needed? [html/template](https://pkg.go.dev/html/template) + * not super-easy to use +* Markdown -> HTML: [Blackfriday](https://github.com/russross/blackfriday) + +## Routes + +| Method | URL | Notes | +| --- | --- | --- | +| GET | / | alias for WikiHome | +| GET | /:page(/:version)? | version is optional, defaults to "latest" | +| GET | /:page/edit | protected | +| POST | /:page/edit | protected | +| GET | /:page/history | | +| POST | /:page/restore/:version | protected | +| DELETE | /:page/:version | protected | +| GET | /list(/:tag)? | tag is optional, stretch goal | +| POST | /search | stretch goal | +| GET | /atom.xml | stretch goal | + +:page in format CamelCase (starts uppercase) +:version is numeric +:tag is string + +## Model: Page + +* Page name +* version +* change description +* created on +* updated on +* tags (e.g. tag1:tag2:tag3) +* body + + +(thanks [reidrac](http://github.com/reidrac), [MrReidrac](https://twitch.tv/reidrac)) + diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..dbf6cab --- /dev/null +++ b/TODO.md @@ -0,0 +1,18 @@ +# TODO + +## General +> General options +- [ ] Flag to select store +- [ ] Config file (to select store and some other future options) +- [ ] Proper logger +- [ ] Make helper +- [ ] CI (gofmt, golint, more)? + +## Bootstrap +> Basic elements +- [x] Echo server +- [x] Sample Model +- [x] Store interface (gorm, file...) + - [x] Open db store + - [ ] Open file store +- [x] Templates diff --git a/doc/wip.md b/doc/wip.md deleted file mode 100644 index 922a4fc..0000000 --- a/doc/wip.md +++ /dev/null @@ -1,78 +0,0 @@ -# Minimal personal wiki in Go - -## Features - -* Markdown -> HTML -* Basic HTML (with Water CSS, for example) - * requires serving static content -* One level pages (e.g. http://host/PageName/) - * view version (default latest) - * old version -> restore - * delete - * edit - * list history (changes -> view version) -* Normalize URLs - * e.g. reidrect page/ -> page - -### Stretch goals - -1. List pages - * optionally filter by tag - * pagination -2. Search - * query into title (e.g. PageName), tags - * full text? - * n results, pagination not needed -3. Auth for protected pages - * edit, restore -4. Atom feed for updated pages (last n) -5. Detect the page has changed before post - * show warning - -## Stack - -* Storage: sqlite with [GORM](https://gorm.io/) - * easy queries - * struct -> tables - * auto-migrations -* HTTP server: [Echo](https://echo.labstack.com/) - * easy to use - * routes - * static content - * middleware (e.g. auth, remove trailing slash) -* Templates - * needed? [html/template](https://pkg.go.dev/html/template) - * not super-easy to use -* Markdown -> HTML: [Blackfriday](https://github.com/russross/blackfriday) - -## Routes - -| Method | URL | Notes | -| --- | --- | --- | -| GET | / | alias for WikiHome | -| GET | /:page(/:version)? | version is optional, defaults to "latest" | -| GET | /:page/edit | protected | -| POST | /:page/edit | protected | -| GET | /:page/history | | -| POST | /:page/restore/:version | protected | -| DELETE | /:page/:version | protected | -| GET | /list(/:tag)? | tag is optional, stretch goal | -| POST | /search | stretch goal | -| GET | /atom.xml | stretch goal | - -:page in format CamelCase (starts uppercase) -:version is numeric -:tag is string - -## Model: Page - -* Page name -* version -* change description -* created on -* updated on -* tags (e.g. tag1:tag2:tag3) -* body - - -(thanks [reidrac](http://github.com/reidrac), [MrReidrac](https://twitch.tv/reidrac))