diff --git a/README.md b/README.md new file mode 100644 index 0000000..837fd80 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# limoni + + ekşi sözlük favorilerinizi .docx formatında arşivleyin. + +## İndirme + +[buradaki](https://github.com/mucahitkurtlar/limoni/releases) adresten kullanmak istediğiniz platform için uygun sürümü indirin. Kullanmaya başlamadan önce arşiv dosyasını açın. + +## Kullanım + +limoni'yi indirdikten sonra klasör içerisindeki çalıştırılabilir dosyayı _(GNU/Linux ve macOS için `limoni`, Windows için `limoni.exe`)_ çalıştırın. Uygulama tarayıcınızda açılacaktır. Tarayıcınızda açılmazsa uygulama açıkken [buradaki](http://localhost:4455) adresi ziyaret edin. Sonrasında nick'inizi ilgili alana girin ve arşivlemek istediğiniz entryleri ayıklayın. Bitirmek istediğinizde `bitir` butonuna basarak arşivleme işlemini sonlandırabilir ve arşiv dosyasını indirebilirsiniz. \ No newline at end of file diff --git a/cmd/limoni/main.go b/cmd/limoni/main.go index 6abfc36..06f78bd 100644 --- a/cmd/limoni/main.go +++ b/cmd/limoni/main.go @@ -35,6 +35,7 @@ func main() { app.Get("/entry", router.EntryGetHandler(store, favCollector)) app.Post("/entry", router.EntryPostHandler(favCollector, favFile)) app.Get("/download", router.DownloadGetHandler(favFile)) + app.Get("/exit", router.ExitGetHandler()) utils.OpenInBrowser(fmt.Sprintf("http://localhost:%v", config.Port)) log.Fatal(app.Listen(fmt.Sprintf(":%v", config.Port))) diff --git a/pkg/router/routes.go b/pkg/router/routes.go index 74879ad..bc97b59 100644 --- a/pkg/router/routes.go +++ b/pkg/router/routes.go @@ -93,3 +93,11 @@ func DownloadGetHandler(favFile *model.FavFile) func(c *fiber.Ctx) error { return c.SendFile(favFile.GetFilePath()) } } + +func ExitGetHandler() func(c *fiber.Ctx) error { + return func(c *fiber.Ctx) error { + // exit the program + os.Exit(0) + return nil + } +} diff --git a/web/static/style.css b/web/static/style.css index 34a412a..66daa49 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -83,6 +83,11 @@ a { font-size: 2em; } +.exit { + margin-top: 1rem; + margin-right: 2rem; +} + .subtitle { font-size: .5em; } diff --git a/web/template/entry.html b/web/template/entry.html index 93a25c0..953da0f 100644 --- a/web/template/entry.html +++ b/web/template/entry.html @@ -2,51 +2,51 @@
- - - - -