-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvenus.txt
208 lines (156 loc) · 8.64 KB
/
venus.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
*venus.txt* Lighter, faster, and hotter than Jupyter
Author: Tim Clifford <tclifford@protonmail.com>
License: GPLv3 or later
This plugin is only available if 'compatible' is not set.
===============================================================================
INTRODUCTION *venus*
Integrates languages with a REPL and LaTeX into one markdown document
===============================================================================
FUNCTIONS *venus-functions*
StartREPL({repl_str}) *venus#StartREPL()*
Start the REPL with name `repl_str`
Start() *venus#Start()*
Start all detected REPLs and set filetype
Restart() *venus#Restart()*
Close all REPLs then Start()
Close({repl_str}) *venus#Close()*
Close the REPL with name `repl_str`
CloseAll() *venus#CloseAll()*
Close all REPLs
GetRunningREPLs() *venus#GetRunningREPLS()*
Get a list of all the REPLs that are currently running
RunCellIntoMarkdown() *venus#RunCellIntoMarkdown()*
Run the current cell through the REPL, and put the
output into an "output" cell after the current cell
RunAllIntoMarkdown() *venus#RunAllIntoMarkdown()*
Run all the cells in the document from the start, exactly
like |RunCellIntoMarkdown()|
GetVarsOfCurrent() *venus#GetVarsOfCurrent()*
Open variable explorer of currently active REPL
GetVars(repl_str) *venus#GetVars()*
Open varaible explorer of REPL with name `repl_str`
PandocMake() *venus#PandocMake()*
Compile the current markdown file into a PDF with Pandoc. The
resulting file will have the same name and location as the
markdown file, except with the `.pdf` extension
Make() *venus#Make()*
Exactly like |PandocMake()|, but run all the cells first
RestartAndMake() *venus#RestartAndMake()*
Exactly like |Make()|, but restart all the REPLs first
OpenZathura() *venus#OpenZathura()*
Open the PDF of the current file in zathura
==============================================================================
MAPS *venus-mappings* *venus-maps*
These maps can be disabled with |g:venus_mappings|
<leader>vx Run the current cell (see |RunCellIntoMarkdown()|)
<leader>va Run all the cells (see |RunAllIntoMarkdown()|)
<leader>vp Compile with pandoc (see |PandocMake()|)
<leader>vm Run and compile (see |Make()|)
<leader>vr Restart and compile (see |RestartAndMake()|)
<leader>vc Jump to the start of the next cell
<leader>vC Jump to the start of the previous cell
<leader>ve Open variable explorer (see |GetVarsOfCurrent()|)
==============================================================================
OPTIONS *venus-options*
See |venus-defaults| for the default value of each option
g:pandoc_defaults_file *g:pandoc_defaults_file*
Location of pandoc yaml configuration file to use.
g:pandoc_headers *g:pandoc_headers*
Directory or list of pandoc tex headers to include.
g:pandoc_options *g:pandoc_options*
Command line options to pass to pandoc.
g:venus_mappings *g:venus_mappings*
Set to 0 to disable the default |venus-mappings|.
g:venus_repls *g:venus_repls*
Dictionary of REPLs. See also |markdown_fenced_languages|. The
syntax is as follows: (see also |venus-defaults|).
`start_command`, `vars_command`, and `var_filter_rules` are
optional >
let g:venus_repls = {
\ "<name used for code block>": {
\ "binary": "<executable file for the REPL>",
\ "output_ignore": "<regex to ignore from REPL (e.g. prompt)",
\ ."note that this must match on one or more of the
\ ."prompt>"
\ "start_command": "<command to be sent to the REPL at startup>",
\ "preprocess": "function that modifies the lines to be sent to"
\ ."the interpreter. It must cause it to output"
\ ."`g:venus_delimiter` at the end",
\ "vars_command": "<command that will make REPL output it's"
\ ."variables as JSON {'name': 'value', ...}",
\ "var_filter_rules": [
\ '<rules used to specify which variables to take, e.g.>',
\ 'v:val[0] != "_"',
\ ],
\ },
\ "<another REPL>": {...
\ }
\}
g:venus_vimtex_enabled *g:venus_vimtex_enabled*
Set to 0 to disable loading vimtex automatically in markdown.
g:venus_vimtex_full *g:venus_vimtex_full*
Set to 1 to fully enable vimtex with no alterations (by
default the <leader>l mappings are disabled).
g:venus_ignorelist *g:venus_ignorelist*
List of file patterns to not start venus on (e.g. files that
you know use a different flavour of markdown)
g:venus_delimiter *g:venus_delimiter*
Special output that denotes the end of a code block
g:venus_delimiter_regex *g:venus_delimiter_regex*
Regex that matches |g:venus_delimiter|
==============================================================================
CONFIGURATION DEFAULTS *venus-defaults*
These are the default options. See also |g:venus_repls| for an explanation of
the REPL dictionary >
let g:pandoc_defaults_file = s:plugindir.'/pandoc/pandoc.yaml'
let g:pandoc_headers = s:plugindir.'/pandoc/headers'
let g:pandoc_options = ''
let g:venus_vimtex_enabled = 1
let g:venus_vimtex_full = 0
let g:venus_mappings = 1
let g:venus_delimiter = '========VENUS DELIMITER========'
let g:venus_delimiter_regex = '=\+VENUS DELIMITER=\+'
let g:venus_ignorelist = ['README.md']
" REPLs
let g:markdown_fenced_languages = ['python', 'sh', 'haskell', 'r']
" Note that `output_ignore` matches on 1 or more occurences
let g:venus_repls = get(g:, 'venus_repls', {
\ "python": {
\ "binary": "python",
\ "preprocess": "venus#PythonPreProcessor",
\ "output_ignore": '^\%(\%(>>>\|\.\.\.\)\+ *\)\+',
\ "start_command": "import json",
\ "vars_command": "print(json.dumps("
\ ."{x:str(y) for x, y in globals().items()}))",
\ "var_filter_rules": [
\ 'v:key[0] != "_"',
\ 'v:val[0:6] != "<module"',
\ ],
\ },
\ "sh": {
\ "binary": "sh",
\ "preprocess": "venus#ShellPreProcessor",
\ "output_ignore": '^\(\([^ ]*\$\|>\)\+ *\)',
\ },
\ "haskell": {
\ "binary": "ghci",
\ "preprocess": "venus#HaskellPreProcessor",
\ "output_ignore": '^\(Prelude> *\|ghci> \)\+',
\ },
\ "R": {
\ "binary": "R",
\ "preprocess": "venus#RPreProcessor",
\ "output_ignore": '^\(> *\|\[\d\+\] *\)\+',
\ },
\})
<
==============================================================================
KNOWN ISSUES *venus-known-issues*
- Occasionally erroneous newlines appear in the output
- calling venus#RestartAndMake() causes an off-by-one error in the output
blocks. (?!?)
==============================================================================
ABOUT *venus-about*
Grab the latest version or report a bug on GitHub:
https://github.com/tim-clifford/vim-venus
vim:tw=78:et:ft=help:norl: