Skip to content

Commit e0bc8f7

Browse files
committed
release 1.15.0 docs
1 parent 83597c5 commit e0bc8f7

File tree

12 files changed

+65
-53
lines changed

12 files changed

+65
-53
lines changed

docs/classes/pl.Map.html

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ <h1>Penlight</h1>
3333

3434
<h2>Contents</h2>
3535
<ul>
36-
<li><a href="#Fields">Fields</a></li>
3736
<li><a href="#Methods">Methods</a></li>
3837
<li><a href="#Metamethods">Metamethods</a></li>
3938
</ul>
@@ -137,26 +136,23 @@ <h1>Class <code>pl.Map</code></h1>
137136
</p>
138137

139138

140-
<h2><a href="#Fields">Fields</a></h2>
139+
<h2><a href="#Methods">Methods</a></h2>
141140
<table class="function_list">
142141
<tr>
143-
<td class="name" nowrap><a href="#pl.map.keys">pl.map.keys</a></td>
144-
<td class="summary">list of keys.</td>
142+
<td class="name" nowrap><a href="#pl.map:keys">pl.map:keys ()</a></td>
143+
<td class="summary">return a List of all keys.</td>
145144
</tr>
146145
<tr>
147-
<td class="name" nowrap><a href="#pl.map.values">pl.map.values</a></td>
148-
<td class="summary">list of values.</td>
146+
<td class="name" nowrap><a href="#pl.map:values">pl.map:values ()</a></td>
147+
<td class="summary">return a List of all values.</td>
149148
</tr>
150-
</table>
151-
<h2><a href="#Methods">Methods</a></h2>
152-
<table class="function_list">
153149
<tr>
154150
<td class="name" nowrap><a href="#pl.map:iter">pl.map:iter ()</a></td>
155151
<td class="summary">return an iterator over all key-value pairs.</td>
156152
</tr>
157153
<tr>
158154
<td class="name" nowrap><a href="#pl.map:items">pl.map:items ()</a></td>
159-
<td class="summary">return a List of all key-value pairs, sorted by the keys.</td>
155+
<td class="summary">return a List of all key-value pairs, sorted by the keys in ascending order.</td>
160156
</tr>
161157
<tr>
162158
<td class="name" nowrap><a href="#pl.map:setdefault">pl.map:setdefault (key, default)</a></td>
@@ -199,15 +195,15 @@ <h2><a href="#Metamethods">Metamethods</a></h2>
199195
<br/>
200196

201197

202-
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
198+
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
203199

204200
<dl class="function">
205201
<dt>
206-
<a name = "pl.map.keys"></a>
207-
<strong>pl.map.keys</strong>
202+
<a name = "pl.map:keys"></a>
203+
<strong>pl.map:keys ()</strong>
208204
</dt>
209205
<dd>
210-
list of keys.
206+
return a List of all keys.
211207

212208

213209

@@ -217,11 +213,11 @@ <h2 class="section-header "><a name="Fields"></a>Fields</h2>
217213

218214
</dd>
219215
<dt>
220-
<a name = "pl.map.values"></a>
221-
<strong>pl.map.values</strong>
216+
<a name = "pl.map:values"></a>
217+
<strong>pl.map:values ()</strong>
222218
</dt>
223219
<dd>
224-
list of values.
220+
return a List of all values.
225221

226222

227223

@@ -230,10 +226,6 @@ <h2 class="section-header "><a name="Fields"></a>Fields</h2>
230226

231227

232228
</dd>
233-
</dl>
234-
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
235-
236-
<dl class="function">
237229
<dt>
238230
<a name = "pl.map:iter"></a>
239231
<strong>pl.map:iter ()</strong>
@@ -253,7 +245,7 @@ <h2 class="section-header "><a name="Methods"></a>Methods</h2>
253245
<strong>pl.map:items ()</strong>
254246
</dt>
255247
<dd>
256-
return a List of all key-value pairs, sorted by the keys.
248+
return a List of all key-value pairs, sorted by the keys in ascending order.
257249

258250

259251

docs/examples/seesubst.lua.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ <h2>seesubst.lua</h2>
150150
<span class="keyword">local</span> fun = sip.<span class="function-name">compile</span> <span class="string">'$v.$v.$v'</span>
151151

