Commit graph

1268 commits

Author SHA1 Message Date
Fabian Homborg
5b4db4a6ea docs: Remove some useless wrappers
The "classic" theme is a mostly useless wrapper around the basic theme
that just adds a collapsible sidebar (that we no longer have).

Moving to basic directly drops a layer of indirection and a file that
needs to be transferred over the net.

Same thing goes for "default.css" which literally just includes
classic.css (WHYYYY???)

(also this removes some useless javascript)
2021-03-02 16:59:38 +01:00
Fabian Homborg
edfa6746c6 docs: Move pygments css 2021-03-02 16:52:28 +01:00
Fabian Homborg
bf801afef8 docs: Move custom.css into the main css
There's no real separation here so one file is preferable.

We'll leave the pygments.css intact because that handles a different thing
2021-03-02 16:49:23 +01:00
Fabian Homborg
12e059adf8 docs: Hardcode a list of short builtins for unmatched search
Unfortunately this has both stopwords and a length limit, and things
like "and" just are tough to search.

So what we do is leave everything as it is, but when a search fails,
we show a list of things that are hard to search for, currently that's
"and", "for", "if" and such.

Fixes #7757.
2021-03-02 14:17:29 +01:00
David Adam
c402ce0152 docs: note that function --on-variable is not fired for every change
As discussed in #7735.
2021-02-28 21:24:22 +08:00
David Adam
3e8e864c7c docs: note job expansion in bg/fg/jobs arguments
Discussed in #5019.
2021-02-28 20:56:23 +08:00
David Adam
39230978b3 docs: call the CHANGELOG "release notes" 2021-02-25 22:46:24 +08:00
David Adam
e9ec95f875 docs: minor updates to math documentation
Closes #7734.
2021-02-21 21:34:15 +08:00
ridiculousfish
11a373f121 Prevent redirecting internal processes to file descriptors above 2
The user may write for example:

    echo foo >&5

and fish would try to output to file descriptor 5, within the fish process
itself. This has unpredictable effects and isn't useful. Make this an
error.

Note that the reverse is "allowed" but ignored:

    echo foo 5>&1

this conceptually dup2s stdout to fd 5, but since no builtin writes to fd
5 we ignore it.
2021-02-20 16:16:45 -08:00
Ethel Morgan
5a0aa7824f Saturate exit codes to 255 for all builtins
After commit 6dd6a57c60, 3 remaining
builtins were affected by uint8_t overflow: `exit`, `return`, and
`functions --query`.

This commit:
- Moves the overflow check from `builtin_set_query` to `builtin_run`.
- Removes a conflicting int -> uint8_t conversion in `builtin_return`.
- Adds tests for the 3 remaining affected builtins.
- Simplifies the wording for the documentation for `set --query`.
- Does not change documentation for `functions --query`, because it does
  not state the exit code in its API.
- Updates the CHANGELOG to reflect the change to all builtins.
2021-02-13 08:41:51 +01:00
Ethel Morgan
6dd6a57c60 Saturate return value in builtin_set_query
builtin_set_query returns the number of missing variables. Because the
return value passed to the shell is an 8-bit unsigned integer, if the
number of missing variables is a multiple of 256, it would overflow to 0.

This commit saturates the return value at 255 if there are more than 255
missing variables.
2021-02-08 20:38:56 +01:00
Fabian Homborg
b3626d48e7 Highlight keywords differently
This introduces a new variable $fish_color_keyword that will be used
to highlight keywords. If it's not defined, we fall back on
$fish_color_command as before.

An issue here is that most of our keywords have this weird duality of
also being builtins *if* executed without an argument or with
`--help`.

This means that e.g.

    if

is highlighted as a command until you start typing

    if t

