Use margins at the document level (versus indent) in default styles (#67)

* Use margins at the document level (versus indent) in default styles

* Fix tests per the style changes in the previous commit
This commit is contained in:
Christian Rocha
2020-05-21 17:03:59 +02:00
committed by GitHub
parent fe80668412
commit e859bb067c
12 changed files with 91 additions and 89 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ var (
BlockPrefix: "\n", BlockPrefix: "\n",
BlockSuffix: "\n", BlockSuffix: "\n",
}, },
Indent: uintPtr(2), Margin: uintPtr(2),
}, },
BlockQuote: ansi.StyleBlock{ BlockQuote: ansi.StyleBlock{
StylePrimitive: ansi.StylePrimitive{}, StylePrimitive: ansi.StylePrimitive{},
@@ -122,7 +122,7 @@ var (
BlockSuffix: "\n", BlockSuffix: "\n",
Color: stringPtr("252"), Color: stringPtr("252"),
}, },
Indent: uintPtr(2), Margin: uintPtr(2),
}, },
BlockQuote: ansi.StyleBlock{ BlockQuote: ansi.StyleBlock{
StylePrimitive: ansi.StylePrimitive{}, StylePrimitive: ansi.StylePrimitive{},
@@ -335,7 +335,7 @@ var (
BlockSuffix: "\n", BlockSuffix: "\n",
Color: stringPtr("234"), Color: stringPtr("234"),
}, },
Indent: uintPtr(2), Margin: uintPtr(2),
}, },
BlockQuote: ansi.StyleBlock{ BlockQuote: ansi.StyleBlock{
StylePrimitive: ansi.StylePrimitive{}, StylePrimitive: ansi.StylePrimitive{},
@@ -546,7 +546,7 @@ var (
BlockPrefix: "\n", BlockPrefix: "\n",
BlockSuffix: "\n", BlockSuffix: "\n",
}, },
Indent: uintPtr(2), Margin: uintPtr(2),
}, },
BlockQuote: ansi.StyleBlock{ BlockQuote: ansi.StyleBlock{
StylePrimitive: ansi.StylePrimitive{}, StylePrimitive: ansi.StylePrimitive{},
+1 -1
View File
@@ -2,7 +2,7 @@
"document": { "document": {
"block_prefix": "\n", "block_prefix": "\n",
"block_suffix": "\n", "block_suffix": "\n",
"indent": 2 "margin": 2
}, },
"block_quote": { "block_quote": {
"indent": 1, "indent": 1,
+1 -1
View File
@@ -3,7 +3,7 @@
"block_prefix": "\n", "block_prefix": "\n",
"block_suffix": "\n", "block_suffix": "\n",
"color": "252", "color": "252",
"indent": 2 "margin": 2
}, },
"block_quote": { "block_quote": {
"indent": 1, "indent": 1,
+1 -1
View File
@@ -3,7 +3,7 @@
"block_prefix": "\n", "block_prefix": "\n",
"block_suffix": "\n", "block_suffix": "\n",
"color": "234", "color": "234",
"indent": 2 "margin": 2
}, },
"block_quote": { "block_quote": {
"indent": 1, "indent": 1,
+1 -1
View File
@@ -2,7 +2,7 @@
"document": { "document": {
"block_prefix": "\n", "block_prefix": "\n",
"block_suffix": "\n", "block_suffix": "\n",
"indent": 2 "margin": 2
}, },
"block_quote": { "block_quote": {
"indent": 1, "indent": 1,
+3 -3
View File
@@ -1,6 +1,6 @@
 If you want to make a more significant change, please first open an issue       If you want to make a more significant change, please first open an issue   
 https://github.com/twpayne/chezmoi/issues/new to discuss the change that you    https://github.com/twpayne/chezmoi/issues/new to discuss the change that you
 want to make. Dave Cheney gives a good rationale                                want to make. Dave Cheney gives a good rationale                            
 https://dave.cheney.net/2019/02/18/talk-then-code as to why this is important.  https://dave.cheney.net/2019/02/18/talk-then-code as to why this is important.
+8 -8
View File
@@ -1,10 +1,10 @@
                                                                                                                                                           
 • Getting started                                                               • Getting started                                                           
 • Developing locally                                                            • Developing locally                                                        
 • Documentation changes                                                         • Documentation changes                                                     
 • Contributing changes                                                          • Contributing changes                                                      
 • Managing releases                                                             • Managing releases                                                         
 • Packaging                                                                     • Packaging                                                                 
 • Updating the website                                                          • Updating the website                                                      
+11 -11
View File
@@ -1,13 +1,13 @@
                                                                                                                                                           
  DISTRIBUTION │ ARCHITECTURES │ PACKAGE                       DISTRIBUTION │ ARCHITECTURES │ PACKAGE                  
 ───────────────┼────────────────────────────────┼──────────                     ───────────────┼────────────────────────────────┼──────────                 
  Debian │ amd64, arm64, armel, i386, │ deb                       Debian │ amd64, arm64, armel, i386, │ deb                  
  │ ppc64, ppc64le │                       │ ppc64, ppc64le │                  
  RedHat │ aarch64, armhfp, i686, ppc64, │ rpm                       RedHat │ aarch64, armhfp, i686, ppc64, │ rpm                  
  │ ppc64le, x86_64 │                       │ ppc64le, x86_64 │                  
  OpenSUSE │ aarch64, armhfp, i686, ppc64, │ rpm                       OpenSUSE │ aarch64, armhfp, i686, ppc64, │ rpm                  
  │ ppc64le, x86_64 │                       │ ppc64le, x86_64 │                  
  Ubuntu │ amd64, arm64, armel, i386, │ deb                       Ubuntu │ amd64, arm64, armel, i386, │ deb                  
  │ ppc64, ppc64le │                       │ ppc64, ppc64le │                  
 
+4 -4
View File
@@ -1,6 +1,6 @@
                                                                                                                                                           
 • Navigation                                                                    • Navigation                                                                
   • Familiar shortcuts (arrows, ~, -, @), quick reference                         • Familiar shortcuts (arrows, ~, -, @), quick reference                   
                                                                                                                                                             
+18 -17
View File
@@ -1,20 +1,21 @@
                                                                                                                                                           
  DEPENDENCY │ INSTALLATION │ OPERATION            DEPENDENCY │ INSTALLATION │ OPERATION       
 ─────────────────────────────────┼──────────────┼─────────────────────────────────  ─────────────────────────────────┼──────────────┼─────────────────────────────────
  xdg-open (Linux), open(1) │ base │ desktop opener                 xdg-open (Linux), open(1) │ base │ desktop opener            
  (macOS), cygstart (Cygwin) │ │                                (macOS), cygstart (Cygwin) │ │                           
  file, coreutils (cp, mv, rm), │ base │ file type, copy, move and      file, coreutils (cp, mv, rm), │ base │ file type, copy, move and 
  xargs │ │ remove                         xargs │ │ remove                    
  tar, (un)zip [atool/bsdtar for │ base │ create, list, extract tar,     tar, (un)zip [atool/bsdtar for │ base │ create, list, extract tar,
  more formats] │ │ gzip, bzip2, zip               more formats] │ │ gzip, bzip2, zip          
  archivemount, fusermount(3) │ optional │ mount, unmount archives        archivemount, fusermount(3) │ optional │ mount, unmount archives   
  sshfs, rclone, fusermount(3) │ optional │ mount, unmount remotes         sshfs, rclone, fusermount(3) │ optional │ mount, unmount remotes    
  trash-cli │ optional │ trash files (default action:   trash-cli │ optional │ trash files (default      
  │ │ rm)                           action:                                                                  
  vlock (Linux), bashlock │ optional │ terminal locker (fallback:     │ │ rm)                       
  (macOS), lock(1) (BSD) │ │ cmatrix)                       vlock (Linux), bashlock │ optional │ terminal locker (fallback:
  advcpmv (Linux) (integration) │ optional │ copy, move progress            (macOS), lock(1) (BSD) │ │ cmatrix)                  
  $VISUAL (else $EDITOR), │ optional │ fallback vi, less, sh          advcpmv (Linux) (integration) │ optional │ copy, move progress       
  $PAGER, $SHELL │ │                                $VISUAL (else $EDITOR), │ optional │ fallback vi, less, sh     
  $PAGER, $SHELL │ │                           
 
+1 -1
View File
@@ -1,3 +1,3 @@
 Example:  <some directory>                                                      Example:  <some directory>                                                  
+38 -37
View File
@@ -1,39 +1,40 @@
  Gold                                                                            Gold                                                                       
                                                                                                                                                             
 Render markdown on the CLI, with pizzazz!                                       Render markdown on the CLI, with pizzazz!                                   
                                                                                                                                                             
 ## What is it?                                                                  ## What is it?                                                              
                                                                                                                                                             
 Gold is a Golang library that allows you to use JSON based stylesheets to       Gold is a Golang library that allows you to use JSON based stylesheets to   
 render Markdown files in the terminal. Just like CSS, you can define color and  render Markdown files in the terminal. Just like CSS, you can define color  
 style attributes on Markdown elements. The difference is that you use ANSI      and style attributes on Markdown elements. The difference is that you use   
 color and terminal codes instead of CSS properties and hex colors.              ANSI color and terminal codes instead of CSS properties and hex colors.     
                                                                                                                                                             
 ## Usage                                                                        ## Usage                                                                    
                                                                                                                                                             
 See cmd/gold /cmd/gold/.                                                        See cmd/gold /cmd/gold/.                                                    
                                                                                                                                                             
 ## Example Output                                                               ## Example Output                                                           
                                                                                                                                                             
 Image: Gold Dark Style →                                                        Image: Gold Dark Style →                                                    
 https://github.com/charmbracelet/gold/raw/master/styles/gallery/dark.png        https://github.com/charmbracelet/gold/raw/master/styles/gallery/dark.png    
                                                                                                                                                             
 Check out the Gold Style Gallery                                                Check out the Gold Style Gallery                                            
 https://github.com/charmbracelet/gold/blob/master/styles/gallery/README.md!     https://github.com/charmbracelet/gold/blob/master/styles/gallery/README.md! 
                                                                                                                                                             
 ## Colors                                                                       ## Colors                                                                   
                                                                                                                                                             
 Currently  gold  uses the Aurora ANSI colors                                    Currently  gold  uses the Aurora ANSI colors                                
 https://godoc.org/github.com/logrusorgru/aurora#Index.                          https://godoc.org/github.com/logrusorgru/aurora#Index.                      
                                                                                                                                                             
 ## Development                                                                  ## Development                                                              
                                                                                                                                                             
 Style definitions located in  styles/  can be embedded into the binary by       Style definitions located in  styles/  can be embedded into the binary by   
 running statik https://github.com/rakyll/statik:                                running statik https://github.com/rakyll/statik:                            
                                                                                                                                                             
   statik -f -src styles -include "*.json"                                         statik -f -src styles -include "*.json"                                   
                                                                                                                                                             
 You can re-generate screenshots of all available styles by running  gallery.sh  You can re-generate screenshots of all available styles by running          
 . This requires  termshot  and  pngcrush  installed on your system!             gallery.sh . This requires  termshot  and  pngcrush  installed on your      
 system!