152152
<span class="keyword">for</span> line <span class="keyword">in</span> stringx.<span class="function-name">lines</span>(s) <span class="keyword">do</span>
153-
line = <span class="function-name">gsub</span>(line,<span class="string">'@see $p'</span>,<span class="keyword">function</span>(see,path)
153+
<span class="keyword">local</span> newline = <span class="function-name">gsub</span>(line,<span class="string">'@see $p'</span>,<span class="keyword">function</span>(see,path)
154154
<span class="keyword">if</span> <span class="function-name">fun</span>(path,res) <span class="keyword">or</span> <span class="function-name">mod</span>(path,res) <span class="keyword">then</span>
155155
<span class="keyword">local</span> ret = (<span class="string">'[see %s](%s.%s.html'</span>):<span class="function-name">format</span>(path,res[<span class="number">1</span>],res[<span class="number">2</span>])
156156
<span class="keyword">if</span> res[<span class="number">3</span>] <span class="keyword">then</span>
@@ -160,7 +160,7 @@ <h2>seesubst.lua</h2>
160160
<span class="keyword">end</span>
161161
<span class="keyword">end</span>
162162
<span class="keyword">end</span>)
163-
<span class="global">print</span>(line)
163+
<span class="global">print</span>(newline)
164164
<span class="keyword">end</span></pre>
165165

166166

docs/examples/symbols.lua.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,13 @@ <h2>symbols.lua</h2>
252252
</span> <span class="keyword">local</span> res = {}
253253
<span class="keyword">if</span> npe <span class="keyword">then</span> <span class="function-name">append</span>(res,npe) <span class="keyword">end</span>
254254
<span class="keyword">for</span> val,count <span class="keyword">in</span> <span class="global">pairs</span>(<span class="function-name">count_map</span>(pe,equals)) <span class="keyword">do</span>
255+
<span class="keyword">local</span> nval = val
255256
<span class="keyword">if</span> count &gt; <span class="number">1</span> <span class="keyword">then</span>
256-
<span class="keyword">if</span> op == <span class="string">'*'</span> <span class="keyword">then</span> val = val ^ count
257-
<span class="keyword">else</span> val = val * count
257+
<span class="keyword">if</span> op == <span class="string">'*'</span> <span class="keyword">then</span> nval = nval ^ count
258+
<span class="keyword">else</span> nval = nval * count
258259
<span class="keyword">end</span>
259260
<span class="keyword">end</span>
260-
<span class="function-name">append</span>(res,val)
261+
<span class="function-name">append</span>(res,nval)
261262
<span class="keyword">end</span>
262263
<span class="keyword">if</span> #res == <span class="number">1</span> <span class="keyword">then</span> <span class="keyword">return</span> res[<span class="number">1</span>] <span class="keyword">end</span>
263264
<span class="keyword">return</span> <span class="function-name">PE</span>{op=op,<span class="function-name">unpack</span>(res)}

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ <h2>Examples</h2>
114114
<div id="content">
115115

116116

117-
<h2>Penlight Lua Libraries 1.14.0</h2>
117+
<h2>Penlight Lua Libraries 1.15.0</h2>
118118
<p>Penlight is a set of pure Lua libraries for making it easier to work with common tasks like iterating over directories, reading configuration files and the like. Provides functional operations on tables and sequences. Visit the <a href="https://github.com/lunarmodules/Penlight">GitHub project</a> to review the code or file issues. Skip to the <a href="manual/01-introduction.md.html#">introduction</a>.</p>
119119

120120
<h2>Libraries</h2>

docs/libraries/pl.path.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ <h2 class="section-header "><a name="Functions"></a>Functions</h2>
279279
</dt>
280280
<dd>
281281
Lua iterator over the entries of a given directory.
282-
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#reference"><code>luafilesystem.dir</code></a>
282+
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#dir"><code>luafilesystem.dir</code></a>
283283

284284

285285

@@ -294,7 +294,7 @@ <h2 class="section-header "><a name="Functions"></a>Functions</h2>
294294
</dt>
295295
<dd>
296296
Creates a directory.
297-
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#reference"><code>luafilesystem.mkdir</code></a>
297+
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#mkdir"><code>luafilesystem.mkdir</code></a>
298298

299299

300300

@@ -309,7 +309,7 @@ <h2 class="section-header "><a name="Functions"></a>Functions</h2>
309309
</dt>
310310
<dd>
311311
Removes a directory.
312-
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#reference"><code>luafilesystem.rmdir</code></a>
312+
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#rmdir"><code>luafilesystem.rmdir</code></a>
313313

314314

315315

@@ -324,7 +324,7 @@ <h2 class="section-header "><a name="Functions"></a>Functions</h2>
324324
</dt>
325325
<dd>
326326
Gets attributes.
327-
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#reference"><code>luafilesystem.attributes</code></a>
327+
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#attributes"><code>luafilesystem.attributes</code></a>
328328

329329

330330

@@ -339,7 +339,7 @@ <h2 class="section-header "><a name="Functions"></a>Functions</h2>
339339
</dt>
340340
<dd>
341341
Get the working directory.
342-
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#reference"><code>luafilesystem.currentdir</code></a>
342+
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#currentdir"><code>luafilesystem.currentdir</code></a>
343343

344344

345345

@@ -354,7 +354,7 @@ <h2 class="section-header "><a name="Functions"></a>Functions</h2>
354354
</dt>
355355
<dd>
356356
Gets symlink attributes.
357-
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#reference"><code>luafilesystem.symlinkattributes</code></a>
357+
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#symlinkattributes"><code>luafilesystem.symlinkattributes</code></a>
358358

359359

360360

@@ -371,7 +371,7 @@ <h2 class="section-header "><a name="Functions"></a>Functions</h2>
371371
Changes the working directory.
372372
On Windows, if a drive is specified, it also changes the current drive. If
373373
only specifying the drive, it will only switch drive, but not modify the path.
374-
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#reference"><code>luafilesystem.chdir</code></a>
374+
Implicit link to <a href="https://lunarmodules.github.io/luafilesystem/manual.html#chdir"><code>luafilesystem.chdir</code></a>
375375

376376

377377

@@ -462,7 +462,7 @@ <h3>Parameters:</h3>
462462
<h3>Returns:</h3>
463463
<ol>
464464

465-
the file path if it exists (either as file, directory, socket, etc), nil otherwise
465+
the file path if it exists (either as file, directory, socket, etc), false otherwise
466466
</ol>
467467

468468

docs/libraries/pl.utils.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ <h2><a href="#File_handling">File handling </a></h2>
230230
</table>
231231
<h2><a href="#OS_functions">OS functions </a></h2>
232232
<table class="function_list">
233+
<tr>
234+
<td class="name" nowrap><a href="#execute">execute ()</a></td>
235+
<td class="summary">Execute a shell command.</td>
236+
</tr>
233237
<tr>
234238
<td class="name" nowrap><a href="#executeex">executeex (cmd, bin)</a></td>
235239
<td class="summary">execute a shell command and return the output.</td>
@@ -1105,6 +1109,21 @@ <h3>Raises:</h3>
11051109
<h2 class="section-header "><a name="OS_functions"></a>OS functions </h2>
11061110

11071111
<dl class="function">
1112+
<dt>
1113+
<a name = "execute"></a>
1114+
<strong>execute ()</strong>
1115+
</dt>
1116+
<dd>
1117+
Execute a shell command.
1118+
This function is a copy of <a href="../libraries/pl.compat.html#execute">compat.execute</a>.
1119+
1120+
1121+
1122+
1123+
1124+
1125+
1126+
</dd>
11081127
<dt>
11091128
<a name = "executeex"></a>
11101129
<strong>executeex (cmd, bin)</strong>
@@ -1147,7 +1166,7 @@ <h3>Returns:</h3>
11471166
<dd>
11481167
Quote and escape an argument of a command.
11491168
Quotes a single (or list of) argument(s) of a command to be passed
1150-
to <a href="https://www.lua.org/manual/5.4/manual.html#pdf-os.execute">os.execute</a>, <code>pl.utils.execute</code> or <a href="../libraries/pl.utils.html#executeex">pl.utils.executeex</a>.
1169+
to <a href="https://www.lua.org/manual/5.4/manual.html#pdf-os.execute">os.execute</a>, <a href="../libraries/pl.utils.html#execute">pl.utils.execute</a> or <a href="../libraries/pl.utils.html#executeex">pl.utils.executeex</a>.
11511170

11521171

11531172
<h3>Parameters:</h3>

docs/manual/01-introduction.md.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ <h3>Purpose</h3>
168168
perverse, this matches the intended use better.</p>
169169

170170
<p>The only important external dependence of Penlight is
171-
<a href="http://lunarmodules.github.io/luafilesystem/manual.html">LuaFileSystem</a>
171+
<a href="https://lunarmodules.github.io/luafilesystem/manual.html">LuaFileSystem</a>
172172
(<a href="http://stevedonovan.github.io/lua-stdlibs/lfs.html">lfs</a>), and if you want <a href="../libraries/pl.dir.html#copyfile">dir.copyfile</a> to work cleanly on Windows, you will need
173-
either <a href="http://alien.luaforge.net/">alien</a> or be using
174-
<a href="http://luajit.org">LuaJIT</a> as well. (The fallback is to call the equivalent
173+
either <a href="https://github.com/mascarenhas/alien">alien</a> or be using
174+
<a href="https://luajit.org">LuaJIT</a> as well. (The fallback is to call the equivalent
175175
shell commands.)</p>
176176

177177
<p><a name="To_Inject_or_not_to_Inject_"></a></p>
@@ -490,7 +490,7 @@ <h3>Generally useful functions.</h3>
490490

491491
<p>Penlight is fully compatible with Lua 5.1, 5.2 and LuaJIT 2. To ensure this,
492492
<a href="../libraries/pl.utils.html#">utils</a> also defines the global Lua 5.2
493-
<a href="http://www.lua.org/work/doc/manual.html#pdf-load">load</a> function as <code>utils.load</code></p>
493+
<a href="https://www.lua.org/work/doc/manual.html#pdf-load">load</a> function as <code>utils.load</code></p>
494494

495495
<ul>
496496
<li>the input (either a string or a function)</li>
@@ -677,7 +677,7 @@ <h3>Simplifying Object-Oriented Programming in Lua</h3>
677677
<p>So <code>Alice = class(); Alice._name = &apos;Alice&apos;</code> is exactly the same as <code>class.Alice()</code>.</p>
678678

679679
<p>This useful notation is borrowed from Hugo Etchegoyen's
680-
<a href="http://lua-users.org/wiki/MultipleInheritanceClasses">classlib</a> which further
680+
<a href="https://lua-users.org/wiki/MultipleInheritanceClasses">classlib</a> which further
681681
extends this concept to allow for multiple inheritance. Notice that the
682682
more convenient form puts the class name in the <em>current environment</em>! That is,
683683
you may use it safely within modules using the old-fashioned <code>module()</code>

docs/manual/02-arrays.md.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ <h3>Operations on two-dimensional tables</h3>
745745
<p>Two-dimensional tables are of course easy to represent in Lua, for instance
746746
<code>{{1,2},{3,4}}</code> where we store rows as subtables and index like so <code>A[col][row]</code>.
747747
This is the common representation used by matrix libraries like
748-
<a href="http://lua-users.org/wiki/LuaMatrix">LuaMatrix</a>. <a href="../libraries/pl.array2d.html#">pl.array2d</a> does not provide
748+
<a href="https://lua-users.org/wiki/LuaMatrix">LuaMatrix</a>. <a href="../libraries/pl.array2d.html#">pl.array2d</a> does not provide
749749
matrix operations, since that is the job for a specialized library, but rather
750750
provides generalizations of the higher-level operations provided by <a href="../libraries/pl.tablex.html#">pl.tablex</a>
751751
for one-dimensional arrays.</p>

docs/manual/03-strings.md.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ <h3>String Templates</h3>
263263
<p><a name="Another_Style_of_Template"></a></p>
264264
<h3>Another Style of Template</h3>
265265

266-
<p>A new module is <a href="../libraries/pl.template.html#">template</a>, which is a version of Rici Lake's <a href="http://lua-users.org/wiki/SlightlyLessSimpleLuaPreprocessor">Lua
266+
<p>A new module is <a href="../libraries/pl.template.html#">template</a>, which is a version of Rici Lake's <a href="https://lua-users.org/wiki/SlightlyLessSimpleLuaPreprocessor">Lua
267267
Preprocessor</a>. This
268268
allows you to mix Lua code with your templates in a straightforward way. There
269269
are only two rules:</p>

docs/manual/05-dates.md.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ <h2>Date and Time</h2>
127127
<p><a name="Creating_and_Displaying_Dates"></a></p>
128128
<h3>Creating and Displaying Dates</h3>
129129

130-
<p>The <a href="../classes/pl.Date.html#">Date</a> class provides a simplified way to work with <a href="http://www.lua.org/pil/22.1.html">date and
130+
<p>The <a href="../classes/pl.Date.html#">Date</a> class provides a simplified way to work with <a href="https://www.lua.org/pil/22.1.html">date and
131131
time</a> in Lua; it leans heavily on the functions
132132
<a href="https://www.lua.org/manual/5.4/manual.html#pdf-os.date">os.date</a> and <a href="https://www.lua.org/manual/5.4/manual.html#pdf-os.time">os.time</a>.</p>
133133

0 commit comments

Comments
 (0)