Skip to content

Commit

Permalink
update lexicon for latest docs
Browse files Browse the repository at this point in the history
Closes #2699

Fixes issues with:
* 'string' function synopsis
* Redirection display issues
* Better file & path detection
* Rendering of % & @ chars in both html and man
* @ symbol in tutorial

Improves robustness by implementing an @EOL marker to prevent hold buffer dumping extra chars after the end of an expression.

Added new '{{' and '}}' meta-chars for when you want curly braces in a regexp that was previously tripping up the lexicon.

Improve man/html presentation consistency for
* string
* printf
* prompt_pwd
* type

Use cli-styling for 'practical' examples.

Add <bs> tag for presenting content with preceding backslash.

Signed-off-by: Mark Griffiths <mark@thebespokepixel.com>
  • Loading branch information
MarkGriffiths authored and Kurtis Rader committed Apr 4, 2016
1 parent 47f1a92 commit cb6d5d7
Show file tree
Hide file tree
Showing 13 changed files with 183 additions and 174 deletions.
2 changes: 2 additions & 0 deletions Doxyfile
Expand Up @@ -274,6 +274,8 @@ ALIASES += "span{2}=\2"
ALIASES += "spcl{2}=\2"

ALIASES += "bksl{1}=\\\1"
ALIASES += "pcnt{1}=\%\1"
ALIASES += "atat{1}=\@"

# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
Expand Down
2 changes: 2 additions & 0 deletions Doxyfile.help
Expand Up @@ -274,6 +274,8 @@ ALIASES += "span{2}=\2"
ALIASES += "spcl{2}=\2"

ALIASES += "bksl{1}=\\\1"
ALIASES += "pcnt{1}=\%\1"
ALIASES += "atat{1}=\@"

# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
Expand Down
2 changes: 2 additions & 0 deletions Doxyfile.user
Expand Up @@ -274,6 +274,8 @@ ALIASES += "span{2}=<span style=\"\1\">\2</span>"
ALIASES += "spcl{2}=<span class=\"\1\">\2</span>"

ALIASES += "bksl{1}=<span>\</span>\1"
ALIASES += "pcnt{1}=<span>%</span>\1"
ALIASES += "atat{1}=<span>@</span>"

# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
Expand Down
8 changes: 4 additions & 4 deletions Makefile.in
Expand Up @@ -103,7 +103,7 @@ FISH_OBJS := obj/function.o obj/builtin.o obj/complete.o obj/env.o obj/exec.o \
obj/parse_productions.o obj/parse_execution.o obj/pager.o obj/utf8.o \
obj/fish_version.o obj/wcstringutil.o

FISH_INDENT_OBJS := obj/fish_indent.o obj/print_help.o $(FISH_OBJS)
FISH_INDENT_OBJS := obj/fish_indent.o obj/print_help.o $(FISH_OBJS)

#
# Additional files used by builtin.o
Expand Down Expand Up @@ -276,9 +276,9 @@ doc: $(HDR_FILES_SRC) Doxyfile.user $(HTML_SRC) $(HELP_SRC) doc.h \
(cat Doxyfile.user; echo INPUT_FILTER=./lexicon_filter; \
echo PROJECT_NUMBER=$(FISH_BUILD_VERSION) | $(SED) "s/-.*//") | \
doxygen - && touch user_doc; \
cd user_doc/html && rm -f bc_s.png bdwn.png closed.png ftv2*.png \
nav*.png open.png sync_*.png tab*.* doxygen.* dynsections.js \
jquery.js pages.html
cd user_doc/html && rm -f arrow*.png bc_s.png bdwn.png closed.png \
doc.png folder*.png ftv2*.png nav*.png open.png splitbar.png \
sync_*.png tab*.* doxygen.* dynsections.js jquery.js pages.html

