Commit graph

1667 commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
e930dc92b0 Make stylistic grammatical change to complete docs
Use a hyphen when referring to "xxx-style" completions.
2022-09-26 14:08:34 -05:00
ridiculousfish
07c09bdee2 Tutorial: Merge the footnotes on aliases and abbreviations together
@mqudsi's feedback from #9226
2022-09-24 15:15:33 -07:00
ridiculousfish
39f3f75f5b Correct abbreviations typo and doc link 2022-09-24 15:14:31 -07:00
Luca Trevisani
064699cade Add reference to abbreviations 2022-09-24 15:10:11 -07:00
ridiculousfish
692a2fc135 Sphinx: disable hyphenation
Hyphenation in our documentation is aggressive, even to the point of caus-
ing options themselves to be broken across lines. This makes the document-
ation hard to read, especially when you have an option like `string colle-
ct` which gets a weird hyphen.

Remove the hyphenation from the CSS.
2022-09-24 12:36:39 -07:00
Fabian Boehm
1204cf5eb6 docs/read: Improve examples a bit 2022-09-24 10:56:43 +02:00
Fabian Boehm
38b24c2325 docs: Use :doc: role when linking to commands
This makes it so we link to the very top of the document instead of a
special anchor we manually include.

So clicking e.g. :doc:`string <cmds/string>` will link you to
cmds/string.html instead of cmds/string.html#cmd-string.

I would love to have a way to say "this document from the root of the
document path", but that doesn't appear to work, I tried
`/cmds/string`.

So we'll just have to use cmds/string in normal documents and plain
`string` from other commands.
2022-09-24 10:56:43 +02:00
Fabian Boehm
17426d4741 docs: Write an example for interactive read 2022-09-23 16:25:35 +02:00
Luca Trevisani
86138db9f5 Fix Control+C key binding description 2022-09-20 23:21:16 +02:00
tocic
ade61fd50f docs: Fix typos 2022-09-17 21:31:06 +08:00
Mitchell Kember
ee1018ab53
Document that break cannot be used in switch 2022-09-17 00:12:10 -05:00
Fabian Boehm
47574de6b1 docs/path: Fix typos 2022-09-16 15:54:23 +02:00
Mitchell Kember
3e7ccefe11 Fix diagnostic flag in set_color docs 2022-09-15 20:01:04 +02:00
Fabian Boehm
ee6270301b docs: Moar history pager 2022-09-10 20:44:15 +02:00
Fabian Boehm
79642995f1 docs: ctrl-r is only history pager in emacs mode
We do not currently have a vi-binding for it because ctrl-r is redo
there.
2022-09-10 15:17:56 +02:00
Fabian Boehm
41c22d5e60 Add string shorten
This is essentially the inverse of `string pad`.
Where that adds characters to get up to the specified width,
this adds an ellipsis to a string if it goes over a specific maximum width.
The char can be given, but defaults to our ellipsis string.
("…" if the locale can handle it and "..." otherwise)

If the ellipsis string is empty, it just truncates.

For arguments given via argv, it goes line-by-line,
because otherwise length makes no sense.

If "--no-newline" is given, it adds an ellipsis instead and removes all subsequent lines.

Like pad and `length --visible`, it goes by visible width,
skipping recognized escape sequences, as those have no influence on width.

The default target width is the shortest of the given widths that is non-zero.

If the ellipsis is already wider than the target width,
we truncate instead. This is safer overall, so we don't e.g. move into a new line.
This is especially important given our default ellipsis might be width 3.
2022-09-09 18:49:57 +02:00
Fabian Boehm
09a50a2b1e Fix typo 2022-09-08 22:50:28 +02:00
Fabian Boehm
dbeb667ff4 Document history pager 2022-09-08 22:50:00 +02:00
Johannes Altmanninger
a6ff72bd64 faq.rst: fix typo 2022-08-31 07:49:49 +02:00
Fabian Boehm
a42a651d0a Use color for $fish_color_valid_path if it exists
This otherwise threw away the color. Since that's just information
that is thrown away, let's just use it.

Fixes #9159.
2022-08-25 17:42:42 +02:00
Fabian Boehm
c753f22003 docs: Format path synopsis
This was written while we changed how our synopses are formatted, so
we missed adding a "synopsis" marker to it.

The tokenizer here is a bit cheesy, so we can't mark continuation
lines with a "\", and we also can't mark the general options with a
":=". Tbh that's not a big deal.

