Skip to content

Commit c04796e

Browse files
committed
Updated API documentation.
1 parent 488219a commit c04796e

File tree

3 files changed

+32
-35
lines changed

3 files changed

+32
-35
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ ta = ../..
66
cwd = $(shell pwd)
77
docs: README.md
88
README.md: init.lua
9-
cd $(ta)/scripts && ldoc --filter markdowndoc.ldoc $(cwd)/$< > $(cwd)/$@
10-
sed -i -e '1,+4d' -e '6c# Lua REPL' -e '7d' -e 's/^##/#/;' $@
9+
cd $(ta)/scripts && ldoc --filter markdowndoc.ldoc $(cwd)/$< -- --title="Lua REPL" --single \
10+
> $(cwd)/$@
1111

1212
# Releases.
1313

README.md

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,64 +8,61 @@ This is an alternative to the single-line Lua command entry.
88
Install this module by copying it into your *~/.textadept/modules/* directory or Textadept's
99
*modules/* directory, and then putting the following in your *~/.textadept/init.lua*:
1010

11-
require('lua_repl')
11+
```lua
12+
local lua_repl = require('lua_repl')
13+
```
1214

1315
Select "Tools > Lua REPL" to open the REPL. Typing the Enter key on any line evaluates that
1416
line, unless that line is a continuation line. In that case, when finished, select the lines
1517
to evaluate and type Enter to evaluate the entire chunk.
1618

1719
Lines may be optionally prefixed with '=' (similar to the Lua prompt) to print a result.
1820

19-
## Fields defined by `lua_repl`
20-
21-
<a id="lua_repl.history"></a>
22-
### `lua_repl.history` &lt;table&gt;
23-
24-
Lua command history.
25-
It has a numeric `pos` field that indicates where in the history the user currently is.
26-
27-
Fields:
28-
29-
- `pos`:
30-
31-
<a id="lua_repl.keys"></a>
32-
### `lua_repl.keys` &lt;table&gt;
33-
34-
Table of key bindings for the REPL.
35-
36-
37-
## Functions defined by `lua_repl`
38-
3921
<a id="lua_repl.complete_lua"></a>
40-
### `lua_repl.complete_lua`()
22+
## `lua_repl.complete_lua`()
4123

4224
Shows a set of Lua code completions for the current position.
4325

4426
<a id="lua_repl.cycle_history_next"></a>
45-
### `lua_repl.cycle_history_next`()
27+
## `lua_repl.cycle_history_next`()
4628

4729
Cycle forward through command history, taking into account commands with multiple lines.
4830

4931
<a id="lua_repl.cycle_history_prev"></a>
50-
### `lua_repl.cycle_history_prev`()
32+
## `lua_repl.cycle_history_prev`()
5133

5234
Cycle backward through command history, taking into account commands with multiple lines.
5335

5436
<a id="lua_repl.evaluate_repl"></a>
55-
### `lua_repl.evaluate_repl`()
37+
## `lua_repl.evaluate_repl`()
5638

5739
Evaluates as Lua code the current line or the text on the currently selected lines.
40+
5841
If the current line has a syntax error, it is ignored and treated as a line continuation.
5942

43+
<a id="lua_repl.history"></a>
44+
## `lua_repl.history`
45+
46+
Lua command history.
47+
48+
It has a numeric `pos` field that indicates where in the history the user currently is.
49+
50+
Fields:
51+
52+
- `pos`:
53+
54+
<a id="lua_repl.keys"></a>
55+
## `lua_repl.keys`
56+
57+
Table of key bindings for the REPL.
58+
6059
<a id="lua_repl.open"></a>
61-
### `lua_repl.open`(*new*)
60+
## `lua_repl.open`([*new*=false])
6261

6362
Creates or switches to a Lua REPL.
64-
If *new* is `true`, creates a new REPL even if one already exists.
6563

6664
Parameters:
65+
- *new*: Create a new REPL even if one already exists.
6766

68-
- *new*: Flag that indicates whether or not to create a new REPL even if one already exists.
6967

7068

71-
---

init.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
--- A Textadept module for loading an interactive Lua REPL using the editor's Lua State, similar
44
-- to Lua's interactive REPL.
5-
--
65
-- This is an alternative to the single-line Lua command entry.
76
--
87
-- Install this module by copying it into your *~/.textadept/modules/* directory or Textadept's
98
-- *modules/* directory, and then putting the following in your *~/.textadept/init.lua*:
109
--
11-
-- require('lua_repl')
10+
-- ```lua
11+
-- local lua_repl = require('lua_repl')
12+
-- ```
1213
--
1314
-- Select "Tools > Lua REPL" to open the REPL. Typing the Enter key on any line evaluates that
1415
-- line, unless that line is a continuation line. In that case, when finished, select the lines
@@ -175,8 +176,7 @@ end
175176
events.connect(events.RESET_AFTER, register_keys)
176177

177178
--- Creates or switches to a Lua REPL.
178-
-- If *new* is `true`, creates a new REPL even if one already exists.
179-
-- @param new Flag that indicates whether or not to create a new REPL even if one already exists.
179+
-- @param[opt=false] new Create a new REPL even if one already exists.
180180
function M.open(new)
181181
local repl_view, repl_buf = nil, nil
182182
for i = 1, #_VIEWS do

0 commit comments

Comments
 (0)