diff options
Diffstat (limited to 'docs/topics')
-rw-r--r-- | docs/topics/01-introduction.md.html | 27 | ||||
-rw-r--r-- | docs/topics/02-development.md.html | 91 | ||||
-rw-r--r-- | docs/topics/03-terminal.md.html | 225 | ||||
-rw-r--r-- | docs/topics/CHANGELOG.md.html | 55 | ||||
-rw-r--r-- | docs/topics/LICENSE.md.html | 29 |
5 files changed, 411 insertions, 16 deletions
diff --git a/docs/topics/01-introduction.md.html b/docs/topics/01-introduction.md.html index 319b9d5..019f7e4 100644 --- a/docs/topics/01-introduction.md.html +++ b/docs/topics/01-introduction.md.html | |||
@@ -27,17 +27,38 @@ | |||
27 | <h1>Lua-System</h1> | 27 | <h1>Lua-System</h1> |
28 | 28 | ||
29 | 29 | ||
30 | <ul> | ||
31 | <li><a href="../index.html">Index</a></li> | ||
32 | </ul> | ||
33 | |||
30 | 34 | ||
31 | 35 | ||
32 | <h2>Topics</h2> | 36 | <h2>Topics</h2> |
33 | <ul class=""> | 37 | <ul class=""> |
34 | <li><strong>1. Introduction</strong></li> | 38 | <li><strong>1. Introduction</strong></li> |
39 | <li><a href="../topics/02-development.md.html">2. Development</a></li> | ||
40 | <li><a href="../topics/03-terminal.md.html">3. Terminal functionality</a></li> | ||
35 | <li><a href="../topics/CHANGELOG.md.html">CHANGELOG</a></li> | 41 | <li><a href="../topics/CHANGELOG.md.html">CHANGELOG</a></li> |
36 | <li><a href="../topics/LICENSE.md.html">MIT License</a></li> | 42 | <li><a href="../topics/LICENSE.md.html">MIT License</a></li> |
37 | </ul> | 43 | </ul> |
38 | <h2>Modules</h2> | 44 | <h2>Modules</h2> |
39 | <ul class="nowrap"> | 45 | <ul class="nowrap"> |
40 | <li><a href="../index.html">system</a></li> | 46 | <li><a href="../modules/system.html">system</a></li> |
47 | </ul> | ||
48 | <h2>Classes</h2> | ||
49 | <ul class="nowrap"> | ||
50 | <li><a href="../classes/bitflags.html">bitflags</a></li> | ||
51 | </ul> | ||
52 | <h2>Examples</h2> | ||
53 | <ul class="nowrap"> | ||
54 | <li><a href="../examples/compat.lua.html">compat.lua</a></li> | ||
55 | <li><a href="../examples/flag_debugging.lua.html">flag_debugging.lua</a></li> | ||
56 | <li><a href="../examples/password_input.lua.html">password_input.lua</a></li> | ||
57 | <li><a href="../examples/read.lua.html">read.lua</a></li> | ||
58 | <li><a href="../examples/readline.lua.html">readline.lua</a></li> | ||
59 | <li><a href="../examples/spinner.lua.html">spinner.lua</a></li> | ||
60 | <li><a href="../examples/spiral_snake.lua.html">spiral_snake.lua</a></li> | ||
61 | <li><a href="../examples/terminalsize.lua.html">terminalsize.lua</a></li> | ||
41 | </ul> | 62 | </ul> |
42 | 63 | ||
43 | </div> | 64 | </div> |
@@ -62,8 +83,8 @@ independence.</p> | |||
62 | </div> <!-- id="content" --> | 83 | </div> <!-- id="content" --> |
63 | </div> <!-- id="main" --> | 84 | </div> <!-- id="main" --> |
64 | <div id="about"> | 85 | <div id="about"> |
65 | <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> | 86 | <i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> |
66 | <i style="float:right;">Last updated 2023-12-15 13:15:09 </i> | 87 | <i style="float:right;">Last updated 2024-06-20 23:11:37 </i> |
67 | </div> <!-- id="about" --> | 88 | </div> <!-- id="about" --> |
68 | </div> <!-- id="container" --> | 89 | </div> <!-- id="container" --> |
69 | </body> | 90 | </body> |
diff --git a/docs/topics/02-development.md.html b/docs/topics/02-development.md.html new file mode 100644 index 0000000..e911eed --- /dev/null +++ b/docs/topics/02-development.md.html | |||
@@ -0,0 +1,91 @@ | |||
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
3 | <html> | ||
4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
5 | <head> | ||
6 | <title>Lua-System docs</title> | ||
7 | <link rel="stylesheet" href="../ldoc.css" type="text/css" /> | ||
8 | </head> | ||
9 | <body> | ||
10 | |||
11 | <div id="container"> | ||
12 | |||
13 | <div id="product"> | ||
14 | <div id="product_logo"></div> | ||
15 | <div id="product_name"><big><b></b></big></div> | ||
16 | <div id="product_description"></div> | ||
17 | </div> <!-- id="product" --> | ||
18 | |||
19 | |||
20 | <div id="main"> | ||
21 | |||
22 | |||
23 | <!-- Menu --> | ||
24 | |||
25 | <div id="navigation"> | ||
26 | <br/> | ||
27 | <h1>Lua-System</h1> | ||
28 | |||
29 | |||
30 | <ul> | ||
31 | <li><a href="../index.html">Index</a></li> | ||
32 | </ul> | ||
33 | |||
34 | |||
35 | |||
36 | <h2>Topics</h2> | ||
37 | <ul class=""> | ||
38 | <li><a href="../topics/01-introduction.md.html">1. Introduction</a></li> | ||
39 | <li><strong>2. Development</strong></li> | ||
40 | <li><a href="../topics/03-terminal.md.html">3. Terminal functionality</a></li> | ||
41 | <li><a href="../topics/CHANGELOG.md.html">CHANGELOG</a></li> | ||
42 | <li><a href="../topics/LICENSE.md.html">MIT License</a></li> | ||
43 | </ul> | ||
44 | <h2>Modules</h2> | ||
45 | <ul class="nowrap"> | ||
46 | <li><a href="../modules/system.html">system</a></li> | ||
47 | </ul> | ||
48 | <h2>Classes</h2> | ||
49 | <ul class="nowrap"> | ||
50 | <li><a href="../classes/bitflags.html">bitflags</a></li> | ||
51 | </ul> | ||
52 | <h2>Examples</h2> | ||
53 | <ul class="nowrap"> | ||
54 | <li><a href="../examples/compat.lua.html">compat.lua</a></li> | ||
55 | <li><a href="../examples/flag_debugging.lua.html">flag_debugging.lua</a></li> | ||
56 | <li><a href="../examples/password_input.lua.html">password_input.lua</a></li> | ||
57 | <li><a href="../examples/read.lua.html">read.lua</a></li> | ||
58 | <li><a href="../examples/readline.lua.html">readline.lua</a></li> | ||
59 | <li><a href="../examples/spinner.lua.html">spinner.lua</a></li> | ||
60 | <li><a href="../examples/spiral_snake.lua.html">spiral_snake.lua</a></li> | ||
61 | <li><a href="../examples/terminalsize.lua.html">terminalsize.lua</a></li> | ||
62 | </ul> | ||
63 | |||
64 | </div> | ||
65 | |||
66 | <div id="content"> | ||
67 | |||
68 | |||
69 | <h1>2. Development</h1> | ||
70 | |||
71 | <p>Some tests cannot be run in CI becasue they test system specifics that | ||
72 | simply do not exist in a CI environment. An example is the <code>isatty</code> function | ||
73 | Which cannot be set to return a truthy value in CI.</p> | ||
74 | |||
75 | <p>The tests concerned are all labelled with <code>#manual</code>. And in CI they will | ||
76 | be skipped because <code>--exclude-tags=manual</code> is being passed to the | ||
77 | <code>busted</code> command line.</p> | ||
78 | |||
79 | <p>Hence if tests like this are being added, then please ensure the tests | ||
80 | pass locally, and do not rely on CI only.</p> | ||
81 | |||
82 | |||
83 | </div> <!-- id="content" --> | ||
84 | </div> <!-- id="main" --> | ||
85 | <div id="about"> | ||
86 | <i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> | ||
87 | <i style="float:right;">Last updated 2024-06-20 23:11:37 </i> | ||
88 | </div> <!-- id="about" --> | ||
89 | </div> <!-- id="container" --> | ||
90 | </body> | ||
91 | </html> | ||
diff --git a/docs/topics/03-terminal.md.html b/docs/topics/03-terminal.md.html new file mode 100644 index 0000000..3e7e548 --- /dev/null +++ b/docs/topics/03-terminal.md.html | |||
@@ -0,0 +1,225 @@ | |||
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
3 | <html> | ||
4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
5 | <head> | ||
6 | <title>Lua-System docs</title> | ||
7 | <link rel="stylesheet" href="../ldoc.css" type="text/css" /> | ||
8 | </head> | ||
9 | <body> | ||
10 | |||
11 | <div id="container"> | ||
12 | |||
13 | <div id="product"> | ||
14 | <div id="product_logo"></div> | ||
15 | <div id="product_name"><big><b></b></big></div> | ||
16 | <div id="product_description"></div> | ||
17 | </div> <!-- id="product" --> | ||
18 | |||
19 | |||
20 | <div id="main"> | ||
21 | |||
22 | |||
23 | <!-- Menu --> | ||
24 | |||
25 | <div id="navigation"> | ||
26 | <br/> | ||
27 | <h1>Lua-System</h1> | ||
28 | |||
29 | |||
30 | <ul> | ||
31 | <li><a href="../index.html">Index</a></li> | ||
32 | </ul> | ||
33 | |||
34 | <h2>Contents</h2> | ||
35 | <ul> | ||
36 | <li><a href="#3_1_Backup_and_Restore_terminal_settings">3.1 Backup and Restore terminal settings </a></li> | ||
37 | <li><a href="#3_1_Terminal_ANSI_sequences">3.1 Terminal ANSI sequences </a></li> | ||
38 | <li><a href="#3_2_UTF_8_in_output_and_display_width">3.2 UTF-8 in/output and display width </a></li> | ||
39 | <li><a href="#3_3_reading_keyboard_input">3.3 reading keyboard input </a></li> | ||
40 | </ul> | ||
41 | |||
42 | |||
43 | <h2>Topics</h2> | ||
44 | <ul class=""> | ||
45 | <li><a href="../topics/01-introduction.md.html">1. Introduction</a></li> | ||
46 | <li><a href="../topics/02-development.md.html">2. Development</a></li> | ||
47 | <li><strong>3. Terminal functionality</strong></li> | ||
48 | <li><a href="../topics/CHANGELOG.md.html">CHANGELOG</a></li> | ||
49 | <li><a href="../topics/LICENSE.md.html">MIT License</a></li> | ||
50 | </ul> | ||
51 | <h2>Modules</h2> | ||
52 | <ul class="nowrap"> | ||
53 | <li><a href="../modules/system.html">system</a></li> | ||
54 | </ul> | ||
55 | <h2>Classes</h2> | ||
56 | <ul class="nowrap"> | ||
57 | <li><a href="../classes/bitflags.html">bitflags</a></li> | ||
58 | </ul> | ||
59 | <h2>Examples</h2> | ||
60 | <ul class="nowrap"> | ||
61 | <li><a href="../examples/compat.lua.html">compat.lua</a></li> | ||
62 | <li><a href="../examples/flag_debugging.lua.html">flag_debugging.lua</a></li> | ||
63 | <li><a href="../examples/password_input.lua.html">password_input.lua</a></li> | ||
64 | <li><a href="../examples/read.lua.html">read.lua</a></li> | ||
65 | <li><a href="../examples/readline.lua.html">readline.lua</a></li> | ||
66 | <li><a href="../examples/spinner.lua.html">spinner.lua</a></li> | ||
67 | <li><a href="../examples/spiral_snake.lua.html">spiral_snake.lua</a></li> | ||
68 | <li><a href="../examples/terminalsize.lua.html">terminalsize.lua</a></li> | ||
69 | </ul> | ||
70 | |||
71 | </div> | ||
72 | |||
73 | <div id="content"> | ||
74 | |||
75 | |||
76 | <h1>3. Terminal functionality</h1> | ||
77 | |||
78 | <p>Terminals are fundamentally different on Windows and Posix. So even though | ||
79 | <code>luasystem</code> provides primitives to manipulate both the Windows and Posix terminals, | ||
80 | the user will still have to write platform specific code.</p> | ||
81 | |||
82 | <p>To mitigate this a little, all functions are available on all platforms. They just | ||
83 | will be a no-op if invoked on another platform. This means that no platform specific | ||
84 | branching is required (but still possible) in user code. The user must simply set | ||
85 | up both platforms to make it work.</p> | ||
86 | |||
87 | <p><a name="3_1_Backup_and_Restore_terminal_settings"></a></p> | ||
88 | <h2>3.1 Backup and Restore terminal settings</h2> | ||
89 | |||
90 | <p>Since there are a myriad of settings available;</p> | ||
91 | |||
92 | <ul> | ||
93 | <li><a href="../modules/system.html#setconsoleflags">system.setconsoleflags</a> (Windows)</li> | ||
94 | <li><a href="../modules/system.html#setconsolecp">system.setconsolecp</a> (Windows)</li> | ||
95 | <li><a href="../modules/system.html#setconsoleoutputcp">system.setconsoleoutputcp</a> (Windows)</li> | ||
96 | <li><a href="../modules/system.html#setnonblock">system.setnonblock</a> (Posix)</li> | ||
97 | <li><a href="../modules/system.html#tcsetattr">system.tcsetattr</a> (Posix)</li> | ||
98 | </ul> | ||
99 | |||
100 | <p>Some helper functions are available to backup and restore them all at once. | ||
101 | See <code>termbackup</code>, <code>termrestore</code>, <code>autotermrestore</code> and <code>termwrap</code>.</p> | ||
102 | |||
103 | |||
104 | <p><a name="3_1_Terminal_ANSI_sequences"></a></p> | ||
105 | <h2>3.1 Terminal ANSI sequences</h2> | ||
106 | |||
107 | <p>Windows is catching up with this. In Windows 10 (since 2019), the Windows Terminal application (not to be | ||
108 | mistaken for the <code>cmd</code> console application) supports ANSI sequences. However this | ||
109 | might not be enabled by default.</p> | ||
110 | |||
111 | <p>ANSI processing can be set up both on the input (key sequences, reading cursor position) | ||
112 | as well as on the output (setting colors and cursor shapes).</p> | ||
113 | |||
114 | <p>To enable it use <a href="../modules/system.html#setconsoleflags">system.setconsoleflags</a> like this:</p> | ||
115 | |||
116 | |||
117 | <pre> | ||
118 | <span class="comment">-- setup Windows console to handle ANSI processing on output | ||
119 | </span>sys.<span class="function-name">setconsoleflags</span>(<span class="global">io</span>.stdout, sys.<span class="function-name">getconsoleflags</span>(<span class="global">io</span>.stdout) + sys.COF_VIRTUAL_TERMINAL_PROCESSING) | ||
120 | sys.<span class="function-name">setconsoleflags</span>(<span class="global">io</span>.stderr, sys.<span class="function-name">getconsoleflags</span>(<span class="global">io</span>.stderr) + sys.COF_VIRTUAL_TERMINAL_PROCESSING) | ||
121 | |||
122 | <span class="comment">-- setup Windows console to handle ANSI processing on input | ||
123 | </span>sys.<span class="function-name">setconsoleflags</span>(<span class="global">io</span>.stdin, sys.<span class="function-name">getconsoleflags</span>(<span class="global">io</span>.stdin) + sys.CIF_VIRTUAL_TERMINAL_INPUT) | ||
124 | </pre> | ||
125 | |||
126 | <p><a name="3_2_UTF_8_in_output_and_display_width"></a></p> | ||
127 | <h2>3.2 UTF-8 in/output and display width</h2> | ||
128 | |||
129 | <h3>3.2.1 UTF-8 in/output</h3> | ||
130 | |||
131 | <p>Where (most) Posix systems use UTF-8 by default, Windows internally uses UTF-16. More | ||
132 | recent versions of Lua also have UTF-8 support. So <code>luasystem</code> also focusses on UTF-8.</p> | ||
133 | |||
134 | <p>On Windows UTF-8 output can be enabled by setting the output codepage like this:</p> | ||
135 | |||
136 | |||
137 | <pre> | ||
138 | <span class="comment">-- setup Windows output codepage to UTF-8 | ||
139 | </span>sys.<span class="function-name">setconsoleoutputcp</span>(sys.CODEPAGE_UTF8) | ||
140 | </pre> | ||
141 | |||
142 | <p>Terminal input is handled by the <a href="https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/getchar-getwchar"><code>_getwchar()</code></a> function on Windows which returns | ||
143 | UTF-16 surrogate pairs. <code>luasystem</code> will automatically convert those to UTF-8. | ||
144 | So when using <code>readkey</code> or <code>readansi</code> to read keyboard input no additional changes | ||
145 | are required.</p> | ||
146 | |||
147 | <h3>3.2.2 UTF-8 display width</h3> | ||
148 | |||
149 | <p>Typical western characters and symbols are single width characters and will use only | ||
150 | a single column when displayed on a terminal. However many characters from other | ||
151 | languages/cultures or emojis require 2 columns for display.</p> | ||
152 | |||
153 | <p>Typically the <code>wcwidth</code> function is used on Posix to check the number of columns | ||
154 | required for display. However since Windows doesn't provide this functionality a | ||
155 | custom implementation is included based on <a href="http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c">the work by Markus Kuhn</a>.</p> | ||
156 | |||
157 | <p>2 functions are provided, <a href="../modules/system.html#utf8cwidth">system.utf8cwidth</a> for a single character, and <a href="../modules/system.html#utf8swidth">system.utf8swidth</a> for | ||
158 | a string. When writing terminal applications the display width is relevant to | ||
159 | positioning the cursor properly. For an example see the <a href="../examples/readline.lua.html"><code>examples/readline.lua</code></a> file.</p> | ||
160 | |||
161 | |||
162 | <p><a name="3_3_reading_keyboard_input"></a></p> | ||
163 | <h2>3.3 reading keyboard input</h2> | ||
164 | |||
165 | <h3>3.3.1 Non-blocking</h3> | ||
166 | |||
167 | <p>There are 2 functions for keyboard input (actually 3, if taking <a href="../modules/system.html#_readkey">system._readkey</a> into | ||
168 | account): <code>readkey</code> and <code>readansi</code>.</p> | ||
169 | |||
170 | <p><code>readkey</code> is a low level function and should preferably not be used, it returns | ||
171 | a byte at a time, and hence can leave stray/invalid byte sequences in the buffer if | ||
172 | only the start of a UTF-8 or ANSI sequence is consumed.</p> | ||
173 | |||
174 | <p>The preferred way is to use <code>readansi</code> which will parse and return entire characters in | ||
175 | single or multiple bytes, or a full ANSI sequence.</p> | ||
176 | |||
177 | <p>On Windows the input is read using <a href="https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/getchar-getwchar"><code>_getwchar()</code></a> which bypasses the terminal and reads | ||
178 | the input directly from the keyboard buffer. This means however that the character is | ||
179 | also not being echoed to the terminal (independent of the echo settings used with | ||
180 | <a href="../modules/system.html#setconsoleflags">system.setconsoleflags</a>).</p> | ||
181 | |||
182 | <p>On Posix the traditional file approach is used, which:</p> | ||
183 | |||
184 | <ul> | ||
185 | <li>is blocking by default</li> | ||
186 | <li>echoes input to the terminal</li> | ||
187 | <li>requires enter to be pressed to pass the input (canonical mode)</li> | ||
188 | </ul> | ||
189 | |||
190 | <p>To use non-blocking input here's how to set it up:</p> | ||
191 | |||
192 | |||
193 | <pre> | ||
194 | <span class="comment">-- setup Windows console to disable echo and line input (not required since _getwchar is used, just for consistency) | ||
195 | </span>sys.<span class="function-name">setconsoleflags</span>(<span class="global">io</span>.stdin, sys.<span class="function-name">getconsoleflags</span>(<span class="global">io</span>.stdin) - sys.CIF_ECHO_INPUT - sys.CIF_LINE_INPUT) | ||
196 | |||
197 | <span class="comment">-- setup Posix by disabling echo, canonical mode, and making non-blocking | ||
198 | </span><span class="keyword">local</span> of_attr = sys.<span class="function-name">tcgetattr</span>(<span class="global">io</span>.stdin) | ||
199 | sys.<span class="function-name">tcsetattr</span>(<span class="global">io</span>.stdin, sys.TCSANOW, { | ||
200 | lflag = of_attr.lflag - sys.L_ICANON - sys.L_ECHO, | ||
201 | }) | ||
202 | sys.<span class="function-name">setnonblock</span>(<span class="global">io</span>.stdin, <span class="keyword">true</span>) | ||
203 | </pre> | ||
204 | |||
205 | <p>Both functions require a timeout to be provided which allows for proper asynchronous | ||
206 | code to be written. Since the underlying sleep method used is <a href="../modules/system.html#sleep">system.sleep</a>, just patching | ||
207 | that function with a coroutine based yielding one should be all that is needed to make | ||
208 | the result work with asynchroneous coroutine schedulers.</p> | ||
209 | |||
210 | <h3>3.3.2 Blocking input</h3> | ||
211 | |||
212 | <p>When using traditional input method like <code>io.stdin:read()</code> (which is blocking) the echo | ||
213 | and newline properties should be set on Windows similar to Posix. | ||
214 | For an example see <a href="../examples/password_input.lua.html"><code>examples/password_input.lua</code></a>.</p> | ||
215 | |||
216 | |||
217 | </div> <!-- id="content" --> | ||
218 | </div> <!-- id="main" --> | ||
219 | <div id="about"> | ||
220 | <i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> | ||
221 | <i style="float:right;">Last updated 2024-06-20 23:11:37 </i> | ||
222 | </div> <!-- id="about" --> | ||
223 | </div> <!-- id="container" --> | ||
224 | </body> | ||
225 | </html> | ||
diff --git a/docs/topics/CHANGELOG.md.html b/docs/topics/CHANGELOG.md.html index 4e656c7..da8ddde 100644 --- a/docs/topics/CHANGELOG.md.html +++ b/docs/topics/CHANGELOG.md.html | |||
@@ -27,6 +27,10 @@ | |||
27 | <h1>Lua-System</h1> | 27 | <h1>Lua-System</h1> |
28 | 28 | ||
29 | 29 | ||
30 | <ul> | ||
31 | <li><a href="../index.html">Index</a></li> | ||
32 | </ul> | ||
33 | |||
30 | <h2>Contents</h2> | 34 | <h2>Contents</h2> |
31 | <ul> | 35 | <ul> |
32 | <li><a href="#Versioning">Versioning </a></li> | 36 | <li><a href="#Versioning">Versioning </a></li> |
@@ -37,12 +41,29 @@ | |||
37 | <h2>Topics</h2> | 41 | <h2>Topics</h2> |
38 | <ul class=""> | 42 | <ul class=""> |
39 | <li><a href="../topics/01-introduction.md.html">1. Introduction</a></li> | 43 | <li><a href="../topics/01-introduction.md.html">1. Introduction</a></li> |
44 | <li><a href="../topics/02-development.md.html">2. Development</a></li> | ||
45 | <li><a href="../topics/03-terminal.md.html">3. Terminal functionality</a></li> | ||
40 | <li><strong>CHANGELOG</strong></li> | 46 | <li><strong>CHANGELOG</strong></li> |
41 | <li><a href="../topics/LICENSE.md.html">MIT License</a></li> | 47 | <li><a href="../topics/LICENSE.md.html">MIT License</a></li> |
42 | </ul> | 48 | </ul> |
43 | <h2>Modules</h2> | 49 | <h2>Modules</h2> |
44 | <ul class="nowrap"> | 50 | <ul class="nowrap"> |
45 | <li><a href="../index.html">system</a></li> | 51 | <li><a href="../modules/system.html">system</a></li> |
52 | </ul> | ||
53 | <h2>Classes</h2> | ||
54 | <ul class="nowrap"> | ||
55 | <li><a href="../classes/bitflags.html">bitflags</a></li> | ||
56 | </ul> | ||
57 | <h2>Examples</h2> | ||
58 | <ul class="nowrap"> | ||
59 | <li><a href="../examples/compat.lua.html">compat.lua</a></li> | ||
60 | <li><a href="../examples/flag_debugging.lua.html">flag_debugging.lua</a></li> | ||
61 | <li><a href="../examples/password_input.lua.html">password_input.lua</a></li> | ||
62 | <li><a href="../examples/read.lua.html">read.lua</a></li> | ||
63 | <li><a href="../examples/readline.lua.html">readline.lua</a></li> | ||
64 | <li><a href="../examples/spinner.lua.html">spinner.lua</a></li> | ||
65 | <li><a href="../examples/spiral_snake.lua.html">spiral_snake.lua</a></li> | ||
66 | <li><a href="../examples/terminalsize.lua.html">terminalsize.lua</a></li> | ||
46 | </ul> | 67 | </ul> |
47 | 68 | ||
48 | </div> | 69 | </div> |
@@ -86,15 +107,31 @@ | |||
86 | <p><a name="Version_history"></a></p> | 107 | <p><a name="Version_history"></a></p> |
87 | <h2>Version history</h2> | 108 | <h2>Version history</h2> |
88 | 109 | ||
110 | <h3>Version 0.4.0, released 20-Jun-2024</h3> | ||
111 | |||
112 | <ul> | ||
113 | <li>Feat: <code>getconsoleflags</code> and <code>setconsoleflags</code> for getting/setting the current console configuration flags on Windows</li> | ||
114 | <li>Feat: <code>getconsolecp</code> and <code>setconsolecp</code> for getting/setting the console codepage on Windows</li> | ||
115 | <li>Feat: <code>getconsoleoutputcp</code> and <code>setconsoleoutputcp</code> for getting/setting the console output codepage on Windows</li> | ||
116 | <li>Feat: <code>tcgetattr</code> and <code>tcsetattr</code> for getting/setting the current console configuration flags on Posix</li> | ||
117 | <li>Feat: <code>getnonblock</code> and <code>setnonblock</code> for getting/setting the non-blocking flag on Posix</li> | ||
118 | <li>Feat: <a href="../classes/bitflags.html#">bitflags</a>: a support feature for the above flag type controls to facilitate bit manipulation without resorting to binary operations (to also support PuC Lua 5.1)</li> | ||
119 | <li>Feat: <code>readkey</code> reads a keyboard input from <code>stdin</code> in a non-blocking way (utf8, also on Windows)</li> | ||
120 | <li>Feat: <code>readansi</code> reads a keyboard input from <code>stdin</code> in a non-blocking way, parses ansi and utf8 sequences</li> | ||
121 | <li>Feat: <code>termsize</code> gets the current terminal size in rows and columns</li> | ||
122 | <li>Feat: <code>utf8cwidth</code> and <code>utf8swidth</code> for getting the display width (in columns) of respectively a single utf8 character, or a utf8 string</li> | ||
123 | <li>Feat: helpers; <code>termbackup</code>, <code>termrestore</code>, <code>autotermrestore</code>, and <code>termwrap</code> for managing the many terminal settings on all platforms.</li> | ||
124 | </ul> | ||
125 | |||
89 | <h3>Version 0.3.0, released 15-Dec-2023</h3> | 126 | <h3>Version 0.3.0, released 15-Dec-2023</h3> |
90 | 127 | ||
91 | <ul> | 128 | <ul> |
92 | <li>Feat: on Windows <a href="../index.html#sleep">sleep</a> now has a precision parameter</li> | 129 | <li>Feat: on Windows <code>sleep</code> now has a precision parameter</li> |
93 | <li>Feat: <a href="../index.html#setenv">setenv</a> added to set environment variables.</li> | 130 | <li>Feat: <code>setenv</code> added to set environment variables.</li> |
94 | <li>Feat: <a href="../index.html#getenvs">getenvs</a> added to list environment variables.</li> | 131 | <li>Feat: <code>getenvs</code> added to list environment variables.</li> |
95 | <li>Feat: <a href="../index.html#getenv">getenv</a> added to get environment variable previously set (Windows).</li> | 132 | <li>Feat: <code>getenv</code> added to get environment variable previously set (Windows).</li> |
96 | <li>Feat: <a href="../index.html#random">random</a> added to return high-quality random bytes</li> | 133 | <li>Feat: <code>random</code> added to return high-quality random bytes</li> |
97 | <li>Feat: <a href="../index.html#isatty">isatty</a> added to check if a file-handle is a tty</li> | 134 | <li>Feat: <code>isatty</code> added to check if a file-handle is a tty</li> |
98 | </ul> | 135 | </ul> |
99 | 136 | ||
100 | <h3>Version 0.2.1, released 02-Oct-2016</h3> | 137 | <h3>Version 0.2.1, released 02-Oct-2016</h3> |
@@ -113,8 +150,8 @@ | |||
113 | </div> <!-- id="content" --> | 150 | </div> <!-- id="content" --> |
114 | </div> <!-- id="main" --> | 151 | </div> <!-- id="main" --> |
115 | <div id="about"> | 152 | <div id="about"> |
116 | <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> | 153 | <i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> |
117 | <i style="float:right;">Last updated 2023-12-15 13:15:09 </i> | 154 | <i style="float:right;">Last updated 2024-06-20 23:11:37 </i> |
118 | </div> <!-- id="about" --> | 155 | </div> <!-- id="about" --> |
119 | </div> <!-- id="container" --> | 156 | </div> <!-- id="container" --> |
120 | </body> | 157 | </body> |
diff --git a/docs/topics/LICENSE.md.html b/docs/topics/LICENSE.md.html index de3eeff..9866af5 100644 --- a/docs/topics/LICENSE.md.html +++ b/docs/topics/LICENSE.md.html | |||
@@ -27,17 +27,38 @@ | |||
27 | <h1>Lua-System</h1> | 27 | <h1>Lua-System</h1> |
28 | 28 | ||
29 | 29 | ||
30 | <ul> | ||
31 | <li><a href="../index.html">Index</a></li> | ||
32 | </ul> | ||
33 | |||
30 | 34 | ||
31 | 35 | ||
32 | <h2>Topics</h2> | 36 | <h2>Topics</h2> |
33 | <ul class=""> | 37 | <ul class=""> |
34 | <li><a href="../topics/01-introduction.md.html">1. Introduction</a></li> | 38 | <li><a href="../topics/01-introduction.md.html">1. Introduction</a></li> |
39 | <li><a href="../topics/02-development.md.html">2. Development</a></li> | ||
40 | <li><a href="../topics/03-terminal.md.html">3. Terminal functionality</a></li> | ||
35 | <li><a href="../topics/CHANGELOG.md.html">CHANGELOG</a></li> | 41 | <li><a href="../topics/CHANGELOG.md.html">CHANGELOG</a></li> |
36 | <li><strong>MIT License</strong></li> | 42 | <li><strong>MIT License</strong></li> |
37 | </ul> | 43 | </ul> |
38 | <h2>Modules</h2> | 44 | <h2>Modules</h2> |
39 | <ul class="nowrap"> | 45 | <ul class="nowrap"> |
40 | <li><a href="../index.html">system</a></li> | 46 | <li><a href="../modules/system.html">system</a></li> |
47 | </ul> | ||
48 | <h2>Classes</h2> | ||
49 | <ul class="nowrap"> | ||
50 | <li><a href="../classes/bitflags.html">bitflags</a></li> | ||
51 | </ul> | ||
52 | <h2>Examples</h2> | ||
53 | <ul class="nowrap"> | ||
54 | <li><a href="../examples/compat.lua.html">compat.lua</a></li> | ||
55 | <li><a href="../examples/flag_debugging.lua.html">flag_debugging.lua</a></li> | ||
56 | <li><a href="../examples/password_input.lua.html">password_input.lua</a></li> | ||
57 | <li><a href="../examples/read.lua.html">read.lua</a></li> | ||
58 | <li><a href="../examples/readline.lua.html">readline.lua</a></li> | ||
59 | <li><a href="../examples/spinner.lua.html">spinner.lua</a></li> | ||
60 | <li><a href="../examples/spiral_snake.lua.html">spiral_snake.lua</a></li> | ||
61 | <li><a href="../examples/terminalsize.lua.html">terminalsize.lua</a></li> | ||
41 | </ul> | 62 | </ul> |
42 | 63 | ||
43 | </div> | 64 | </div> |
@@ -47,7 +68,7 @@ | |||
47 | 68 | ||
48 | <h1>MIT License</h1> | 69 | <h1>MIT License</h1> |
49 | 70 | ||
50 | <h3>Copyright (c) 2016-2023 Oscar Lim</h3> | 71 | <h3>Copyright (c) 2016-2024 Oscar Lim</h3> |
51 | 72 | ||
52 | <p>Permission is hereby granted, free of charge, to any person obtaining a copy of | 73 | <p>Permission is hereby granted, free of charge, to any person obtaining a copy of |
53 | this software and associated documentation files (the "Software"), to deal in | 74 | this software and associated documentation files (the "Software"), to deal in |
@@ -71,8 +92,8 @@ SOFTWARE.</p> | |||
71 | </div> <!-- id="content" --> | 92 | </div> <!-- id="content" --> |
72 | </div> <!-- id="main" --> | 93 | </div> <!-- id="main" --> |
73 | <div id="about"> | 94 | <div id="about"> |
74 | <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> | 95 | <i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i> |
75 | <i style="float:right;">Last updated 2023-12-15 13:15:09 </i> | 96 | <i style="float:right;">Last updated 2024-06-20 23:11:37 </i> |
76 | </div> <!-- id="about" --> | 97 | </div> <!-- id="about" --> |
77 | </div> <!-- id="container" --> | 98 | </div> <!-- id="container" --> |
78 | </body> | 99 | </body> |