Skip to content

Commit bd7e3fe

Browse files
committed
Documentation edits.
1 parent 0e50d78 commit bd7e3fe

File tree

6 files changed

+103
-57
lines changed

6 files changed

+103
-57
lines changed

CHANGES

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11

2-
### Changes
2+
# Changes
33

4-
##### v1.0.0
4+
### v1.0.0
55

66
- TODO
77

8-
##### v0.4.9
8+
### v0.4.9
99

1010
- Fixed broken Doskey on Win10 (#438, #451)
1111

12-
##### v0.4.8
12+
### v0.4.8
1313

1414
- Environment variable 'clink_profile' overrides Clink's profile path (#390).
1515
- Load a clink_inputrc file from Clink's profile directory (fixes #406).
1616
- Bug fixes;
1717
- Redraw issues when prompts end in OSC ANSI codes (#387, #384).
1818
- Fixed 'clink autorun --help' crash.
1919

20-
##### v0.4.7
20+
### v0.4.7
2121

2222
- Bug fixes;
2323
- Sometimes autorun tries to run clink.exe (#374).
2424
- Autorun would cause cmd.exe to return an error if it wasn't interactive (#373).
2525

26-
##### v0.4.6
26+
### v0.4.6
2727

2828
- HOME is only set if it is currently unset.
2929
- Readline can be initialised with .inputrc and _inputrc files too (#258).
@@ -42,7 +42,7 @@
4242
- Improved 'clink autorun' help (#348).
4343
- Fixed launching Clink when clink.bat is renamed (#357).
4444

45-
##### v0.4.5
45+
### v0.4.5
4646

4747
- Improved 'clink autorun'. It now defaults to the Current User registry hive.
4848
- 'clink set' gives more details for enumeration-type settings.
@@ -67,7 +67,7 @@
6767
- Fixed leaking exception filters.
6868
- Clearing the screen doesn't leave artefacts behind.
6969

70-
##### v0.4.4
70+
### v0.4.4
7171

7272
- Completing .. behaves more like Bash (#277).
7373
- Escape from yes/no question when Ctrl+C is pressed.
@@ -77,7 +77,7 @@
7777
- Fixed '!0' causing Clink to crash.
7878
- Save/restore cursor position in case Readline moves it.
7979

80-
##### v0.4.3
80+
### v0.4.3
8181

8282
- Localised Y/N when auto-answering 'terminate?' prompt.
8383
- $* would early out if there was no arguments.
@@ -96,7 +96,7 @@
9696
- Fixed missing WINCH signals if other processes resize the buffer.
9797
- Support Alt codes sent from Conhost.
9898

99-
##### v0.4.2
99+
### v0.4.2
100100

101101
- Prompt colouring no longer requires third party ANSI code utility.
102102
- Override settings with environment variables prefixed with 'clink'.
@@ -109,7 +109,7 @@
109109
- Windows XP works again.
110110
- Fixed race condition in lua_execute().
111111

112-
##### v0.4.1
112+
### v0.4.1
113113

114114
- Bug fixes;
115115
- Various Unicode fixes causing corrupt environment variables.
@@ -123,7 +123,7 @@
123123
- Added support for Windows' AltGr substitute Ctrl-Alt.
124124
- Support for Readline's 'menu' style completion (see docs).
125125

126-
##### v0.4
126+
### v0.4
127127

128128
- New features;
129129
- Better 'clink.arg' API. Easier, more intuitive, and more powerful.
@@ -154,7 +154,7 @@
154154
- Multiple locale fixes.
155155
- Use localised text for 'Terminate batch job?' prompt.
156156

157-
##### v0.3
157+
### v0.3
158158

159159
- Automatic answering of cmd.exe's 'Terminate batch script?' prompt.
160160
- Coloured prompts (requires ANSICON or ConEmu).
@@ -186,14 +186,14 @@
186186
- Start menu shortcut starts in USERPROFILE, like cmd.exe
187187
- Zip distribution is now portable.
188188

189-
##### v0.2.1
189+
### v0.2.1
190190

191191
- The .history file now merges multiple sessions together.
192192
- Fixed missing y/n, pause, and other prompts.
193193
- Fixed segfault in loader executable.
194194
- Better ConEmu compatibility.
195195

196-
##### v0.2
196+
### v0.2
197197

198198
- Basic argument completion for 'git', 'hg', 'svn', and 'p4'.
199199
- Traditional Bash clear screen ('Ctrl-L') and exit shortcuts ('Ctrl-D').
@@ -212,12 +212,16 @@
212212
- Improved hooking so Clink can be shared with other thirdparty utilities that
213213
also hook cmd.exe (ConEmu, ANSICon, etc.).
214214

215-
##### v0.1.1
215+
### v0.1.1
216216

217217
- Fixed AltGr+<key> on international keyboards.
218218
- Fixed broken completion when directories have a '-' in their name (Mark Hammond)
219219
- The check for single match scenarios now correctly handles case-insensitivity.
220220

221-
##### v0.1
221+
### v0.1
222222

223223
- Initial release.
224+
225+
<!-- vim: wrap nolist ft=markdown
226+
-->
227+

docs/clink.css

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ body {
55
font-family: Calibri, Arial, Helvetica, sans-serif;
66
}
77

8-
h3 {
8+
h1 {
99
width: 100%;
10-
border-bottom: 1px black solid;
10+
border-bottom: 2px black solid;
1111
}
1212

1313
h3 { font-size: 1.21em; }
@@ -47,6 +47,26 @@ pre code {
4747
border-radius: 0;
4848
}
4949

50+
kbd {
51+
padding:0.1em 0.3em;
52+
border-collapse:separate;
53+
border:1px solid #ccc;
54+
font-size:75%;
55+
font-family:Calibri,Arial,Helvetica,sans-serif;
56+
background-color:#eee;
57+
color:#333;
58+
-moz-box-shadow:0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 0px #ffffff inset;
59+
-webkit-box-shadow:0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 0px #ffffff inset;
60+
box-shadow:0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 0px #ffffff inset;
61+
-moz-border-radius:4px;
62+
-webkit-border-radius:4px;
63+
border-radius:4px;
64+
display:inline-block;
65+
margin:0 0.1em;
66+
vertical-align:0.1em;
67+
white-space:nowrap;
68+
}
69+
5070
#content td:nth-child(1) code {
5171
border: none;
5272
padding: 0 0 0 0;

docs/clink.html

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@
2020
for (var i = 0; i < mds.length; ++i)
2121
{
2222
var md = mds[i];
23-
var div = document.createElement("div");
23+
var div = document.getElementById(md.getAttribute("fill_id"));
2424
div.innerHTML = marked(md.innerText);
25-
div.id = md.getAttribute("_id");
26-
div.className = md.getAttribute("_class");
27-
content.insertBefore(div, md);
2825
}
2926

3027
// Generate a table of contents from h* tags.
3128
var toc = document.getElementById("toc");
32-
var headings = document.querySelectorAll("h3");//,h4");
29+
toc.innerHTML = "";
30+
var headings = document.querySelectorAll("h1");
3331
for (var i = 0; i < headings.length; ++i)
3432
{
3533
var h = headings[i];
@@ -59,24 +57,34 @@
5957
<div id="header">
6058
<div id="title">Clink v$(CLINK_VERSION)</div>
6159
<div id="url">
62-
<a href="http://github.com/mridgers/clink">
63-
http://github.com/mridgers/clink
60+
<a href="http://github.com/chrisant996/clink">
61+
http://github.com/chrisant996/clink
6462
</a>
6563
</div>
6664
<div id="author">
67-
<a href="http://twitter.com/choddlander">Martin Ridgers</a>
65+
<a href="mailto:[email protected]">Christopher Antos</a> (renovater)
66+
</div>
67+
<div id="author">
68+
<a href="http://twitter.com/choddlander">Martin Ridgers</a> (creator)
6869
</div>
6970
</div>
7071
<div id="toc"></div>
7172
<div id="content">
72-
<md _class="section" _id="documentation" style="display: none;">
73-
$(INCLUDE docs/clink.md)
74-
</md>
75-
<h3 id="lua-api">Lua API Reference</h3>
73+
<div class="section" id="documentation"></div>
74+
<h1 id="lua-api">Lua API Reference</h1>
7675
<div class="section" id="api">
7776
$(INCLUDE .build/docs/api_html)
7877
</div>
79-
<md _class="section" _id="changes" style="display: none;">
78+
<div class="section" id="changes"></div>
79+
<div class="section" id="credits"></div>
80+
<!-- All md tags must come last, otherwise they interfere with each other -->
81+
<md fill_id="credits" style="display: none;">
82+
$(INCLUDE docs/credits.md)
83+
</md>
84+
<md fill_id="documentation" style="display: none;">
85+
$(INCLUDE docs/clink.md)
86+
</md>
87+
<md fill_id="changes" style="display: none;">
8088
$(INCLUDE CHANGES)
8189
</md>
8290
</div>

docs/clink.md

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Name | Description
6969
`exec.cwd` | When matching executables as the first word (`exec.enable`), include executables in the current directory. (This is implicit if the word being completed is a relative path).
7070
`exec.dirs` | When matching executables as the first word (`exec.enable`), also include directories relative to the current working directory as matches.
7171
`exec.enable` | Only match executables when completing the first word of a line.
72-
`exec.path` | When matching executables as the first word (`exec.enable`), include executables found in the directories specified in the `PATH` environment variable.
72+
`exec.path` | When matching executables as the first word (`exec.enable`), include executables found in the directories specified in the `%PATH%` environment variable.
7373
`exec.space_prefix` | If the line begins with whitespace then Clink bypasses executable matching (`exec.path`) and will do normal files matching instead.
7474
`files.hidden` | Includes or excludes files with the "hidden" attribute set when generating file lists.
7575
`files.system` | Includes or excludes files with the "system" attribute set when generating file lists.
@@ -87,6 +87,8 @@ Name | Description
8787
`terminal.emulate` | Clink can either emulate a virtual terminal and handle ANSI escape codes itself, or let the console host natively handle ANSI escape codes. `off` = let the console host process ANSI escape codes, `on` = emulate a virtual terminal, `auto` = only emulate if the console host doesn't say it supports ANSI escape codes.
8888
`terminal.modify_other_keys` | When enabled, pressing Space or Tab with modifier keys sends extended XTerm key sequences so they can be bound separately.
8989

90+
<br>
91+
9092
> Notes:
9193
> - The `esc_clears_line` setting has been replaced by a `clink-reset-line` command that can be bound to <kbd>Escape</kbd> (or any other key).
9294
> - The `history_file_lines` setting doesn't exist at the moment. _**NYI:** Some mechanism for trimming history will be added eventually._
@@ -96,12 +98,12 @@ Name | Description
9698

9799
Settings and history are persisted to disk from session to session. The location of these files depends on which distribution of Clink was used. If you installed Clink using the .exe installer then Clink uses the current user's non-roaming application data directory. This user directory is usually found in one of the following locations;
98100

99-
- `c:\Documents and Settings\<username>\Local Settings\Application Data` *(XP)*
100-
- `c:\Users\<username>\AppData\Local` *(Vista onwards)*
101+
- Windows XP: `c:\Documents and Settings\&lt;username&gt;\Local Settings\Application Data`
102+
- Windows Vista onwards: `c:\Users\&lt;username&gt;\AppData\Local`
101103

102104
The .zip distribution of Clink creates and uses a directory called `profile` which is located in the same directory where Clink's core files are found.
103105

104-
All of the above locations can be overridden using the `--profile <path>` command line option which is specified when injecting Clink into cmd.exe using `clink inject`.
106+
All of the above locations can be overridden using the `--profile &lt;path&gt;` command line option which is specified when injecting Clink into cmd.exe using `clink inject`.
105107

106108
<br>
107109

@@ -111,7 +113,7 @@ Readline itself can also be configured to add custom keybindings and macros by c
111113

112114
> **TODO:** Update the description of how/where inputrc files are loaded.
113115
114-
Clink will search in the directory as specified by the HOME environment variable for one or all of the following files; `clink_inputrc`, `_inputrc`, and `.inputrc`. If HOME is unset then Clink will use either of the standard Windows environment variables `%homedrive%\%homepath%` or `%userprofile%`.
116+
Clink will search in the directory as specified by the `%HOME%` environment variable for one or all of the following files; `clink_inputrc`, `_inputrc`, and `.inputrc`. If `%HOME%` is unset then Clink will use either of the standard Windows environment variables `%HOMEDRIVE%\%HOMEPATH%` or `%USERPROFILE%`.
115117

116118
Other software that also uses Readline will also look for the `.inputrc` file (and possibly the `_inputrc` file too). To set macros and keybindings intended only for Clink one can use the Readline init file conditional construct like this; `$if clink [...] $endif`.
117119

@@ -124,6 +126,8 @@ Name | Description
124126
`completion-auto-query-items`|Automatically prompts before displaying completions if they won't fit on one screen page.
125127
`history-point-at-end-of-anchored-search`|Puts the cursor at the end of the line when using `history-search-forward` or `history-search-backward`.
126128

129+
<br>
130+
127131
> **Compatibility Note:** The `clink_inputrc_base` file from v0.4.8 no longer exists.
128132
129133
## New commands
@@ -193,7 +197,7 @@ clink.register_match_generator(my_match_generator, sort_id)
193197

194198
The `sort_id` argument is used to sort the match generators such that generators with a lower sort ids are called first.
195199

196-
Here is an simple example script that checks if `text` begins with a `%` character and then uses the remained of `text` to match the names of environment variables.
200+
Here is an simple example script that checks if `text` begins with a `%` character and then uses the remainder of `text` to match the names of environment variables.
197201

198202
```lua
199203
function env_vars_match_generator(text, first, last)
@@ -420,6 +424,8 @@ These keys use other formats, so their full "special" sequences are listed in th
420424
|F3 |`\eOR` |
421425
|F4 |`\eOS` |
422426

427+
<br>
428+
423429
Here is an example line from a clink_inputrc file that binds Shift-End to the Readline function `transpose-word` function;
424430

425431
```
@@ -430,24 +436,5 @@ Here is an example line from a clink_inputrc file that binds Shift-End to the Re
430436

431437
> _**Deprecated:** Clink v0.4.8 had some basic support for Powershell, but v1.0.0 removed Powershell support._
432438
433-
<br>
434-
435-
# Credits
436-
437-
Clink was originally built by Martin Ridgers (https://github.com/mridgers/clink).<br>
438-
Copyright (c) 2012-2018 by Martin Ridgers.
439-
440-
Clink has been forked and revived by Christopher Antos (https://github.com/chrisant996/clink).<br>
441-
Portions Copyright (c) 2020 by Christopher Antos.
442-
443-
Clink uses the GNU Readline library version 8.0.
444-
> **TODO:** Include license and web site link.
445-
446-
Clink uses Lua.
447-
> **TODO:** Include version, license, and web site link.
448-
449-
Clink uses the getopt library.
450-
> **TODO:** Include cersion, license, and web site link.
451-
452439
<!-- vim: wrap nolist ft=markdown
453440
-->

docs/credits.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Credits
2+
3+
Clink was originally built by Martin Ridgers (https://github.com/mridgers/clink).<br>
4+
Copyright (c) 2012-2018 by Martin Ridgers.
5+
6+
Clink has been forked and revived by Christopher Antos (https://github.com/chrisant996/clink).<br>
7+
Portions Copyright (c) 2020 by Christopher Antos.
8+
9+
Clink uses the GNU Readline library version 8.0.
10+
> **TODO:** Include license and web site link.
11+
12+
Clink uses Lua.
13+
> **TODO:** Include version, license, and web site link.
14+
15+
Clink uses the getopt library.
16+
> **TODO:** Include version, license, and web site link.
17+
18+
Clink documentation uses the marked.min.js library.
19+
> **TODO:** Include version, license, and web site link.
20+
21+
Clink documentation uses the highlight.js library.
22+
> **TODO:** Include version, license, and web site link.
23+
24+
<!-- vim: wrap nolist ft=markdown
25+
-->

docs/premake5.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ local function generate_file(source_path, out)
1010
generate_file(include, out)
1111
else
1212
line = line:gsub("%$%(CLINK_VERSION%)", clink_git_name:upper())
13+
line = line:gsub("<(/?kbd)>", "&lt;%1&gt;")
14+
line = line:gsub("<br>", "&lt;br&gt;")
1315
out:write(line .. "\n")
1416
end
1517
end

0 commit comments

Comments
 (0)