CLI Help Documentation¶
reprex --help
Usage: reprex [OPTIONS]
Render reproducible examples of Python code for sharing. Your code will be
executed and, in the default output style, the results will be embedded as
comments below their associated lines.
By default, your system's default command-line text editor will open for you
to type or paste in your code. This editor can be changed by setting the
VISUAL or EDITOR environment variable, or by explicitly passing in the
--editor program. You can instead specify an input file with the --infile / -i
option. If IPython is installed, an interactive IPython editor can also be
launched using the --ipython flag.
Additional markup will be added that is appropriate to the choice of venue
formatting. For example, for the default `gh` venue for GitHub Flavored
Markdown, the final reprex output will look like:
----------------------------------------
```python
arr = [1, 2, 3, 4, 5]
[x + 1 for x in arr]
#> [2, 3, 4, 5, 6]
max(arr) - min(arr)
#> 4
```
<sup>Created at 2021-02-27 00:13:55 PST by
[reprexlite](https://github.com/jayqi/reprexlite) v1.0.0a1</sup>
----------------------------------------
The supported venue formats are:
- gh : GitHub Flavored Markdown
- so : StackOverflow, alias for gh
- ds : Discourse, alias for gh
- html : HTML
- py : Python script
- rtf : Rich Text Format
- slack : Slack
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --editor -e TEXT Specify editor to │
│ open in. Can be │
│ full path to │
│ executable or │
│ name to be │
│ searched on │
│ system search │
│ path. If None, │
│ will use Click's │
│ automatic editor │
│ detection. This │
│ will typically │
│ use the editor │
│ set to │
│ environment │
│ variable VISUAL │
│ or EDITOR. If │
│ value is │
│ 'ipython' and │
│ IPython is │
│ installed, this │
│ will launch the │
│ interactive │
│ IPython editor │
│ where all cells │
│ are automatically │
│ run through │
│ reprexlite. │
│ [default: None] │
│ --infile -i PATH Read code from an │
│ input file │
│ instead of │
│ entering in an │
│ editor. │
│ [default: None] │
│ --outfile -o PATH Write output to │
│ file instead of │
│ printing to │
│ console. │
│ [default: None] │
│ --venue -v [gh|so|ds|html| Key to identify │
│ py|rtf|slack] the output venue │
│ that the reprex │
│ will be shared │
│ in. Used to │
│ select an │
│ appropriate │
│ formatter. See │
│ "Venues │
│ Formatting" │
│ documentation for │
│ formats included │
│ with reprexlite. │
│ [default: gh] │
│ --advertise --no-advertise Whether to │
│ include a footer │
│ that credits │
│ reprexlite. If │
│ unspecified, will │
│ depend on │
│ specified venue │
│ formatter's │
│ default. │
│ --session-info --no-session-in… Include details │
│ about session and │
│ environment that │
│ the reprex was │
│ generated with. │
│ [default: │
│ no-session-info] │
│ --style --no-style Whether to │
│ autoformat code │
│ with black. │
│ Requires black to │
│ be installed. │
│ [default: │
│ no-style] │
│ --prompt TEXT Prefix to use as │
│ primary prompt │
│ for code lines. │
│ --continuation TEXT Prefix to use as │
│ secondary prompt │
│ for continued │
│ code lines. │
│ --comment TEXT Prefix to use for │
│ results returned │
│ by expressions. │
│ [default: #>] │
│ --keep-old-resu… --no-keep-old-r… Whether to │
│ additionally │
│ include results │
│ of expressions │
│ detected in the │
│ original input │
│ when formatting │
│ the reprex │
│ output. │
│ [default: │
│ no-keep-old-resu… │
│ --parsing-method [auto|declared] Method for │
│ parsing input. │
│ 'auto' will │
│ automatically │
│ detect either │
│ default │
│ reprex-style │
│ input or standard │
│ doctest-style │
│ input. 'declared' │
│ will allow you to │
│ specify custom │
│ line prefixes. │
│ Values for │
│ 'prompt', │
│ 'continuation', │
│ and 'comment' │
│ will be used for │
│ both output │
│ formatting and │
│ input parsing, │
│ unless the │
│ associated │
│ 'input-*' │
│ override settings │
│ are supplied. │
│ [default: auto] │
│ --input-prompt TEXT Prefix to use as │
│ primary prompt │
│ for code lines │
│ when parsing │
│ input. Only used │
│ if │
│ 'parsing-method' │
│ is 'declared'. If │
│ not set, 'prompt' │
│ is used for both │
│ input parsing and │
│ output │
│ formatting. │
│ [default: None] │
│ --input-continu… TEXT Prefix to use as │
│ secondary prompt │
│ for continued │
│ code lines when │
│ parsing input. │
│ Only used if │
│ 'parsing-method' │
│ is 'declared'. If │
│ not set, 'prompt' │
│ is used for both │
│ input parsing and │
│ output │
│ formatting. │
│ [default: None] │
│ --input-comment TEXT Prefix to use for │
│ results returned │
│ by expressions │
│ when parsing │
│ input. Only used │
│ if │
│ 'parsing-method' │
│ is 'declared'. If │
│ not set, 'prompt' │
│ is used for both │
│ input parsing and │
│ output │
│ formatting. │
│ [default: None] │
│ --verbose │
│ --version Show reprexlite │
│ version and exit. │
│ --install-compl… Install │
│ completion for │
│ the current │
│ shell. │
│ --show-completi… Show completion │
│ for the current │
│ shell, to copy it │
│ or customize the │
│ installation. │
│ --help Show this message │
│ and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