Use glamour and termev to render/colorize content #181

Merged
lunny merged 9 commits from 6543/tea:use-glamour into master 2 years ago
6543 commented 2 years ago
Collaborator

close #146
close #49

use glamour to render markdon for detail views

  • for repos
  • for issues
  • ...

and use glamour's dependency termev to colorize

  • label color field

close #146 close #49 use glamour to render markdon for detail views - for repos - for issues - ... and use glamour's dependency **termev** to colorize - label color field ![](https://gitea.com/attachments/09e75127-52aa-4fec-96bd-5aa89f149768) ![](https://gitea.com/attachments/77c35850-9f2d-42a8-8c90-e2574e8c2aac)
6543 added this to the v0.5.0 milestone 2 years ago
6543 added the
kind/feature
label 2 years ago
6543 added 5 commits 2 years ago
6543 changed title from use-glamour to Use glamour and termev to render/colorize content 2 years ago
6543 added the
status/needs-reviews
label 2 years ago
6543 added 1 commit 2 years ago
763aeb5e68 Merge branch 'master' into use-glamour
Collaborator

Nice!

This renders badly on a light-themed terminal for me though.
You could use termenv.HasDarkBackground() to set the glamour theme to "light" or "dark".

Also, note that this feature increases build size from 17mb to 25mb. But I guess that's worth it..?

Nice! This renders badly on a light-themed terminal for me though. You could use `termenv.HasDarkBackground()` to set the glamour theme to `"light"` or `"dark"`. Also, note that this feature increases build size from 17mb to 25mb. But I guess that's worth it..?
Poster
Collaborator

for me tea with all patches: 17M (17694720b)

for me tea with all patches: `17M` (17694720b)
6543 added 1 commit 2 years ago
1e3fb11148 Merge branch 'master' into use-glamour
6543 added
status/wip
and removed
status/needs-reviews
labels 2 years ago
Poster
Collaborator

wip: because of HasDarkBackground()

wip: because of HasDarkBackground()
6543 added 1 commit 2 years ago
445007e677
select Glamour Theme based on BackgroundColor
6543 added
status/needs-reviews
and removed
status/wip
labels 2 years ago
Poster
Collaborator

@noerw hope your terminal looks now nice too :)

@noerw hope your terminal looks now nice too :)
Collaborator

@6543 nice, theming works well!

RE build size (with go version go1.13.14 linux/amd64):

  • running make results in a 20M binary for me (current master is 13M)
  • running go build results in a 25M binary (current master is 17M).

Might be a go<=1.14 issue..?

@6543 nice, theming works well! RE build size (with `go version go1.13.14 linux/amd64`): - running `make` results in a 20M binary for me (current master is `13M`) - running `go build` results in a 25M binary (current master is `17M`). Might be a go<=1.14 issue..?

@noerw go 1.15 was announced as creating smaller binaries, perhaps you could attempt building with that?

@noerw go 1.15 was announced as creating smaller binaries, perhaps you could attempt building with that?
Collaborator

Can confirm, on go 1.15 production build is 17M (compared to 11M on master).
The point still stands, this feature increases build size by more than 50%.

Considering that 11M is already totally out of place for a simple CLI, 17M is not significantly worse I guess ¯\_(ツ)_/¯ But it somehow rubs me the wrong way

Can confirm, on go 1.15 production build is 17M (compared to 11M on master). The point still stands, this feature increases build size by more than 50%. Considering that 11M is already totally out of place for a simple CLI, 17M is not significantly worse I guess ¯\\_(ツ)\_/¯ But it somehow rubs me the wrong way
Poster
Collaborator

@noerw on the one hand storage space is cheep this days ...

on the other hand: look at the tools the unix time has given us (140K /usr/bin/ls) ...

I think the 6Mb are worth it if we realy utilize this two libs
adding to mouch libs and blow up tea's binary on the other hand is bas

so I would considder only 3 legitime libs: markdown rendering (already include collor lib and syntax highliting lib), the sdk (include version lib) and in the future eventualy survey? (for interactive prompts)

@noerw on the one hand storage space is cheep this days ... on the other hand: look at the tools the unix time has given us (`140K /usr/bin/ls`) ... I think the 6Mb are worth it if we realy utilize this two libs adding to mouch libs and blow up tea's binary on the other hand is bas so I would considder only 3 legitime libs: markdown rendering (already include collor lib and syntax highliting lib), the sdk (include version lib) and in the future eventualy survey? (for interactive prompts)
Poster
Collaborator

@noerw with this and #186 the binary is 18M

gh cli tool is 19M

@noerw with this and #186 the binary is 18M `gh` cli tool is 19M
techknowlogick approved these changes 2 years ago
Dismissed
lunny approved these changes 2 years ago
Dismissed
lunny added 1 commit 2 years ago
a8b5634dcf Merge branch 'master' into use-glamour
lunny merged commit 89e93d90b3 into master 2 years ago
6543 deleted branch use-glamour 2 years ago
6543 removed the
status/needs-reviews
label 2 years ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as 89e93d90b3.
Sign in to join this conversation.
Loading…
There is no content yet.