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 @@ - - - - - limoni + + + + + limoni - {{template "header" .}} -
-
-
- {{.title}} -
-
- {{.content}} -
-
-
- - - - - - - - -
-
{{.favoriteCount}}
-
-
{{.author}}
- -
-
-
- - - -
+ {{template "header" .}} +
+
+
+ {{.title}} +
+
+ {{.content}} +
+
+
+ + + + + + + +
+
{{.favoriteCount}}
+
+
{{.author}}
+ +
+
+
+ + + +
- {{template "footer" .}} +
+ {{template "footer" .}} \ No newline at end of file diff --git a/web/template/footer.html b/web/template/footer.html index a93ebc2..5848335 100644 --- a/web/template/footer.html +++ b/web/template/footer.html @@ -1,19 +1,18 @@ {{ define "footer" }} {{ end }} \ No newline at end of file diff --git a/web/template/header.html b/web/template/header.html index 3f07eb5..8ec8f7e 100644 --- a/web/template/header.html +++ b/web/template/header.html @@ -1,12 +1,28 @@ {{ define "header" }} -
+
+
-
- limoni -
-
- favorilerinizin arşivini oluşturun -
+
+ limoni +
+
+ favorilerinizin arşivini oluşturun +
+
+
{{ end }} \ No newline at end of file diff --git a/web/template/index.html b/web/template/index.html index 6c67c37..3f3569b 100644 --- a/web/template/index.html +++ b/web/template/index.html @@ -2,24 +2,24 @@ - - - - - limoni + + + + + limoni - {{ template "header" . }} -
-
-
- - -
-
+ {{ template "header" . }} +
+
+
+ + +
- {{ template "footer" .}} +
+ {{ template "footer" .}} \ No newline at end of file