Skip to content
Beafantles edited this page Mar 13, 2018 · 1 revision

Usage

Parameter name (command line) Parameter name (library) Type Default value Conditions Description
-h
--help
Displays the message with all info about how to use the command-line tool.
-v
--version
Displays the version of the command-line tool.
code string None Must be specified if file_path isn't. Must not be specified if file_path is. Specifies the code which is gonna be converted.
files
(you don't need to specify the parameter's name in the console though)
file_path command line
list of n strings

library
string
None command line


library
Must be specified if code isn't. Must not be specified if code is. The files must exist, be readable and have the correct format.
Specifies the file(s) which is (are) gonna be converted into picture(s).
-l
--language
language string None Must be a correct programming language alias. Specifies the programming language for the code / file provided.1
-o
--output
list of n string The input file name, in the png format ️ Must have a picture extension (.png, .jpeg, .bmp...). The names must not contain any space. Specifies the names of the picture files.
-sbl
--space-between-lines
space_between_lines integer 5 (pixels) ️ ❎ Specifies the space between each line.
-fn
--font-name
font_name string Hack2 ️ The font must be installed on your device3. Specifies the font.
-fp
--font-paths
font_paths list of 4 strings [] ️ The font files must exist, be readable and have the correct format. Specifies the files of the font. The order is: Regular, Italic, Bold and Bold + Italic.
-fs
--font-size
font_size integer 14 ️ Must be ≥ 1. Specifies the font size.
-p
--padding
padding integer 10 (pixels) ️ ❎ Specifies the padding.
-sln
--show-line-numbers
show_line_numbers command line


library
boolean
False ️ ❎ Specifies if the line numbers must be displayed or not.
-lnbc
--line-numbers-background-color
line_numbers_
background_color
string #151718 ️ Must be a correct hexadecimal color4. Specifies the background color of the line numbers.
-lnc
--line-numbers-color
line_numbers_color string #6D8A88 ️ Must be a correct hexadecimal color4. Specifies the color of the line numbers.
-slnb
--show-line-numbers-bold
show_line_numbers_bold command line


library
boolean
False Specifies if the line numbers must be displayed in bold or not.
-slni
--show-line-numbers-italic
show_line_numbers_italic command line


library
boolean
False Specifies if the line numbers must be displayed in italic or not.
-slns
--show-line-numbers-separator
show_line_numbers_separator command line


library
boolean
False Specifies if a separator between the line numbers and the code must be displayed or not5.
-lnp
--line-numbers-padding
line_numbers_padding integer 10 (pixels) Specifies the padding for the line numbers.
-lh
--lines-highlighted
lines_highlighted list of n integers [] Specifies the lines which must be highlighted.
-pbc
--picture-background-color
picture_background_color string #A5B2BD Must be a correct hexadecimal color4. Specifies the picture background color.
-cbc
--code-background-color
code_background_color string #151718 Must be a correct hexadecimal color4. Specifies the code background color.
-m
--margin
margin integer 30 (pixels) Specifies the margin.
-sa
--strip-all
strip_all command line


library
boolean
False Specifies if the lexer must strip all leading and trailing whitespace from the code or not.
-s
--style
style command line
string

library
string or pygments.style.Style
monokai ️ Must be a correct style6. Specifies the style for the syntax highlighting.

Footnotes

  1. Specifying the programming language explicitly ensures that the correct lexer is gonna be chosen and therefore get a good syntax highlighting. If the language isn't specified, the lexer is gonna be guessed according to the file name / code, which may be innacurate sometimes.
  2. See here for more info about this font.
  3. If the font isn't installed on your device, the default font (Hack) is gonna be used and a warning message is sent.
  4. Must match the pattern #[0-9ABCDEFabcdef]{6}.
  5. The parameter show_line_numbers_separator has no effect at the moment. It's apparently a problem from pygments library. I opened an issue and I hope this this will be fixed soon.
  6. You can specify a style among the available ones:
Show available styles
  • default
  • emacs
  • friendly
  • colorful
  • autumn
  • murphy
  • manni
  • monokai
  • perldoc
  • pastie
  • borland
  • trac
  • native
  • fruity
  • bw
  • vim
  • vs
  • tango
  • rrt
  • xcode
  • igor
  • paraiso-light
  • paraiso-dark
  • lovelace
  • algol
  • algol_nu
  • arduino
  • rainbow_dash
  • abap

If you're using the Python library, you can also create your own style. See here for more info.

If the style provided isn't correct, the default style (monokai) is gonna be used and a warning message is sent.

Clone this wiki locally