For example, [`put`]() links to the elvdoc for "put".
Also remove the @cf macro now that implicit targets make it easier to link to
other elvdoc sections.
Use Elvish qnames to refer to the binding map too. This is consistent with how
functions are passed, and removes the need to pass around the binding map var,
which is quite awkward in initHighlighter where the binding map is created in a
different place.
The Error methods used to show the start and end indices, while the Show methods
used to show line ranges.
Showing line:col of the start position seems to be pretty standard; both Go and
Rust do that.
I tried including the line:col of the end position too, but can't find a good
enough format.
The Errors function is not related to diag.Error, so keeping it in the same
package is confusing.
Also unexport the MultiError type. This allows its Error method to be
simplified, as it can assume that it always contains at least 2 errors.
We are no longer using Pandoc, so this limitation can be lifted.
Also make @cf generate internal links where applicable in non-builtin modules:
"@cf mod:fn" in the doc of "mod" now links to just "#mod:fn" instead of
"mod.html#mod:fn".
The elvdocs still use the old format (#elvdoc:fn or #elvdoc:var) for now, but
will be changed to "fn" and "var" forms soon.
Also remove the accidentally committed cmd/mvelvdoc. It has been used to perform
the conversion automatically but is not supposed to be committed.
The main benefits of this change are:
1) It uses a hermetic "home" directory with a known command and location
history. Which means it no longer depends on the interactive history
and directory layout of the person creating the ttyshot. Which also
means it no longer leaks the private history of anyone creating a
ttyshot. This produces reproducible results when updating ttyshots.
2) The user no longer has to augment the ttyshot by manually adding the
output of the commands to the generated HTML file. A process that is
error prone. The output of the commands that generate the ttyshot is
now captured and automatically included in the resulting HTML.
3) It makes it trivial to recreate every ttyshot. Simply execute these
commands:
```
make ttyshot
for f [website/ttyshot/**.spec] { put $f; ./ttyshot $f }
```
4) It makes it easy to introduce new "ttyshot" images by creating a
shell session "spec" file. This makes it easy to replace the existing
"```elvish-transcript...```" examples with ttyshots in order to
ensure a consistent representation and visual consistency with the
transcripts that are currently generated as ttyshots.
The downside of this change is the introduction of a dependency on the
Tmux application. But that seems reasonable since Tmux is a mature
application available on Linux, macOS, BSD, and probably every other
UNIX like OS we care about. Note that generating the Elvish
documentation already depends on similar apps such as Pandoc.
Related #1459