From bde371cff264e03490885617e01df652d8015add Mon Sep 17 00:00:00 2001 From: makeworld Date: Fri, 10 Jul 2020 19:16:13 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Ready=20for=20v1.3.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 +++--- amfora.go | 4 ++-- display/help.go | 1 + structs/structs.go | 7 ++++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19d90d0d..3ec2e85f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,16 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.3.0] - 2020-07-10 ### Added -- **Downloading pages and any content** (#38) +- **Downloading content** (#38) - Configurable page size limit - `page_max_size` in config (#30) - Configurable page timeout - `page_max_time` in config - Link and heading lines are wrapped just like regular text lines - Wrapped list items are indented to stay behind the bullet (#35) - Certificate expiry date is stored when the cert IDs match (#39) - What link was selected is remembered as you browse through history -- Render ANSI codes in `text/x-ansi` pages, or text pages that end with `.ans` +- Render ANSI codes in `text/x-ansi` pages, or text pages that end with `.ans` (#45) ### Changed - Pages are rewrapped dynamically, whenever the terminal size changes (#33) diff --git a/amfora.go b/amfora.go index 6ffee792..63a7cc2d 100644 --- a/amfora.go +++ b/amfora.go @@ -8,7 +8,7 @@ import ( "github.com/makeworld-the-better-one/amfora/display" ) -var version = "1.3.0-unreleased" +var version = "1.3.0" func main() { // err := logger.Init() @@ -18,7 +18,7 @@ func main() { if len(os.Args) > 1 { if os.Args[1] == "--version" || os.Args[1] == "-v" { - fmt.Println(version) + fmt.Println("amfora v" + version) return } if os.Args[1] == "--help" || os.Args[1] == "-h" { diff --git a/display/help.go b/display/help.go index ad6476a0..3481016c 100644 --- a/display/help.go +++ b/display/help.go @@ -35,6 +35,7 @@ Ctrl-R, R|Reload a page, discarding the cached version. |This can also be used if you resize your terminal. Ctrl-B|View bookmarks Ctrl-D|Add, change, or remove a bookmark for the current page. +Ctrl-S|Save the current page to your downloads. q, Ctrl-Q, Ctrl-C|Quit `) diff --git a/structs/structs.go b/structs/structs.go index dcd629ba..a33953b4 100644 --- a/structs/structs.go +++ b/structs/structs.go @@ -13,6 +13,7 @@ type PageMode int const ( ModeOff PageMode = iota // Regular mode ModeLinkSelect // When the enter key is pressed, allow for tab-based link navigation + ModeSearch // When a keyword is being searched in a page - TODO: NOT USED YET ) // Page is for storing UTF-8 text/gemini pages, as well as text/plain pages. @@ -32,9 +33,9 @@ type Page struct { // Size returns an approx. size of a Page in bytes. func (p *Page) Size() int { - b := len(p.Raw) + len(p.Content) + len(p.Url) + len(p.Selected) + len(p.SelectedID) + n := len(p.Raw) + len(p.Content) + len(p.Url) + len(p.Selected) + len(p.SelectedID) for i := range p.Links { - b += len(p.Links[i]) + n += len(p.Links[i]) } - return b + return n }