and then it turns keyword.
2021-02-07 21:18:51 +01:00
Fabian Homborg
c8a91cb067 docs: Fix link in bind
Found while replacing links with :ref: roles, which are checked.
2021-02-05 20:19:28 +01:00
Fabian Homborg
b70600e070 docs: Remove errant space 2021-02-05 17:11:29 +01:00
Michael Jarvis
496d7c44a1 Fix sphinx doc warning
~/src/fish-shell/doc_src/cmds/argparse.rst:103: WARNING: Literal block ends without a blank line; unexpected unindent.
~/src/fish-shell/doc_src/cmds/argparse.rst:103: WARNING: Literal block ends without a blank line; unexpected unindent.
2021-02-05 11:07:58 +01:00
Fabian Homborg
3eef295990 docs/argparse: Remove more of the vestigial shortopt mentions
It should only be mentioned as a backwards-compatibility measure,
because it is useless - not even the short flag variable is set.
2021-02-03 19:13:53 +01:00
Fabian Homborg
d2d18e2a6a docs: Remove references to read history
This hasn't been kept since #5904 in 3.1.0.
2021-02-02 09:42:57 +01:00
Fabian Homborg
bb1aa5e72f docs: Make more code lines shorter 2021-02-02 08:35:38 +01:00
Fabian Homborg
8bb3d1198f docs: Make code lines shorter 2021-02-02 08:29:31 +01:00
Fabian Homborg
2faf814da4 docs: Point away from set -x
This is a common anti-pattern, we should try to get people to do `set -gx`.
2021-02-01 18:12:24 +01:00
Fabian Homborg
6442dc96d6 docs: Add a loops section to index
This was only in the tutorial - we really should improve the split here.
2021-01-31 13:15:03 +01:00
Fabian Homborg
7eb616b787 docs: Make some things subsections
E.g. autoloading and aliases are both about functions, variable scope
and overrides are both about variables.

It makes sense to group these together, and this might allow us to
collapse some of the TOC later.
2021-01-31 12:34:47 +01:00
Fabian Homborg
02c11e1db5 docs: Put variable expansion before command substitution
That's the order the parent section lists it in.
2021-01-31 12:30:20 +01:00
Fabian Homborg
892330b904 docs: Drop "Other features" header
This has two features now, there's no need to group it.
2021-01-31 11:59:43 +01:00
Fabian Homborg
00fc56f3e1 docs: Drop weird local table of contents from "Installation" section
This is about a page long, it doesn't need links.
2021-01-31 11:57:51 +01:00
Fabian Homborg
ad560e2b80 docs: Expand a bit on the alias/abbr thing
Also move abbr explanation to interactive use (as abbrs are purely an
interactive concept)

(also add an example to tilde expansion, not making a separate commit
for that)
2021-01-31 11:56:19 +01:00
Fabian Homborg
8e8349d714 docs: Unify job control
Remove the redundant "running multiple programs" section and merge the
"job control" and "background" sections.
2021-01-31 11:49:54 +01:00
Fabian Homborg
9fead046b5 docs: Explain the man/help split in the help section 2021-01-31 11:41:46 +01:00
Fabian Homborg
594d51e7eb Add a separate --profile-startup option to profile startup
This goes to a separate file because that makes option parsing easier
and allows profiling both at the same time.

The "normal" profile now contains only the profile data of the actual
run, which is much more useful - you can now profile a function by
running

   fish -C 'source /path/to/thing' --profile /tmp/thefunction.prof -c 'thefunction'

and won't need to filter out extraneous information.
2021-01-29 20:46:34 +01:00
Fabian Homborg
cf800db10a docs: Move things from "Other features" to "Interactive use"
These are interactive features, after all
2021-01-29 20:08:37 +01:00
Fabian Homborg
ca3d226659 docs: Fix TOC text and put them in a div
This allows us to flex them together, so now you get one column on the
left with the title "Documents" and one on the right saying
"Sections" on narrow screens.

On wide screens it doesn't say "Table Of Contents" twice.