Fixes #9154
2022-08-25 13:06:57 +02:00
Fabian Boehm
7e75118956 Document math's lack of bitnot
Fixes #9148
2022-08-23 19:55:55 +02:00
Johannes Altmanninger
20a3599b10 faq.rst: correct explanation of Ctrl-R/Ctrl-S bindings in history pager 2022-08-13 21:11:54 +02:00
Fabian Boehm
18df41e5e6 Document ctrl-r harder, add something on set -x 2022-08-12 21:28:11 +02:00
pagedown
9c16677706 help: Handle the missing builtin aliases : and [ 2022-08-12 20:45:20 +02:00
Fabian Boehm
df7b97d99d Link to correct path subcommand
Resolve is indeed the same as resolve
2022-08-08 21:13:10 +02:00
Fabian Boehm
39fbc27d8d Clarify math documentation
The words "rounded down" here get us into some trouble.
2022-08-06 10:58:46 +02:00
SeekingBlues
f9786673e3 Fix typo for or input function 2022-08-05 18:32:32 +02:00
Fabian Boehm
177cfbc605 docs/path: Add some more on resolve/normalize dichotomy 2022-08-02 19:58:43 +02:00
Johannes Altmanninger
453aac14af Advance pager history search with Control-R/Control-S
Note that every change to the search field still starts a new search, from
the end of history. We could change this in future but it's unclear to me
what the expected behavior is. I don't find the traditional readline behavior
very intuitive.
2022-07-30 23:27:24 +02:00
Johannes Altmanninger
dcff0a2f2b Add Control+R incremental history search in pager
This reimplements ridiculousfish/control_r which is a more future-proof
approach than #6686.
Pressing Control+R shows history in our pager and allows to search filter
commands with the pager search field.

On the surface, this works just like in other shells; though there are
some differences.

- Our pager shows multiple results at a time.
- Other shells allow to use up arrow/down arrow to select adjacent entries
  in history. Shouldn't be hard to implement but the hidden state might
  confuse users and it doesn't play well with up-or-search, so this is
  left out.

Users might expect the history pager to use subsequence matching (fuzzy
matching) like the completion pager, however due to the history pager design it
uses substring matching.  We could change this in future, however that means
we would also want to change the ordering from "reverse-chronological" to
"longest common subsequence" (e.g. what fuzzy finders do), because otherwise
a query "fis" might give this ordering:

            fsck /dev/disk/by-partlabel/Linux\x20filesystem
            fish

which is probably not what the user wants.

The pager shows only a small number of history items at a time.  This is
because, as explained above, the history pager does not support subsequence
matching, so navigating it does not scale well.

Closes #602
2022-07-30 23:27:24 +02:00
Michael Forster
91c68ec1af Add fish_cursor_selection_mode documentation 2022-07-30 09:49:23 -07:00
David Adam
4bad88f0df update Vi key binding documentation to reflect reality
PR #6777 changed all the keys to uppercase, but many Vi commands are case
sensitive.

PR #7908 changed the "u" binding but the documentation still had the old
meaning.
2022-07-21 22:57:37 +08:00
Fabian Boehm
547a4b2baf docs: Link some more to $PATH 2022-07-18 20:53:37 +02:00
Fabian Boehm
603a8e31e3 docs: Link fish_greeting function from FAQ
And explain the variable more in fish_greeting.

Closes #9056
2022-07-18 20:52:16 +02:00
Fabian Boehm
5dfb64b547
Add path mtime (#9057)
This can be used to print the modification time, like `stat` with some
options.

The reason is that `stat` has caused us a number of portability
headaches:

1. It's not available everywhere by default
2. The versions are quite different

For instance, with GNU stat it's `stat -c '%Y'`, with macOS it's `stat
-f %m`.

So now checking a cache file can be done just with builtins.
2022-07-18 20:39:01 +02:00
Aaron Gyes
92eb6024ed Document the three new [ operators
Explain test(1)'s -ef, -nt, -ot features.
2022-07-16 12:40:36 -07:00
Fabian Boehm
98ba66ed8e set_color: Print the given colors with --print-colors 2022-07-01 21:28:35 +02:00
Fabian Boehm
0a73b182c0 bind: Document --silent
See #9045
2022-07-01 20:46:52 +02:00
Fabian Boehm
993448d552 argparse: Allow usage without optspecs
It's still useful without, for instance to implement a command that
takes no options, or to check min-args or max-args.

(technically no optspecs, no min/max args and --ignore-unknown does
nothing, but that's a very specific error that we don't need to forbid)

Fixes #9006
2022-06-27 17:02:20 +02:00
ridiculousfish
53a2484fd1 Warn the user when visiting old documentation
This enhances our documentation to look for the file
/release_version.json in the root of our site. If found, and if it
contains a RELEASE_VERSION other than this version, then unhide a banner
warning about the stale documentation and linking to the current.
2022-06-20 17:56:14 -07:00
Fabian Boehm
1819c7f2b8 docs: Add more specific guidance on locale variables 2022-06-17 22:08:00 +02:00
Fabian Boehm
4f0c0486a6 Fix copy-pasteo in fish_config docs 2022-06-17 09:23:38 +02:00
Fabian Boehm
88b445ce9e Put short footnotes on one line again
Unlike before, this doesn't force the number to be on the same line as
strongly, that's fine.

So short footnotes look like

-------------
[1] Some text
-------------

Longer footnotes may look like

--------------
[2]

Some more text
--------------
2022-06-16 19:14:45 +02:00
Fabian Boehm
70a1febd6d Readd some missed changes
The "Warning:" on the warning (in index.html#default shell) wasn't in
the line with the text, the features list had more padding and some
headers were smaller, some table stuff
2022-06-16 19:14:45 +02:00
Fabian Boehm
e5a1da8b22 Remove unneeded guff 2022-06-16 19:14:45 +02:00
Fabian Boehm
6d8b88fb1d doc theme: Simplify
Move related stuff together and remove some unneeded guff

Specifically the weird "clear:" stuff causes rendering issues for me
in Firefox.
2022-06-16 19:14:45 +02:00
Fabian Homborg
618b0d0add Make doc css not depend on sphinx' css
This has required workarounds a few times, plus if it changes it might
break our theme. See e.g.

4712da3eb1
e27456df24
a6d484836e
85522036f5

So we import the rules we *use* and throw away the rest. Note that
this might still have rules that are no longer necessary - e.g. some
that are required to work around sphinx bugs would still be left.

It could benefit from some cleanup and simplification, and from
switching to a flex layout instead of the 230px hardcoded
sidebar - sphinx tried that, but it doesn't really work with our
narrow layout, so we disabled it again.
2022-06-16 19:14:45 +02:00
Fabian Boehm
8f08fe80fd Restyle codebase
Not a lot of changes, tbh
2022-06-16 18:43:28 +02:00
Fabian Boehm
18433278ec Document that status fish-path is platform-specific 2022-06-16 16:39:09 +02:00