All Projects → foxfriends → paper-terminal

foxfriends / paper-terminal

Licence: other
Print Markdown to a paper in your terminal

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to paper-terminal

yachalk
🖍️ Terminal string styling done right
Stars: ✭ 131 (+296.97%)
Mutual labels:  console, color, ansi
strip-ansi-stream
Strip ANSI escape codes
Stars: ✭ 32 (-3.03%)
Mutual labels:  console, color, ansi
concolor
Colouring template strings using tags with annotations 🎨
Stars: ✭ 35 (+6.06%)
Mutual labels:  console, color, ansi
Mordant
Full-featured text styling for Kotlin command-line applications
Stars: ✭ 382 (+1057.58%)
Mutual labels:  console, color, ansi
leeks.js
Simple ANSI styling for your terminal
Stars: ✭ 12 (-63.64%)
Mutual labels:  console, color, ansi
go-color
A lightweight, simple and cross-platform package to colorize text in terminals
Stars: ✭ 65 (+96.97%)
Mutual labels:  console, color, ansi
Chalk
🖍 Terminal string styling done right
Stars: ✭ 17,566 (+53130.3%)
Mutual labels:  console, color, ansi
Rang
A Minimal, Header only Modern c++ library for terminal goodies 💄✨
Stars: ✭ 1,080 (+3172.73%)
Mutual labels:  console, color, ansi
log-utils
Basic logging utils: colors, symbols and timestamp.
Stars: ✭ 24 (-27.27%)
Mutual labels:  console, color, ansi
Lazyhub
lazyhub - Terminal UI Client for GitHub using gocui.
Stars: ✭ 133 (+303.03%)
Mutual labels:  console, viewer
Htop
htop - an interactive process viewer
Stars: ✭ 3,076 (+9221.21%)
Mutual labels:  console, viewer
ansicolor
A JavaScript ANSI color/style management. ANSI parsing. ANSI to CSS. Small, clean, no dependencies.
Stars: ✭ 91 (+175.76%)
Mutual labels:  console, ansi
Box Cli Maker
Make Highly Customized Boxes for your CLI
Stars: ✭ 115 (+248.48%)
Mutual labels:  console, color
Console Logging
Better, prettier commandline logging for Python--with colors! 👻
Stars: ✭ 111 (+236.36%)
Mutual labels:  console, color
Cypress Terminal Report
Better terminal and file output for cypress test logs.
Stars: ✭ 200 (+506.06%)
Mutual labels:  console, print
Chalk Animation
🎬 Colorful animations in terminal output
Stars: ✭ 1,489 (+4412.12%)
Mutual labels:  console, color
Multiplex
View output of multiple processes, in parallel, in the console, with an interactive TUI
Stars: ✭ 91 (+175.76%)
Mutual labels:  console, viewer
Php Console Spinner
Colorful highly configurable spinner for php cli applications (suitable for async apps)
Stars: ✭ 225 (+581.82%)
Mutual labels:  console, color
json-peek
Stringify JSON *just enough* to see what it is
Stars: ✭ 33 (+0%)
Mutual labels:  print, pretty
pytermgui
Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!
Stars: ✭ 1,270 (+3748.48%)
Mutual labels:  console, ansi

Paper terminal

dependency status

See paper.png to see what this looks like!

Writes a file to a paper in your terminal. Especially if that file is Markdown! Features supported include:

  1. The usual text, and paragraphs with automatic line-wrapping. You can manually wrap with
    hard breaks as expected.

    Otherwise, paragraphs will be nicely spaced.

  2. Headings

  3. Bold / Italic / Bold and Italic / Strikethrough

  4. Lists

    • Ordered
    • Unordered
      • Nested
  5. Rules

  6. Inline code

  7. Code blocks, with syncat integration for syntax highlighting. Note that you must install syncat and make the syncat executable available on your path for this to work.

    fn main() {
        println!("Hello world");
    }
  8. Blockquotes

    Blockquotes

    And even nested block quotes

  9. And even images! Here's a photo of my cat

    My cat. His name is Cato

  10. Task lists:

    • Easy
    • Hard
  11. Footnotes1

  12. Tables

Comparison with other command line Markdown renderers

Not a very good comparison... this is more of an example of a table!

Tool CommonMark Paper Paging Wrapping Syntax Images Tables Looks good*
foxfriends/paper-terminal Yes Yes No Yes syncat Pixelated Yes Yes
ttscoff/mdless Yes No Yes No pygmentize Sometimes Yes No
lunaryorn/mdcat Yes No No No syntect Sometimes No No

* subjective

Styling

Paper uses syncat stylesheets to allow full customization of styling. See the default stylesheet (src/default.syncat) as an example of how this works. To override the default styles, create paper.syncat in your active syncat theme.

  • Different scopes are represented as nodes, inspired by the corresponding HTML tag names.

    • h1 through h6
    • strong
    • emphasis
    • strikethrough
    • code
    • blockquote
    • ul, ol, li
    • footnote-ref, footnote-def, footnote
    • table
    • caption
    • link
  • The paper and shadow can be matched with paper and shadow. Styles applied to paper are applied to everything.

  • The "prefix" and "suffix" tokens can be used to match the decorations

    • List item bullets
    • Blockquote markers
    • Code block margins
  • The "lang-tag" token matches the language name written in the bottom corner of the code block

  • You can apply styles to code blocks with a specific language by using the language name as the token

For now, the prefix/suffix contents are not customizable, but this may be added in future if it is desired.

Installation

Paper can be installed from crates.io using Cargo:

cargo install paper-terminal

Usage

# Print the help
paper --help

# Render README.md
paper README.md

# Render README.md, with syntax highlighting
paper README.md -s
paper 0.1.0
Cameron Eldridge <[email protected]>
Prints papers in your terminal

USAGE:
    paper [FLAGS] [OPTIONS] [file]...

FLAGS:
        --dev          Print in debug mode
        --help         Prints help information
    -u, --hide-urls    Hide link URLs
    -i, --no-images    Disable drawing images
    -p, --plain        Don't parse as Markdown, just render the plain text on a paper
    -s, --syncat       Use syncat to highlight code blocks. Requires you have syncat installed.
    -V, --version      Prints version information

OPTIONS:
    -h, --h-margin <h-margin>    Horizontal margin (overrides --margin)
    -m, --margin <margin>        Margin (shortcut for horizontal and vertical margin set to the same value) [default:
                                 6]
    -v, --v-margin <v-margin>    Vertical margin (overrides --margin)
    -w, --width <width>          The width of the paper (including the space used for the margin) [default: 92]

ARGS:
    <file>...    Files to print

Footnotes

  1. This is the footnote!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].