This should make it clearer
2021-01-27 22:02:35 +01:00
Fabian Homborg
3d180b7c50 docs: Make TOC appear first on narrow screens
This used to put the TOC last, which is the last place you'd want it.

It's not perfect and we do some hacky layoutery to achieve it, but it
should generally be usable.
2021-01-27 21:53:24 +01:00
Fabian Homborg
711fa31871 docs: Remove broken footnote
Oops!
2021-01-27 18:25:46 +01:00
Fabian Homborg
fc5f7975a6 docs: Make tables scrollable on overflow
This makes the *tables* themselves scrollable, not the section div
they are in, which means the section doesn't scroll along with
them (it's already reflowed).
2021-01-27 17:56:24 +01:00
Fabian Homborg
dd64035d23 docs: Some adjustments
Rewordings, :ref: links, typos
2021-01-27 17:39:09 +01:00
Fabian Homborg
4a7ce4f51c docs: More line-length fixes 2021-01-26 16:15:38 +01:00
Fabian Homborg
cbc9de3663 docs: Make the lines in the code examples shorter
We should typically avoid scrolling even at max-width.

An exception here is the output of `functions` - this prints one very
long line, but it's really not important what's in there specifically,
it's just to illustrate the kind of output you'd get.
2021-01-26 09:29:58 +01:00
Fabian Homborg
d5ce648e10 docs/theme: Indent
Just do what emacs does, I don't like any of the available css
autoformatters (and we don't use it enough for that to matter)
2021-01-26 09:19:47 +01:00
Fabian Homborg
1e0ac9fa77 docs/theme: Remove prefixed boxshadow
See https://caniuse.com/css-boxshadow

TL;DR: It's supported by everything, the unprefixed version was added
to Firefox *4*.
2021-01-26 09:18:07 +01:00
Fabian Homborg
75f197b28e docs/theme: Add bottom margin
This makes it look like it's a page on top of the background gradient
2021-01-26 09:10:42 +01:00
Fabian Homborg
d4e76f5c5a docs/theme: Remove a bit of padding 2021-01-25 23:02:38 +01:00
Fabian Homborg
dc552fa0ab docs/theme: Make sidebar border less intrusive
Only on the right, much lighter, no radius
2021-01-25 22:59:30 +01:00
Fabian Homborg
651259e794 docs/theme: Fix padding when the searchbox is last
See e.g. the commands page - there's no separate TOC, so the searchbox
almost runs into the border
2021-01-25 22:55:29 +01:00
Fabian Homborg
117e663efe docs/theme: Remove horizontal scrolling on small screens
This clips overflowing padding/margins and thereby removes
non-"content" that's just off-screen, making the site scrollable.

The exception here is for tables - we allow scrolling the *section*
divs for those (because I have no idea how to only make the <table>
scrollable), if necessary of course.
2021-01-25 22:24:28 +01:00
Fabian Homborg
c39c985512 docs/theme: Limit fmain width
This causes it to be centered when the screen is large
2021-01-25 21:52:07 +01:00
Fabian Homborg
159c2aae1f docs/theme: Fix padding on small screens
This had the text overflowing the screen.

Now it should center nicely.
2021-01-25 21:34:42 +01:00
Fabian Homborg
5b366b9cb5 docs/tutorial: Mention alias
This came up online - here we exclaim that fish has no aliases (which
is true), but then in the main docs we explain that you can use
`alias` to make something (which is also true).

Add a foot note explaining the apparent contradiction.
2021-01-25 19:11:00 +01:00
Fabian Homborg
b59cad3c5b
Merge pull request #7654 from mattdutson/intro-doc
More improvements to clarity and grammar of Introduction doc page
2021-01-25 19:08:19 +01:00
Fabian Homborg
5f93df240e Fish for bash users: Fix missing word and link it from index 2021-01-22 16:23:09 +01:00
Fabian Homborg
1285957703 docs: Add glob example to variable overrides
And clarify that it'll still run the same things
2021-01-17 10:31:23 +01:00