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
|
# Scripting
Textadept has superb support for editing Lua code. Syntax autocomplete and
LuaDoc is available for many Textadept objects as well as Lua's standard
libraries. See the [`lua` module documentation][] for more information.


[`lua` module documentation]: api/_M.lua.html
## LuaDoc and Examples
Textadept's API is heavily documented. The [API docs][] are the ultimate
resource on scripting Textadept. There are of course abundant scripting examples
since Textadept is mostly written in Lua.
[API docs]: api/index.html
### Generating LuaDoc
You can generate API documentation for your own modules using the
`doc/markdowndoc.lua` [LuaDoc][] module:
luadoc -d . --doclet _HOME/doc/markdowndoc [module(s)]
or
luadoc -d . -t template_dir --doclet _HOME/doc/markdowndoc [module(s)]
where `_HOME` is where Textadept is installed and `template_dir` is an optional
template directory that contains two Markdown files: `.header.md` and
`.footer.md`. (See `doc/.header.md` and `doc/.footer.md` for examples.) You must
have [Discount][] installed.
[LuaDoc]: http://keplerproject.github.com/luadoc/
[Discount]: http://www.pell.portland.or.us/~orc/Code/discount/
## Lua Configuration
[Lua 5.2][] is built into Textadept. It has the same configuration (`luaconf.h`)
as vanilla Lua with the following exceptions:
* `TA_LUA_PATH` and `TA_LUA_CPATH` are the environment variable used in place of
the usual `LUA_PATH` and `LUA_CPATH`.
* `LUA_ROOT` is `/usr/` in Linux systems instead of `/usr/local/`.
* All compatibility flags for Lua 5.1 are turned off. (`LUA_COMPAT_UNPACK`,
`LUA_COMPAT_LOADERS`, `LUA_COMPAT_LOG10`, `LUA_COMPAT_LOADSTRING`,
`LUA_COMPAT_MAXN`, and `LUA_COMPAT_MODULE`.)
[Lua 5.2]: http://www.lua.org/manual/5.2/
## Scintilla
The editing component used by Textadept is [Scintilla][]. The [buffer][] part of
Textadept's API is derived from the [Scintilla API][] so any C/C++ code using
Scintilla calls can be ported to Lua without too much trouble.
[Scintilla]: http://scintilla.org
[buffer]: api/buffer.html
[Scintilla API]: http://scintilla.org/ScintillaDoc.html
## Textadept Structure
Because Textadept is mostly written in Lua, its Lua scripts have to be stored in
an organized folder structure.
### Core
Textadept's core Lua modules are contained in `core/`. These are absolutely
necessary in order for the application to run. They are responsible for
Textadept's Lua to C interface, event structure, file input/output, and
localization.
### Lexers
Lexer Lua modules are responsible for the syntax highlighting of source code.
They are located in `lexers/`.
### Modules
Editor Lua modules are contained in `modules/`. These provide advanced text
editing capabilities and can be available for all programming languages or
targeted at specific ones.
### Themes
Built-in themes to customize the look and behavior of Textadept are located in
`themes/`.
### User
User Lua modules are contained in the `~/.textadept/` folder. This folder may
contain `lexers/`, `modules/`, and `themes/` subdirectories.
### GTK
The `etc/`, `lib/`, and `share/` directories are used by GTK and only appear in
the Win32 and Mac OSX packages.
|