#
# PDF version of the source code documentation.
Expand Down
2 changes: 2 additions & 0 deletions doc_src/FORMATTING.md
Expand Up @@ -160,6 +160,8 @@ The following can be used in \\fish blocks to render some fish scenarios. These
- `<error>`: \<error\>This would be shown as an error.\</error\>
- `<asis>`: \<asis\>This test will not be parsed for fish markup.\</asis\>
- `<outp>`: \<outp\>This would be rendered as command/script output.\</outp\>
- `<bs>`: Render the contents with a preceding backslash. Useful when presenting output.
- `{{` and `}}`: Required when wanting curly braces in regular expression example.

### Prompts and cursors

Expand Down
2 changes: 1 addition & 1 deletion doc_src/fish_right_prompt.txt
Expand Up @@ -20,7 +20,7 @@ A simple right prompt:

\fish
function fish_right_prompt -d "Write out the right prompt"
date "+%m/%d/%y"
date '+%m/%d/%y'
end
\endfish

28 changes: 15 additions & 13 deletions doc_src/index.hdr.in
Expand Up @@ -528,22 +528,24 @@ The above code demonstrates how to use multiple '`$`' symbols to expand the valu
Lists adjacent to other lists or strings are expanded as cartesian products:

Examples:
\fish
echo {good,bad}" apples"
# Outputs 'good apples bad apples'
\fish{cli-dark}
>_ echo {good,bad}" apples"
<outp>good apples bad apples</outp>

>_ set -l a x y z
>_ set -l b 1 2 3

>_ echo $a$b
<outp>x1 y1 z1 x2 y2 z2 x3 y3 z3</outp>

set -l a x y z
set -l b 1 2 3
echo $a$b
# Outputs 'x1 y1 z1 x2 y2 z2 x3 y3 z3'
echo $a"-"$b
# Outputs 'x-1 y-1 z-1 x-2 y-2 z-2 x-3 y-3 z-3'
>_ echo $a"-"$b
<outp>x-1 y-1 z-1 x-2 y-2 z-2 x-3 y-3 z-3</outp>

echo {x,y,z}$b
# Outputs 'x1 y1 z1 x2 y2 z2 x3 y3 z3'
>_ echo {x,y,z}$b
<outp>x1 y1 z1 x2 y2 z2 x3 y3 z3</outp>

echo {$b}word
# Outputs '1word 2word 3word'
>_ echo {$b}word
<outp>1word 2word 3word</outp>
\endfish

Be careful when you try to use braces to separate variable names from text. The dangers noted in the last example above can be avoided by wrapping the variable in double quotes instead of braces (`echo "$b"word`).
Expand Down
2 changes: 1 addition & 1 deletion doc_src/printf.txt
Expand Up @@ -60,7 +60,7 @@ This file has been imported from the printf in GNU Coreutils version 6.9. If you
\subsection printf-example Example

\fish
printf '\%s\\t\%s\n' flounder fish
printf '%s\\t%s\\n' flounder fish
\endfish
Will print "flounder fish" (separated with a tab character), followed by a newline character. This is useful for writing completions, as fish expects completion scripts to output the option followed by the description, separated with a tab character.

Expand Down
13 changes: 8 additions & 5 deletions doc_src/prompt_pwd.txt
Expand Up @@ -13,16 +13,19 @@ To change the number of characters per path component, set $fish_prompt_pwd_dir_

\subsection prompt_pwd-example Examples

\fish
\fish{cli-dark}
>_ cd ~/
>_ echo $PWD
/home/alfa
<outp>/home/alfa</outp>

>_ prompt_pwd
~
<outp>~</outp>

>_ cd /tmp/banana/sausage/with/mustard
>_ prompt_pwd
/t/b/s/w/mustard
<outp>/t/b/s/w/mustard</outp>

>_ set -g fish_prompt_pwd_dir_length 3
>_ prompt_pwd
/tmp/ban/sau/wit/mustard
<outp>/tmp/ban/sau/wit/mustard</outp>
\endfish

0 comments on commit cb6d5d7

Please sign in to comment.