All Projects β†’ mre β†’ Prettyprint

mre / Prettyprint

Licence: other
Beautifully formatted output for your terminal 🌈

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Prettyprint

nord-atom-syntax
An arctic, north-bluish clean and elegant Atom syntax theme.
Stars: ✭ 72 (-63.08%)
Mutual labels:  syntax-highlighting, color
Nord Visual Studio Code
An arctic, north-bluish clean and elegant Visual Studio Code theme.
Stars: ✭ 749 (+284.1%)
Mutual labels:  syntax-highlighting, color
vim-yami
Monochromatic dark(ι—‡) theme for Vim
Stars: ✭ 58 (-70.26%)
Mutual labels:  syntax-highlighting, color
Yowish.vim
A dark & yellowish vim colorscheme
Stars: ✭ 125 (-35.9%)
Mutual labels:  syntax-highlighting, color
Nord Jetbrains
An arctic, north-bluish clean and elegant JetBrains IDE UI and editor color theme.
Stars: ✭ 293 (+50.26%)
Mutual labels:  syntax-highlighting, color
Nord Vim
An arctic, north-bluish clean and elegant Vim theme.
Stars: ✭ 1,987 (+918.97%)
Mutual labels:  syntax-highlighting, color
Brackeys Ide
πŸ‘¨β€πŸ’» Brackeys IDE is a fast and free multi-language code editor for Android.
Stars: ✭ 154 (-21.03%)
Mutual labels:  syntax-highlighting
Css3
The most complete CSS support for Sublime Text
Stars: ✭ 178 (-8.72%)
Mutual labels:  syntax-highlighting
Codehub
A UWP GitHub Client
Stars: ✭ 162 (-16.92%)
Mutual labels:  syntax-highlighting
Modern Cpp Font Lock
C++ font-lock for Emacs
Stars: ✭ 159 (-18.46%)
Mutual labels:  syntax-highlighting
Vscode Vlang
V Language extension for Visual Studio Code.
Stars: ✭ 190 (-2.56%)
Mutual labels:  syntax-highlighting
Zerobranestudio
Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
Stars: ✭ 2,255 (+1056.41%)
Mutual labels:  syntax-highlighting
Maven Color
A colorized Maven console
Stars: ✭ 177 (-9.23%)
Mutual labels:  color
Biosyntax
Syntax highlighting for computational biology
Stars: ✭ 164 (-15.9%)
Mutual labels:  syntax-highlighting
Jsome
✨ Make your JSON look AWESOME
Stars: ✭ 179 (-8.21%)
Mutual labels:  color
Color Scheme
color-scheme,ι’œθ‰²ζ–Ήζ‘ˆ,color主钘,scheme,webstrom,phpstrom,pytharm,ι…θ‰²ζ–Ήζ‘ˆ,编辑器,xfce4主钘,技眼,ζš—θ‰²,dark
Stars: ✭ 162 (-16.92%)
Mutual labels:  color
Ngx Highlightjs
Angular syntax highlighting module
Stars: ✭ 187 (-4.1%)
Mutual labels:  syntax-highlighting
Dot Hugo Documentation Theme
Dot - Hugo Documentation Theme
Stars: ✭ 162 (-16.92%)
Mutual labels:  syntax-highlighting
Bim
small terminal text editor with syntax highlighting
Stars: ✭ 174 (-10.77%)
Mutual labels:  syntax-highlighting
Color Picker
A simple color picker application written in pure JavaScript, for modern browsers.
Stars: ✭ 180 (-7.69%)
Mutual labels:  color

prettyprint

Documentation CI

Syntax highlighting library with batteries included.

⚠️ For new projects, you might want to use bat instead, which can be used as a library now. prettyprint is in maintenance mode, which means it will not see any major updates anymore, but pull requests will still be reviewed and dependencies will be kept up-to-date for the time being. You might want to consider migrating away eventually, though.

Quick start

Screenshot

The above output was created with the following code:

let printer = PrettyPrinter::default()
    .language("rust")
    .build()?;

printer.file("fixtures/fib.rs")?;

Note that prettyprint is a builder and can be customized. For example, if you don't like the grid or the header, you can disable those:

let printer = PrettyPrinter::default()
    .header(false)
    .grid(false)
    .language("ruby")
    .build()?;

let example = r#"
def fib(n)        
    return 1 if n <= 1
    fib(n-1) + fib(n-2)
end
"#;
printer.string_with_header(example, "fib.rb")?;

"What!? It can also print strings, Matthias? That's insane."
It's true. You're welcome.

Installation

Add this to your Cargo.toml:

prettyprint = "*"

But why?

syntect is a great package for highlighting text.
When writing a command-line tool that prints text however, you might be looking for some additional functionality.

  • Line numbers
  • More built-in color-themes
  • Automatic pagination
  • Proper terminal handling
  • Showing non-printable characters
  • File headers
  • Windows support

prettyprint offers all of this in one crate (thanks to bat).

Known limitations

  • Doesn't run on no-std targets. I don't plan to support those.

Credits

prettyprint is simply a fork of bat, with some functionality stripped out and bundled up as a library. I built it, because I needed it for cargo-inspect. All credits go to the original authors.

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].