Skip to content

Commit

Permalink
🔖 Ready for v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
makew0rld committed Jul 10, 2020
1 parent 9b89859 commit bde371c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions amfora.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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" {
Expand Down
1 change: 1 addition & 0 deletions display/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
`)

Expand Down
7 changes: 4 additions & 3 deletions structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}

0 comments on commit bde371c

Please sign in to comment.