From d282bc462578a6e47747c78d2d42883530f0d11e Mon Sep 17 00:00:00 2001 From: Mark Griffiths Date: Fri, 1 Aug 2014 03:37:32 +0100 Subject: Documentation update Rework for Doxygen >1.8. Moved large parts of the documentation to a simplified format, making use of Markdown enhancements and fixing bad long options. --- Makefile.in | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 78 insertions(+), 4 deletions(-) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index 4995dddc..c8467092 100644 --- a/Makefile.in +++ b/Makefile.in @@ -148,6 +148,11 @@ HDR_FILES := $(HDR_FILES_SRC:.hdr.in=.hdr) HELP_SRC := $(wildcard doc_src/*.txt) +# +# HTML includes needed for HTML help +# + +HTML_SRC := doc_src/user_doc.header.html doc_src/user_doc.footer.html doc_src/user_doc.css # # Files in the test directory @@ -252,11 +257,20 @@ prof: all # Depend on the sources (*.hdr.in) and manually make the # intermediate *.hdr and doc.h files if needed # The sed command deletes everything including and after the first -, for simpler version numbers +# Cleans up the user_doc/html directory once Doxygen is done. -user_doc: $(HDR_FILES_SRC) Doxyfile.user user_doc.head.html $(HELP_SRC) doc.h $(HDR_FILES) - (cat Doxyfile.user ; echo PROJECT_NUMBER=$(FISH_BUILD_VERSION) | sed "s/-.*//") | doxygen - && touch user_doc - +user_doc: $(HDR_FILES_SRC) Doxyfile.user $(HTML_SRC) $(HELP_SRC) doc.h $(HDR_FILES) doc_src/fish_lexicon_filter + (cat Doxyfile.user; echo INPUT_FILTER=doc_src/fish_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 +# +# Build the help CSS files, using fish_lexicon_filter +# +doc_src/user_doc.css: doc_src/user_doc.css.in doc_src/fish_lexicon_filter + -rm $@ + cd doc_src; \ + cat user_doc.css.in >> user_doc.css # # Source code documentation. Also includes user documentation. @@ -328,11 +342,70 @@ toc.txt: $(HDR_FILES:index.hdr=index.hdr.in) doc_src/index.hdr: toc.txt doc_src/index.hdr.in cat $@.in | awk '{if ($$0 ~ /@toc@/){ system("cat toc.txt");} else{ print $$0;}}' >$@ +# +# To enable the lexicon filter, we first need to be aware of what fish +# considers to be a command, function, or external binary. We use +# command_list_toc.txt for the base commands. Scan the share/functions +# directory for other functions, some of which are mentioned in the docs, and +# use /share/completions to find a good selection of binaries. Additionally, +# colour defaults from __fish_config_interactive to set the docs colours when +# used in a 'cli' style context. +# + +lexicon.txt: doc_src/commands.hdr $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES) share/functions/__fish_config_interactive.fish + -rm lexicon.tmp lexicon_catalog.tmp lexicon_catalog.txt $@ + # Scan sources for commands/functions/binaries/colours. If GNU sed was portable, this could be much smarter. + sed >lexicon.tmp -n \ + -e "s|^.*>\([a-z][a-z_]*\)|'\1'|w lexicon_catalog.tmp" \ + -e "s|'\(.*\)'|cmnd \1|p"; mv lexicon_catalog.tmp lexicon_catalog.txt; \ + printf "%s\n" $(COMPLETIONS_DIR_FILES) | sed -n \ + -e "s|[^ ]*/\([a-z][a-z_-]*\).fish|'\1'|p" | fgrep -vx -f lexicon_catalog.txt | sed >>lexicon.tmp -n \ + -e 'w lexicon_catalog.tmp' \ + -e "s|'\(.*\)'|sbin \1|p"; cat lexicon_catalog.tmp >> lexicon_catalog.txt; \ + printf "%s\n" $(FUNCTIONS_DIR_FILES) | sed -n \ + -e "s|[^ ]*/\([a-z][a-z_-]*\).fish|'\1'|p" | fgrep -vx -f lexicon_catalog.txt | sed >>lexicon.tmp -n \ + -e 'w lexicon_catalog.tmp' \ + -e "s|'\(.*\)'|func \1|p"; \ + sed >lexicon.tmp -n \ + -e '/set_default/s/.*\(fish_[a-z][a-z_]*\).*$$/clrv \1/p' \ + -e '$$G;s/.*\n/==end==/p'; \ + sed >lexicon.tmp -n \ + -e '1G;s/.*\n/==styles==/p' \ + -e '/set_default/s/.*fish_color\(_[a-z][a-z_]*\)/style\1/' \ + -e '/^style_/s/_\([^ ]*\) --\([^ ]*\).*$$/ \1 \2/p' \ + -e '/^style_/s/_\([^ ]* [^- ]*\) --\([^ ]*\).*$$/ \1 \2/p' \ + -e '/^style_/s/_\([^ ]* [^- ]*\).*$$/ \1/p'; \ + mv lexicon.tmp lexicon.txt; rm -f lexicon_catalog.tmp lexicon_catalog.txt; + +# +# Compile Doxygen Input Filter from the lexicon. This is an executable sed +# script as Doxygen opens it via popen()(3) Input (doc.h) is piped through and +# matching words inside /fish../endfish blocks are marked up, contextually, +# with custom Doxygen commands in the form of @word_type{content}. These are +# trapped by ALIASES in the various Doxyfiles, allowing the content to be +# transformed depending on output type (HTML, man page, developer docs). In +# HTML, a style context can be applied through the /fish{style} block and +# providing suitable CSS in user_doc.css.in +# + +doc_src/fish_lexicon_filter: lexicon.txt doc_src/fish_lexicon_filter.in + -rm $@.tmp $@ + # Clean the filter input comments and set the shebang as sed can reside in + # /bin or /usr/bin and some versions dont allow more than one comment!. + sed <$@.in >$@.tmp -e 's|@sed@|'"`command -v sed`"'|' -e '/^[ ]*#[^!]/d' + # Scan through the lexicon, transforming each line to something usefue to Doxygen. + sed >$@.tmp -n \ + -e 's|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,[[:<:]]\2[[:>:]],@\1{\2},g|p' \ + -e '/==end==/G;s/.*\n/b tidy/p' \ + -e '/==styles==/G;s/.*\n/:styles/p' \ + -e 's|^\(style [^ ]*\) \(.*\)$$|s,\1,\2,|p' \ + -e '$$G;s/.*\n/b processstyle/p'; \ + mv $@.tmp $@; if test -x $@; then true; else chmod a+x $@; fi # # doc.h is a compilation of the various snipptes of text used both for # the user documentation and for internal help functions into a single -# file that can be parsed dy Doxygen to generate the user +# file that can be parsed by Doxygen to generate the user # documentation. # @@ -748,6 +821,7 @@ clean: rm -f $(PROGRAMS) fish_tests key_reader rm -f command_list.txt command_list_toc.txt toc.txt rm -f doc_src/index.hdr doc_src/commands.hdr + rm -f doc_src/fish_lexicon_filter lexicon.txt doc_src/user_doc.css rm -f FISH-BUILD-VERSION-FILE if test "$(HAVE_DOXYGEN)" = 1; then \ rm -rf doc user_doc share/man; \ -- cgit v1.2.3 From 1052eeee8cdc3e929b6031f94f8bff955e8bff4d Mon Sep 17 00:00:00 2001 From: Mark Griffiths Date: Fri, 1 Aug 2014 13:25:41 +0100 Subject: Simplify styling --- Doxyfile.help | 1 + Doxyfile.user | 1 + Makefile.in | 17 +-- doc_src/alias.txt | 2 +- doc_src/and.txt | 2 +- doc_src/begin.txt | 2 +- doc_src/bg.txt | 2 +- doc_src/bind.txt | 2 +- doc_src/block.txt | 2 +- doc_src/break.txt | 2 +- doc_src/breakpoint.txt | 2 +- doc_src/builtin.txt | 2 +- doc_src/case.txt | 2 +- doc_src/cd.txt | 2 +- doc_src/commandline.txt | 2 +- doc_src/contains.txt | 2 +- doc_src/continue.txt | 2 +- doc_src/count.txt | 2 +- doc_src/dirh.txt | 2 +- doc_src/dirs.txt | 2 +- doc_src/echo.txt | 2 +- doc_src/else.txt | 2 +- doc_src/emit.txt | 2 +- doc_src/end.txt | 2 +- doc_src/eval.txt | 2 +- doc_src/exec.txt | 2 +- doc_src/exit.txt | 2 +- doc_src/fg.txt | 2 +- doc_src/fish.txt | 2 +- doc_src/fish_indent.txt | 2 +- doc_src/fish_lexicon_filter.in | 57 +-------- doc_src/fish_prompt.txt | 2 +- doc_src/fish_right_prompt.txt | 2 +- doc_src/for.txt | 2 +- doc_src/funced.txt | 2 +- doc_src/funcsave.txt | 2 +- doc_src/function.txt | 2 +- doc_src/functions.txt | 2 +- doc_src/help.txt | 2 +- doc_src/if.txt | 2 +- doc_src/index.hdr.in | 11 +- doc_src/isatty.txt | 2 +- doc_src/jobs.txt | 2 +- doc_src/math.txt | 2 +- doc_src/mimedb.txt | 2 +- doc_src/nextd.txt | 2 +- doc_src/not.txt | 2 +- doc_src/open.txt | 2 +- doc_src/or.txt | 2 +- doc_src/popd.txt | 2 +- doc_src/prevd.txt | 2 +- doc_src/psub.txt | 2 +- doc_src/pushd.txt | 2 +- doc_src/pwd.txt | 2 +- doc_src/random.txt | 2 +- doc_src/read.txt | 2 +- doc_src/return.txt | 2 +- doc_src/set.txt | 2 +- doc_src/set_color.txt | 2 +- doc_src/source.txt | 2 +- doc_src/status.txt | 2 +- doc_src/switch.txt | 2 +- doc_src/test.txt | 2 +- doc_src/trap.txt | 2 +- doc_src/type.txt | 2 +- doc_src/ulimit.txt | 2 +- doc_src/umask.txt | 2 +- doc_src/user_doc.css | 261 +++++++++++++++++++++++++++++++++++++++++ doc_src/user_doc.css.in | 261 ----------------------------------------- doc_src/vared.txt | 2 +- doc_src/while.txt | 2 +- 71 files changed, 341 insertions(+), 396 deletions(-) create mode 100644 doc_src/user_doc.css delete mode 100644 doc_src/user_doc.css.in (limited to 'Makefile.in') diff --git a/Doxyfile.help b/Doxyfile.help index 1c34667c..beda7bbb 100644 --- a/Doxyfile.help +++ b/Doxyfile.help @@ -244,6 +244,7 @@ ALIASES += "blah{1}=\1" ALIASES += "cmnd{1}=\1" ALIASES += "func{1}=\1" ALIASES += "sbin{1}=\1" +ALIASES += "args{1}=\1" ALIASES += "opts{1}=\1" ALIASES += "vars{1}=\1" ALIASES += "optr{1}=\1" diff --git a/Doxyfile.user b/Doxyfile.user index f877c3b7..3f5f6149 100644 --- a/Doxyfile.user +++ b/Doxyfile.user @@ -244,6 +244,7 @@ ALIASES += "blah{1}=\1" ALIASES += "cmnd{1}=\1" ALIASES += "func{1}=\1" ALIASES += "sbin{1}=\1" +ALIASES += "args{1}=\1" ALIASES += "opts{1}=\1" ALIASES += "vars{1}=\1" ALIASES += "optr{1}=\1" diff --git a/Makefile.in b/Makefile.in index c8467092..ca4a33ab 100644 --- a/Makefile.in +++ b/Makefile.in @@ -367,14 +367,7 @@ lexicon.txt: doc_src/commands.hdr $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES -e 'w lexicon_catalog.tmp' \ -e "s|'\(.*\)'|func \1|p"; \ sed >lexicon.tmp -n \ - -e '/set_default/s/.*\(fish_[a-z][a-z_]*\).*$$/clrv \1/p' \ - -e '$$G;s/.*\n/==end==/p'; \ - sed >lexicon.tmp -n \ - -e '1G;s/.*\n/==styles==/p' \ - -e '/set_default/s/.*fish_color\(_[a-z][a-z_]*\)/style\1/' \ - -e '/^style_/s/_\([^ ]*\) --\([^ ]*\).*$$/ \1 \2/p' \ - -e '/^style_/s/_\([^ ]* [^- ]*\) --\([^ ]*\).*$$/ \1 \2/p' \ - -e '/^style_/s/_\([^ ]* [^- ]*\).*$$/ \1/p'; \ + -e '/set_default/s/.*\(fish_[a-z][a-z_]*\).*$$/clrv \1/p'; \ mv lexicon.tmp lexicon.txt; rm -f lexicon_catalog.tmp lexicon_catalog.txt; # @@ -395,11 +388,7 @@ doc_src/fish_lexicon_filter: lexicon.txt doc_src/fish_lexicon_filter.in sed <$@.in >$@.tmp -e 's|@sed@|'"`command -v sed`"'|' -e '/^[ ]*#[^!]/d' # Scan through the lexicon, transforming each line to something usefue to Doxygen. sed >$@.tmp -n \ - -e 's|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,[[:<:]]\2[[:>:]],@\1{\2},g|p' \ - -e '/==end==/G;s/.*\n/b tidy/p' \ - -e '/==styles==/G;s/.*\n/:styles/p' \ - -e 's|^\(style [^ ]*\) \(.*\)$$|s,\1,\2,|p' \ - -e '$$G;s/.*\n/b processstyle/p'; \ + -e 's|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,[[:<:]]\2[[:>:]],@\1{\2},g|p'; mv $@.tmp $@; if test -x $@; then true; else chmod a+x $@; fi # @@ -821,7 +810,7 @@ clean: rm -f $(PROGRAMS) fish_tests key_reader rm -f command_list.txt command_list_toc.txt toc.txt rm -f doc_src/index.hdr doc_src/commands.hdr - rm -f doc_src/fish_lexicon_filter lexicon.txt doc_src/user_doc.css + rm -f doc_src/fish_lexicon_filter lexicon.txt rm -f FISH-BUILD-VERSION-FILE if test "$(HAVE_DOXYGEN)" = 1; then \ rm -rf doc user_doc share/man; \ diff --git a/doc_src/alias.txt b/doc_src/alias.txt index cc8b7fdc..c1450cc4 100644 --- a/doc_src/alias.txt +++ b/doc_src/alias.txt @@ -1,7 +1,7 @@ \section alias alias - create a function \subsection alias-synopsis Synopsis -\fish{syn} +\fish{synopsis} alias NAME DEFINITION alias NAME=DEFINITION \endfish diff --git a/doc_src/and.txt b/doc_src/and.txt index de5bb1eb..9d71d67c 100644 --- a/doc_src/and.txt +++ b/doc_src/and.txt @@ -1,7 +1,7 @@ \section and and - conditionally execute a command \subsection and-synopsis Synopsis -\fish{syn} +\fish{synopsis} COMMAND1; and COMMAND2 \endfish diff --git a/doc_src/begin.txt b/doc_src/begin.txt index aee50f5c..6807fac4 100644 --- a/doc_src/begin.txt +++ b/doc_src/begin.txt @@ -1,7 +1,7 @@ \section begin begin - start a new block of code \subsection begin-synopsis Synopsis -\fish{syn} +\fish{synopsis} begin; [COMMANDS...;] end \endfish diff --git a/doc_src/bg.txt b/doc_src/bg.txt index 403f2e4a..d05bf54d 100644 --- a/doc_src/bg.txt +++ b/doc_src/bg.txt @@ -1,7 +1,7 @@ \section bg bg - send jobs to background \subsection bg-synopsis Synopsis -\fish{syn} +\fish{synopsis} bg [PID...] \endfish diff --git a/doc_src/bind.txt b/doc_src/bind.txt index 442d7e99..9607c8b0 100644 --- a/doc_src/bind.txt +++ b/doc_src/bind.txt @@ -1,7 +1,7 @@ \section bind bind - handle fish key bindings \subsection bind-synopsis Synopsis -\fish{syn} +\fish{synopsis} bind [OPTIONS] SEQUENCE COMMAND \endfish diff --git a/doc_src/block.txt b/doc_src/block.txt index 19ccb29b..f3f741f1 100644 --- a/doc_src/block.txt +++ b/doc_src/block.txt @@ -1,7 +1,7 @@ \section block block - temporarily block delivery of events \subsection block-synopsis Synopsis -\fish{syn} +\fish{synopsis} block [OPTIONS...] \endfish diff --git a/doc_src/break.txt b/doc_src/break.txt index 3109fe9c..2056b054 100644 --- a/doc_src/break.txt +++ b/doc_src/break.txt @@ -1,7 +1,7 @@ \section break break - stop the current inner loop \subsection break-synopsis Synopsis -\fish{syn} +\fish{synopsis} LOOP_CONSTRUCT; [COMMANDS...] break; [COMMANDS...] end \endfish diff --git a/doc_src/breakpoint.txt b/doc_src/breakpoint.txt index bff8fc5a..348c779d 100644 --- a/doc_src/breakpoint.txt +++ b/doc_src/breakpoint.txt @@ -1,7 +1,7 @@ \section breakpoint breakpoint - Launch debug mode \subsection breakpoint-synopsis Synopsis -\fish{syn} +\fish{synopsis} breakpoint \endfish diff --git a/doc_src/builtin.txt b/doc_src/builtin.txt index 8f480b47..2d915fc3 100644 --- a/doc_src/builtin.txt +++ b/doc_src/builtin.txt @@ -1,7 +1,7 @@ \section builtin builtin - run a builtin command \subsection builtin-synopsis Synopsis -\fish{syn} +\fish{synopsis} builtin BUILTINNAME [OPTIONS...] \endfish diff --git a/doc_src/case.txt b/doc_src/case.txt index aab24d53..b0500650 100644 --- a/doc_src/case.txt +++ b/doc_src/case.txt @@ -1,7 +1,7 @@ \section case case - conditionally execute a block of commands \subsection case-synopsis Synopsis -\fish{syn} +\fish{synopsis} switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end \endfish diff --git a/doc_src/cd.txt b/doc_src/cd.txt index 968333f3..200d9767 100644 --- a/doc_src/cd.txt +++ b/doc_src/cd.txt @@ -1,7 +1,7 @@ \section cd cd - change directory \subsection cd-synopsis Synopsis -\fish{syn} +\fish{synopsis} cd [DIRECTORY] \endfish diff --git a/doc_src/commandline.txt b/doc_src/commandline.txt index c61b51da..b3eaba5a 100644 --- a/doc_src/commandline.txt +++ b/doc_src/commandline.txt @@ -1,7 +1,7 @@ \section commandline commandline - set or get the current command line buffer \subsection commandline-synopsis Synopsis -\fish{syn} +\fish{synopsis} commandline [OPTIONS] [CMD] \endfish diff --git a/doc_src/contains.txt b/doc_src/contains.txt index 3671c8a3..2ec6e092 100644 --- a/doc_src/contains.txt +++ b/doc_src/contains.txt @@ -1,7 +1,7 @@ \section contains contains - test if a word is present in a list \subsection contains-synopsis Synopsis -\fish{syn} +\fish{synopsis} contains [OPTIONS] KEY [VALUES...] \endfish diff --git a/doc_src/continue.txt b/doc_src/continue.txt index e79c8f35..cb92c9cf 100644 --- a/doc_src/continue.txt +++ b/doc_src/continue.txt @@ -1,7 +1,7 @@ \section continue continue - skip the remainder of the current iteration of the current inner loop \subsection continue-synopsis Synopsis -\fish{syn} +\fish{synopsis} LOOP_CONSTRUCT; [COMMANDS...;] continue; [COMMANDS...;] end \endfish diff --git a/doc_src/count.txt b/doc_src/count.txt index 1af00e00..bf66d207 100644 --- a/doc_src/count.txt +++ b/doc_src/count.txt @@ -1,7 +1,7 @@ \section count count - count the number of elements of an array \subsection count-synopsis Synopsis -\fish{syn} +\fish{synopsis} count $VARIABLE \endfish diff --git a/doc_src/dirh.txt b/doc_src/dirh.txt index 38160b86..00bd581f 100644 --- a/doc_src/dirh.txt +++ b/doc_src/dirh.txt @@ -1,7 +1,7 @@ \section dirh dirh - print directory history \subsection dirh-synopsis Synopsis -\fish{syn} +\fish{synopsis} dirh \endfish diff --git a/doc_src/dirs.txt b/doc_src/dirs.txt index f8744071..c15834c5 100644 --- a/doc_src/dirs.txt +++ b/doc_src/dirs.txt @@ -1,7 +1,7 @@ \section dirs dirs - print directory stack \subsection dirs-synopsis Synopsis -\fish{syn} +\fish{synopsis} dirs \endfish diff --git a/doc_src/echo.txt b/doc_src/echo.txt index edb3c963..4ce96cb4 100644 --- a/doc_src/echo.txt +++ b/doc_src/echo.txt @@ -1,7 +1,7 @@ \section echo echo - display a line of text \subsection echo-synopsis Synopsis -\fish{syn} +\fish{synopsis} echo [STRING] \endfish diff --git a/doc_src/else.txt b/doc_src/else.txt index 069a13bd..a22cfcdb 100644 --- a/doc_src/else.txt +++ b/doc_src/else.txt @@ -1,7 +1,7 @@ \section else else - execute command if a condition is not met \subsection else-synopsis Synopsis -\fish{syn} +\fish{synopsis} if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end \endfish diff --git a/doc_src/emit.txt b/doc_src/emit.txt index cfcc107f..d8f17b45 100644 --- a/doc_src/emit.txt +++ b/doc_src/emit.txt @@ -1,7 +1,7 @@ \section emit emit - Emit a generic event \subsection emit-synopsis Synopsis -\fish{syn} +\fish{synopsis} emit EVENT_NAME [ARGUMENTS...] \endfish diff --git a/doc_src/end.txt b/doc_src/end.txt index be971e95..aca29495 100644 --- a/doc_src/end.txt +++ b/doc_src/end.txt @@ -1,7 +1,7 @@ \section end end - end a block of commands. \subsection end-synopsis Synopsis -\fish{syn} +\fish{synopsis} begin; [COMMANDS...] end if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end while CONDITION; COMMANDS...; end diff --git a/doc_src/eval.txt b/doc_src/eval.txt index 22f92164..c966b576 100644 --- a/doc_src/eval.txt +++ b/doc_src/eval.txt @@ -1,7 +1,7 @@ \section eval eval - evaluate the specified commands \subsection eval-synopsis Synopsis -\fish{syn} +\fish{synopsis} eval [COMMANDS...] \endfish diff --git a/doc_src/exec.txt b/doc_src/exec.txt index 75effda1..4bcd3999 100644 --- a/doc_src/exec.txt +++ b/doc_src/exec.txt @@ -1,7 +1,7 @@ \section exec exec - execute command in current process \subsection exec-synopsis Synopsis -\fish{syn} +\fish{synopsis} exec COMMAND [OPTIONS...] \endfish diff --git a/doc_src/exit.txt b/doc_src/exit.txt index ae607a4c..fcec4b92 100644 --- a/doc_src/exit.txt +++ b/doc_src/exit.txt @@ -1,7 +1,7 @@ \section exit exit - exit the shell \subsection exit-synopsis Synopsis -\fish{syn} +\fish{synopsis} exit [STATUS] \endfish diff --git a/doc_src/fg.txt b/doc_src/fg.txt index 0e45df04..e9f23bc5 100644 --- a/doc_src/fg.txt +++ b/doc_src/fg.txt @@ -1,7 +1,7 @@ \section fg fg - bring job to foreground \subsection fg-synopsis Synopsis -\fish{syn} +\fish{synopsis} fg [PID] \endfish diff --git a/doc_src/fish.txt b/doc_src/fish.txt index 27235f57..80e7e4e5 100644 --- a/doc_src/fish.txt +++ b/doc_src/fish.txt @@ -1,7 +1,7 @@ \section fish fish - the friendly interactive shell \subsection fish-synopsis Synopsis -\fish{syn} +\fish{synopsis} fish [-h] [-v] [-c command] [FILE [ARGUMENTS...]] \endfish diff --git a/doc_src/fish_indent.txt b/doc_src/fish_indent.txt index 761134ec..51cb5fa6 100644 --- a/doc_src/fish_indent.txt +++ b/doc_src/fish_indent.txt @@ -1,7 +1,7 @@ \section fish_indent fish_indent - indenter and prettifier \subsection fish_indent-synopsis Synopsis -\fish{syn} +\fish{synopsis} fish_indent [options] \endfish diff --git a/doc_src/fish_lexicon_filter.in b/doc_src/fish_lexicon_filter.in index 60cde9be..47ee345e 100644 --- a/doc_src/fish_lexicon_filter.in +++ b/doc_src/fish_lexicon_filter.in @@ -57,53 +57,10 @@ # End block /\\endfish/b } -/style/b styles #. # This is not the pattern we're looking for b #. -# Sets CSS styles according to fish defaults. -#. -# Used for building the documentation's CSS file -#. -:processstyle -#. Make Hex uniform -s/0x//g -/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]*/ { - y/ABCDEF/abcdef/ - s/^[0-9a-f]/#&/ -} -#. -# Set simple styles -#. -s/bold/font-weight:bold;/ -#. -# Replace named colours (taken from color.cpp) -#. -s/black/#000/ -s/red/#f00/ -s/green/#0f0/ -s/brown/#725000/ -s/yellow/#ff0/ -s/blue/#00f/ -s/magenta/#f0f/ -s/purple/#f0f/ -s/cyan/#0ff/ -s/white/#fff/ -s/normal/#fff text-decoration:none; border-bottom:none; font-weight:normal;/ -#. -/background/ { - s/background=\(#[0-9a-f][0-9a-f][0-9a-f][0-9a-f]*\)/background-color: \1;/ -} -/underline/ { - s/^\(#[0-9a-f][0-9a-f][0-9a-f][0-9a-f]*\).*$/\1 border-bottom: 2px solid \1;/ - s/^underline$/text-decoration: underline;/ -} -# If we start with just a colour, make it explicit. -s/^#[0-9a-f][0-9a-f]*/color: &;/ -#. -# All done, return CSS style content -b # Process any HTML tags. # Structured to reduce sed's greediness. :html @@ -204,7 +161,7 @@ s/-\([A-Za-z]\)\([^A-Za-z}]\)/\\\ \2/g #. # Long options -s/--\([A-Za-z][A-Za-z0-9=_-]*\)\([^A-Za-z0-9]\)/\\\ +s/--\([A-Za-z][A-Za-z0-9=_-]*\)\([^A-Za-z0-9=_-]*\)/\\\ <@opts{--\1}\ \2/g #. @@ -259,6 +216,9 @@ s/\n//g s/\(fsfo{[^@]*\)@sbin{\([^}]*\)}/\1\2/ t cleanfsfo } +# Convert 2nd order commands/functions and binaries to arguments +s/@cmnd/@args/g +s/@args/@cmnd/1 # Character Entities #. # Mark up a few sesitive characters. @@ -293,7 +253,7 @@ s/^[ ]*[^<][^@][^}]*$// s/^[ ]*[^<][^@][^\\]*[\\ ()]*\n// :holdflush s/}[)(\\ ][)(\\ ]*/}/ -s/\n[];)|* ][^\\]*[\\]*// +s/\n[];)|* -][^\\]*[\\]*// t holdflush s/\n$// #. @@ -321,7 +281,7 @@ s/\([A-Za-z*][A-Za-z]*\.[a-z0-9][a-z0-9]*\)/@fsfo{\1}/g #. # Manually add a few commands not harvested from source. #. -s,[[:<:]]in[[:>:]],@cmnd{in},g +s,[[:<:]]in[[:>:]],@args{in},g s,[[:<:]]whoami[[:>:]],@sbin{whoami},g s,[[:<:]]fishd[[:>:]],@sbin{fishd},g #. @@ -360,8 +320,3 @@ s,[[:<:]]fishd[[:>:]],@sbin{fishd},g # single line. #. # b tidy -#. -# Colour lookup functions -#. -# The Makefile will add a table of colour names and values, possibly with -# extra style information, that are used to set defaults in the CSS file. diff --git a/doc_src/fish_prompt.txt b/doc_src/fish_prompt.txt index cecc338d..53da848e 100644 --- a/doc_src/fish_prompt.txt +++ b/doc_src/fish_prompt.txt @@ -1,7 +1,7 @@ \section fish_prompt fish_prompt - define the appearance of the command line prompt \subsection fish_prompt-synopsis Synopsis -\fish{syn} +\fish{synopsis} function fish_prompt ... end diff --git a/doc_src/fish_right_prompt.txt b/doc_src/fish_right_prompt.txt index 15f1f95b..19d1efec 100644 --- a/doc_src/fish_right_prompt.txt +++ b/doc_src/fish_right_prompt.txt @@ -1,7 +1,7 @@ \section fish_right_prompt fish_right_prompt - define the appearance of the right-side command line prompt \subsection fish_right_prompt-synopsis Synopsis -\fish{syn} +\fish{synopsis} function fish_right_prompt ... end diff --git a/doc_src/for.txt b/doc_src/for.txt index 902f4495..c75f953c 100644 --- a/doc_src/for.txt +++ b/doc_src/for.txt @@ -1,7 +1,7 @@ \section for for - perform a set of commands multiple times. \subsection for-synopsis Synopsis -\fish{syn} +\fish{synopsis} for VARNAME in [VALUES...]; COMMANDS...; end \endfish diff --git a/doc_src/funced.txt b/doc_src/funced.txt index 82f2cd63..51d1b865 100644 --- a/doc_src/funced.txt +++ b/doc_src/funced.txt @@ -1,7 +1,7 @@ \section funced funced - edit a function interactively \subsection funced-synopsis Synopsis -\fish{syn} +\fish{synopsis} funced [OPTIONS] NAME \endfish diff --git a/doc_src/funcsave.txt b/doc_src/funcsave.txt index fd4b5d87..c3f2fe32 100644 --- a/doc_src/funcsave.txt +++ b/doc_src/funcsave.txt @@ -1,7 +1,7 @@ \section funcsave funcsave - save the definition of a function to the user's autoload directory \subsection funcsave-synopsis Synopsis -\fish{syn} +\fish{synopsis} funcsave FUNCTION_NAME \endfish diff --git a/doc_src/function.txt b/doc_src/function.txt index 0f3b4fb0..74dc9de5 100644 --- a/doc_src/function.txt +++ b/doc_src/function.txt @@ -1,7 +1,7 @@ \section function function - create a function \subsection function-synopsis Synopsis -\fish{syn} +\fish{synopsis} function [OPTIONS] NAME; BODY; end \endfish diff --git a/doc_src/functions.txt b/doc_src/functions.txt index 048ee93e..520b55b7 100644 --- a/doc_src/functions.txt +++ b/doc_src/functions.txt @@ -1,7 +1,7 @@ \section functions functions - print or erase functions \subsection functions-synopsis Synopsis -\fish{syn} +\fish{synopsis} functions [-a|--all] [-n|--names] functions -c OLDNAME NEWNAME functions -d DESCRIPTION FUNCTION diff --git a/doc_src/help.txt b/doc_src/help.txt index a3375204..d862da8c 100644 --- a/doc_src/help.txt +++ b/doc_src/help.txt @@ -1,7 +1,7 @@ \section help help - display fish documentation \subsection help-synopsis Synopsis -\fish{syn} +\fish{synopsis} help [SECTION] \endfish diff --git a/doc_src/if.txt b/doc_src/if.txt index 38054c37..b1ca88f5 100644 --- a/doc_src/if.txt +++ b/doc_src/if.txt @@ -1,7 +1,7 @@ \section if if - conditionally execute a command \subsection if-synopsis Synopsis -\fish{syn} +\fish{synopsis} if CONDITION; COMMANDS_TRUE...; [else if CONDITION2; COMMANDS_TRUE2...;] [else; COMMANDS_FALSE...;] end \endfish diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in index 2555ca08..95b1559c 100644 --- a/doc_src/index.hdr.in +++ b/doc_src/index.hdr.in @@ -188,7 +188,7 @@ When you start a job in `fish`, `fish` itself will pause, and give control of th Example: \fish -emacs & +emacs & \endfish will start the emacs text editor in the background. @@ -316,21 +316,20 @@ Specifying your own completions is not difficult. To specify a completion, use t To provide a list of possible completions for myprog, use the `-a` switch. If `myprog` accepts the arguments start and stop, this can be specified as `complete -c myprog -a 'start stop'`. The argument to the `-a` switch is always a single string. At completion time, it will be tokenized on spaces and tabs, and variable expansion, command substitution and other forms of parameter expansion will take place. -Fish has a special syntax to support specifying switches accepted by a command. The switches `-s`, `-l` and `-o` are used to specify a short switch (single character, such as -l), a gnu style long switch (such as '`--color`') and an old-style long switch (like '`-shuffle`'), respectively. If the command 'myprog' has an option '-o' which can also be written as '`--output`', and which can take an additional value of either 'yes' or 'no', this can be specified by writing: - +`fish` has a special syntax to support specifying switches accepted by a command. The switches `-s`, `-l` and `-o` are used to specify a short switch (single character, such as `-l`), a gnu style long switch (such as '`--color`') and an old-style long switch (like '`-shuffle`'), respectively. If the command 'myprog' has an option '-o' which can also be written as '`--output`', and which can take an additional value of either 'yes' or 'no', this can be specified by writing: \fish complete -c myprog -s o -l output -a "yes no" \endfish -There are also special switches for specifying that a switch requires an argument, to disable filename completion, to create completions that are only available in some combinations, etc.. For a complete description of the various switches accepted by the `complete` command, see the documentation for the complete builtin, or write `complete --help` inside the `fish` shell. +There are also special switches for specifying that a switch requires an argument, to disable filename completion, to create completions that are only available in some combinations, etc.. For a complete description of the various switches accepted by the `complete` command, see the documentationfor the complete builtin, or write `complete --help` inside the `fish` shell. For examples of how to write your own complex completions, study the completions in `/usr/share/fish/completions`. (The exact path depends on your chosen installation prefix and may be slightly different) \subsection completion-func Useful functions for writing completions -Fish ships with several functions that are very useful when writing command specific completions. Most of these functions name begins with the string '`__fish_`'. Such functions are internal to fish and their name and interface may change in future fish versions. Still, some of them may be very useful when writing completions. A few of these functions are described here. Be aware that they may be removed or changed in future versions of fish. +`fish` ships with several functions that are very useful when writing command specific completions. Most of these functions name begins with the string '`__fish_`'. Such functions are internal to `fish` and their name and interface may change in future fish versions. Still, some of them may be very useful when writing completions. A few of these functions are described here. Be aware that they may be removed or changed in future versions of fish. Functions beginning with the string `__fish_print_` print a newline- separated list of strings. For example, `__fish_print_filesystems` prints a list of all known file systems. Functions beginning with `__fish_complete_` print out a newline separated list of completions with descriptions. The description is separated from the completion by a tab character. @@ -349,7 +348,7 @@ Functions beginning with the string `__fish_print_` print a newline- separated l Completions can be defined on the commandline or in a configuration file, but they can also be automatically loaded. Fish automatically searches through any directories in the array variable `$fish_complete_path`, and any completions defined are automatically loaded when needed. A completion file must have a filename consisting of the name of the command to complete and the suffix '`.fish`'. -The default value for `$fish`_complete_path is `~/.config/fish/completions` `/etc/fish/completions` `/usr/share/fish/completions`. The exact path to the last two of these may be slightly different depending on what install path prefix was chosen at configuration time. If a suitable file is found in one of these directories, it will be automatically loaded and the search will be stopped. The rationale behind having three different directories is that the first one is for user specific completions, the second one is for system-wide completions and the last one is for default fish completions. +The default value for `$fish_complete_path` is `~/.config/fish/completions` `/etc/fish/completions` `/usr/share/fish/completions`. The exact path to the last two of these may be slightly different depending on what install path prefix was chosen at configuration time. If a suitable file is found in one of these directories, it will be automatically loaded and the search will be stopped. The rationale behind having three different directories is that the first one is for user specific completions, the second one is for system-wide completions and the last one is for default fish completions. If you have written new completions for a common Unix command, please consider sharing your work by submitting it via the instructions in Further help and development. diff --git a/doc_src/isatty.txt b/doc_src/isatty.txt index 33f0a6e7..9381d102 100644 --- a/doc_src/isatty.txt +++ b/doc_src/isatty.txt @@ -1,7 +1,7 @@ \section isatty isatty - test if a file or file descriptor is a tty. \subsection isatty-synopsis Synopsis -\fish{syn} +\fish{synopsis} isatty [FILE | DEVICE | FILE DESCRIPTOR NUMBER] \endfish diff --git a/doc_src/jobs.txt b/doc_src/jobs.txt index f47e618e..5056357c 100644 --- a/doc_src/jobs.txt +++ b/doc_src/jobs.txt @@ -1,7 +1,7 @@ \section jobs jobs - print currently running jobs \subsection jobs-synopsis Synopsis -\fish{syn} +\fish{synopsis} jobs [OPTIONS] [PID] \endfish diff --git a/doc_src/math.txt b/doc_src/math.txt index 887a813c..3b984fc0 100644 --- a/doc_src/math.txt +++ b/doc_src/math.txt @@ -2,7 +2,7 @@ \section math math - Perform mathematics calculations \subsection math-synopsis Synopsis -\fish{syn} +\fish{synopsis} math EXPRESSION \endfish diff --git a/doc_src/mimedb.txt b/doc_src/mimedb.txt index 79992f14..d65fd6ba 100644 --- a/doc_src/mimedb.txt +++ b/doc_src/mimedb.txt @@ -1,7 +1,7 @@ \section mimedb mimedb - lookup file information via the mime database \subsection mimedb-synopsis Synopsis -\fish{syn} +\fish{synopsis} mimedb [OPTIONS] FILES... \endfish diff --git a/doc_src/nextd.txt b/doc_src/nextd.txt index 2aad6049..a098c0a7 100644 --- a/doc_src/nextd.txt +++ b/doc_src/nextd.txt @@ -1,7 +1,7 @@ \section nextd nextd - move forward through directory history \subsection nextd-synopsis Synopsis -\fish{syn} +\fish{synopsis} nextd [ -l | --list ] [POS] \endfish diff --git a/doc_src/not.txt b/doc_src/not.txt index 746de9ba..b0d893f7 100644 --- a/doc_src/not.txt +++ b/doc_src/not.txt @@ -1,7 +1,7 @@ \section not not - negate the exit status of a job \subsection not-synopsis Synopsis -\fish{syn} +\fish{synopsis} not COMMAND [OPTIONS...] \endfish diff --git a/doc_src/open.txt b/doc_src/open.txt index 232b58b0..48c71cac 100644 --- a/doc_src/open.txt +++ b/doc_src/open.txt @@ -1,7 +1,7 @@ \section open open - open file in its default application \subsection open-synopsis Synopsis -\fish{syn} +\fish{synopsis} open FILES... \endfish diff --git a/doc_src/or.txt b/doc_src/or.txt index 39c3d95a..0d11129b 100644 --- a/doc_src/or.txt +++ b/doc_src/or.txt @@ -1,7 +1,7 @@ \section or or - conditionally execute a command \subsection or-synopsis Synopsis -\fish{syn} +\fish{synopsis} COMMAND1; or COMMAND2 \endfish diff --git a/doc_src/popd.txt b/doc_src/popd.txt index 297a0a80..f160f43d 100644 --- a/doc_src/popd.txt +++ b/doc_src/popd.txt @@ -1,7 +1,7 @@ \section popd popd - move through directory stack \subsection popd-synopsis Synopsis -\fish{syn} +\fish{synopsis} popd \endfish diff --git a/doc_src/prevd.txt b/doc_src/prevd.txt index 8bead8a1..557f6c98 100644 --- a/doc_src/prevd.txt +++ b/doc_src/prevd.txt @@ -1,7 +1,7 @@ \section prevd prevd - move backward through directory history \subsection prevd-synopsis Synopsis -\fish{syn} +\fish{synopsis} prevd [ -l | --list ] [POS] \endfish diff --git a/doc_src/psub.txt b/doc_src/psub.txt index 62c09be0..d0caafba 100644 --- a/doc_src/psub.txt +++ b/doc_src/psub.txt @@ -1,7 +1,7 @@ \section psub psub - perform process substitution \subsection psub-synopsis Synopsis -\fish{syn} +\fish{synopsis} COMMAND1 (COMMAND2|psub [-f]) \endfish diff --git a/doc_src/pushd.txt b/doc_src/pushd.txt index d6f50e63..3161fd09 100644 --- a/doc_src/pushd.txt +++ b/doc_src/pushd.txt @@ -1,7 +1,7 @@ \section pushd pushd - push directory to directory stack \subsection pushd-synopsis Synopsis -\fish{syn} +\fish{synopsis} pushd [DIRECTORY] \endfish diff --git a/doc_src/pwd.txt b/doc_src/pwd.txt index 0b83748d..46b6419f 100644 --- a/doc_src/pwd.txt +++ b/doc_src/pwd.txt @@ -1,7 +1,7 @@ \section pwd pwd - output the current working directory \subsection pwd-synopsis Synopsis -\fish{syn} +\fish{synopsis} pwd \endfish diff --git a/doc_src/random.txt b/doc_src/random.txt index abc444a8..3415daa6 100644 --- a/doc_src/random.txt +++ b/doc_src/random.txt @@ -1,7 +1,7 @@ \section random random - generate random number \subsection random-synopsis Synopsis -\fish{syn} +\fish{synopsis} random [SEED] \endfish diff --git a/doc_src/read.txt b/doc_src/read.txt index 44076bc4..f29e98ed 100644 --- a/doc_src/read.txt +++ b/doc_src/read.txt @@ -1,7 +1,7 @@ \section read read - read line of input into variables \subsection read-synopsis Synopsis -\fish{syn} +\fish{synopsis} read [OPTIONS] [VARIABLES...] \endfish diff --git a/doc_src/return.txt b/doc_src/return.txt index a044e58a..5f033349 100644 --- a/doc_src/return.txt +++ b/doc_src/return.txt @@ -1,7 +1,7 @@ \section return return - stop the current inner function \subsection return-synopsis Synopsis -\fish{syn} +\fish{synopsis} function NAME; [COMMANDS...;] return [STATUS]; [COMMANDS...;] end \endfish diff --git a/doc_src/set.txt b/doc_src/set.txt index 9dc1e04b..d27f603d 100644 --- a/doc_src/set.txt +++ b/doc_src/set.txt @@ -1,7 +1,7 @@ \section set set - display and change shell variables. \subsection set-synopsis Synopsis -\fish{syn} +\fish{synopsis} set [SCOPE_OPTIONS] set [OPTIONS] VARIABLE_NAME VALUES... set [OPTIONS] VARIABLE_NAME[INDICES]... VALUES... diff --git a/doc_src/set_color.txt b/doc_src/set_color.txt index ade02990..0597114b 100644 --- a/doc_src/set_color.txt +++ b/doc_src/set_color.txt @@ -1,7 +1,7 @@ \section set_color set_color - set the terminal color \subsection set_color-synopsis Synopsis -\fish{syn} +\fish{synopsis} set_color [-h|--help] [-b|--background COLOR] [COLOR] \endfish diff --git a/doc_src/source.txt b/doc_src/source.txt index bb32e30a..5efb6740 100644 --- a/doc_src/source.txt +++ b/doc_src/source.txt @@ -1,7 +1,7 @@ \section source source - evaluate contents of file. \subsection source-synopsis Synopsis -\fish{syn} +\fish{synopsis} source FILENAME [ARGUMENTS...] \endfish diff --git a/doc_src/status.txt b/doc_src/status.txt index 5cf8d98a..60e2342a 100644 --- a/doc_src/status.txt +++ b/doc_src/status.txt @@ -1,7 +1,7 @@ \section status status - query fish runtime information \subsection status-synopsis Synopsis -\fish{syn} +\fish{synopsis} status [OPTION] \endfish diff --git a/doc_src/switch.txt b/doc_src/switch.txt index 42e0d07a..7245b63f 100644 --- a/doc_src/switch.txt +++ b/doc_src/switch.txt @@ -1,7 +1,7 @@ \section switch switch - conditionally execute a block of commands \subsection switch-synopsis Synopsis -\fish{syn} +\fish{synopsis} switch VALUE; [case [WILDCARD...]; [COMMANDS...]; ...] end \endfish diff --git a/doc_src/test.txt b/doc_src/test.txt index ba0eb0eb..199c062d 100644 --- a/doc_src/test.txt +++ b/doc_src/test.txt @@ -1,7 +1,7 @@ \section test test - perform tests on files and text \subsection test-synopsis Synopsis -\fish{syn} +\fish{synopsis} test [EXPRESSION] \endfish diff --git a/doc_src/trap.txt b/doc_src/trap.txt index e3a280a5..fdccd178 100644 --- a/doc_src/trap.txt +++ b/doc_src/trap.txt @@ -1,7 +1,7 @@ \section trap trap - perform an action when the shell receives a signal \subsection trap-synopsis Synopsis -\fish{syn} +\fish{synopsis} trap [OPTIONS] [[ARG] SIGSPEC ... ] \endfish diff --git a/doc_src/type.txt b/doc_src/type.txt index 7a2c882b..c72520a1 100644 --- a/doc_src/type.txt +++ b/doc_src/type.txt @@ -1,7 +1,7 @@ \section type type - indicate how a command would be interpreted \subsection type-synopsis Synopsis -\fish{syn} +\fish{synopsis} type [OPTIONS] NAME [NAME ...] \endfish diff --git a/doc_src/ulimit.txt b/doc_src/ulimit.txt index 0d35f913..7ce12dcd 100644 --- a/doc_src/ulimit.txt +++ b/doc_src/ulimit.txt @@ -1,7 +1,7 @@ \section ulimit ulimit - set or get resource usage limits \subsection ulimit-synopsis Synopsis -\fish{syn} +\fish{synopsis} ulimit [OPTIONS] [LIMIT] \endfish diff --git a/doc_src/umask.txt b/doc_src/umask.txt index 49e0f796..7a83ddfa 100644 --- a/doc_src/umask.txt +++ b/doc_src/umask.txt @@ -1,7 +1,7 @@ \section umask umask - set or get the file creation mode mask \subsection umask-synopsis Synopsis -\fish{syn} +\fish{synopsis} umask [OPTIONS] [MASK] \endfish diff --git a/doc_src/user_doc.css b/doc_src/user_doc.css new file mode 100644 index 00000000..d2f00642 --- /dev/null +++ b/doc_src/user_doc.css @@ -0,0 +1,261 @@ +* { + margin: 0; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +html { font-size: 62.5%; } +html, body { + min-height: 100%; + background: #fff; + color: #111; +} +body { + text-rendering: optimizeLegibility; + overflow: hidden; +} +.logo { + position: absolute; + width: 200px; + height: 135px; + background-image: url(ascii_fish.png); +} +/*Top site index*/ +.qindex { + font: 500 1.4rem/3.6rem "DejaVuSansCondensed", Roboto, Verdana, "Helvetica Neue", Helvetica, Arial, sans-serif; + border: none; + color: white; + background-color: #1f2d53; + text-align: center; + position: relative; + width: 100%; + height: 3.6rem; + overflow: hidden; +} +/* Don't show the header */ +.header { display: none; } +/*Substructure*/ +.contents { + margin: 0; + min-width: 570px; +} +.fish_left_bar, .fish_right_bar, .fish_only_bar { + position: absolute; + top: 3.6rem; + bottom: 0; + overflow-y: scroll; + -webkit-overflow-scrolling: touch; /* necessary for momentum scrolling */ + font: 400 1.4rem/2.3rem "DejaVuSans", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; +} +.fish_left_bar { + width: 250px; + color: white; + font-family: "DejaVuSansCondensed", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; + background-color: #1f2d53; +} +.fish_left_little { width: 200px; } +.fish_left_big { width: 380px; } +.fish_right_bar { + margin-left: 250px; + margin-right: 0; + padding: 0 3rem; + -moz-box-shadow: -6px 0 6px 4px black; + -webkit-box-shadow: -6px 0 6px 4px black; + box-shadow: -0.6rem 0 0.6rem 0.4rem rgba(0,0,0,0.4); +} +.fish_right_little { margin-left: 380px; } +.fish_right_big { margin-left: 200px; } +.fish_only_bar { + width: 100%; +} +hr { + height: 0; + border: none; + border-top: 1px solid #AAA; +} +/*Ineraction*/ +a { color: #3d5cb3; } +.qindex a { + color: white; + text-decoration: none; +} +.qindex a:hover { text-decoration: underline; } +.fish_left_bar a { + color: white; + text-decoration: none; +} +.fish_left_bar a:visited { color: inherit; } +.fish_left_bar a:hover { color: #88aaff; } +.fish_right_bar a { text-decoration: none; } +.fish_right_bar a:hover { text-decoration: underline; } +/* Adjust lists */ +.fish_left_bar ul { + padding-left: 2rem; + padding-right: 1rem; +} +.fish_right_bar ul { + list-style-type: circle; + padding-left: 2.4rem; + margin: 1.4rem 0; +} +.fish_right_bar ul li { + margin-bottom: 0.6rem; +} +.fish_right_bar p > code { + display: inline-block; +} +/* Typography */ +p { margin: 1rem 0; } +h1, h2, h3, h4, h5, h6 { + color: #1f2d53; + font-family: Roboto, "DejaVuSansCondensed-Bold", "DejaVuSans-Bold", Verdana, sans-serif; +} +h1 { + margin: 2rem 0 1.4rem 0; + font-weight: 700; + font-size: 2rem; +} +h2 { + margin: 1.6rem 0 1rem 0; + font-weight: 600; + font-size: 1.7rem; +} +h3 { + margin: 1rem 0 0.4rem 0; + font-weight: 500; + font-size: 1.6rem; +} +.interior_title { + font-size: 2rem; + color: #414141; + padding-bottom: 10px; + border-bottom: 1px solid #AAA; +} +/*Special Formmating for Code and keys*/ +.key span { + display:none; +} +.key em { + margin-right: 2px; + font-style: normal; +} +.key em, .key b { + padding: 0 4px; + background-color: #fafafa; + border: 1px solid #aaa; + border-radius: 3px; + font-weight: normal; + white-space: nowrap; +} +tt, code, pre, .fish { + font-family: "DejaVu Sans Mono", Menlo, Monaco, "Source Code Pro", "Ubuntu Mono", "Consolas", "Lucida Console", monospace, fixed; + font-weight: 500; + text-shadow: 0 0 0 rgba(0,0,0,1); /* Stronger anti-aliasing */ +} +tt { + color: red; /*REMOVE THIS*/ +} +code, pre, .line { + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + white-space: pre-wrap; + word-wrap: break-word; +} +h1 > code, h2 > code, h3 > code { + font-family: "DejaVu Sans Mono", Menlo, "Source Code Pro", "Consolas", "Lucida Console", Roboto, Verdana, sans-serif; + font-weight: 700; +} +.fish { + margin: 1rem; + padding: 0.4rem 1rem; + line-height: 1.9rem; + background-color: #fafafa; + border: 1px solid #f0f0f0; + border-radius: 0.4rem; +} + +.comment { color: #777; } +.command { color: #0A0; } +.function { color: #0A0; } +.binary { color: #060; } +.argument { color: #906; } +.variable { color: #339; } +.redirect { color: #F00; } +.operator { color: #990; } +.file { color: #c97922; } +.path { color: #c97922; } +.string { color: #770; } +.prompt { color: #03C; } +.suggest { color: cyan ; } +.error { color: red; font-weight: bold; } +.cursor { border-bottom: 2px solid green; } + + +/*.keyword, .keywordflow { color: #050; }*/ +/*.stringliteral, .charliteral { color: #226; }*/ +/*.preprocessor, .comment { color: #555; text-shadow: none; }*/ + +.cli-dark { + background-color: #111; + color: #ddd; + padding: 0.4rem 2rem; + border-radius: 0.4rem; +} +/* +.cli .command { + color: #0E0; + font-weight: bold; +} +.cli .function { + color: #0C0; +}*/ +/*Menus*/ +.menu { margin: 1.4rem 0; line-height: 2.2rem; } +.menu ul { list-style-type: none; } +.menu > ul li { position: relative; } +.menu > ul li:before { + content: "›"; + color: #88aaff; + font-size: 1.6rem; + position: absolute; + left: -1rem; + top: -1px; +} +/*Page overrides*/ +/*Documentation*/ +.docs_menu { line-height: 2rem } +.docs_menu > ul > li { position: static; } +.docs_menu > ul ul { margin: 0.6rem 0; } +.docs_menu > ul ul > li { margin-bottom: 0.2rem; } +/*Tutorial*/ + +/*Design*/ +.design { + max-width: 780px; + margin: 0 auto; + padding: 0 4rem; +} +/*Commands*/ +.commands_menu { line-height: 2rem } +/*FAQ*/ +.faq_menu { line-height: 2rem } +.faq_menu > ul li { margin-bottom: 0.6rem; } +/*Licenses*/ +.license { + max-width: 780px; + margin: 0 auto; + padding: 0 4rem; +} +.license li { margin: 1rem 0; } +.license ul li:first-child { + list-style-type: none; + position: relative; +} +.license ul li:first-child:before { + content: "0."; + position: absolute; + left: -2rem; +} + + diff --git a/doc_src/user_doc.css.in b/doc_src/user_doc.css.in deleted file mode 100644 index d2f00642..00000000 --- a/doc_src/user_doc.css.in +++ /dev/null @@ -1,261 +0,0 @@ -* { - margin: 0; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -html { font-size: 62.5%; } -html, body { - min-height: 100%; - background: #fff; - color: #111; -} -body { - text-rendering: optimizeLegibility; - overflow: hidden; -} -.logo { - position: absolute; - width: 200px; - height: 135px; - background-image: url(ascii_fish.png); -} -/*Top site index*/ -.qindex { - font: 500 1.4rem/3.6rem "DejaVuSansCondensed", Roboto, Verdana, "Helvetica Neue", Helvetica, Arial, sans-serif; - border: none; - color: white; - background-color: #1f2d53; - text-align: center; - position: relative; - width: 100%; - height: 3.6rem; - overflow: hidden; -} -/* Don't show the header */ -.header { display: none; } -/*Substructure*/ -.contents { - margin: 0; - min-width: 570px; -} -.fish_left_bar, .fish_right_bar, .fish_only_bar { - position: absolute; - top: 3.6rem; - bottom: 0; - overflow-y: scroll; - -webkit-overflow-scrolling: touch; /* necessary for momentum scrolling */ - font: 400 1.4rem/2.3rem "DejaVuSans", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; -} -.fish_left_bar { - width: 250px; - color: white; - font-family: "DejaVuSansCondensed", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; - background-color: #1f2d53; -} -.fish_left_little { width: 200px; } -.fish_left_big { width: 380px; } -.fish_right_bar { - margin-left: 250px; - margin-right: 0; - padding: 0 3rem; - -moz-box-shadow: -6px 0 6px 4px black; - -webkit-box-shadow: -6px 0 6px 4px black; - box-shadow: -0.6rem 0 0.6rem 0.4rem rgba(0,0,0,0.4); -} -.fish_right_little { margin-left: 380px; } -.fish_right_big { margin-left: 200px; } -.fish_only_bar { - width: 100%; -} -hr { - height: 0; - border: none; - border-top: 1px solid #AAA; -} -/*Ineraction*/ -a { color: #3d5cb3; } -.qindex a { - color: white; - text-decoration: none; -} -.qindex a:hover { text-decoration: underline; } -.fish_left_bar a { - color: white; - text-decoration: none; -} -.fish_left_bar a:visited { color: inherit; } -.fish_left_bar a:hover { color: #88aaff; } -.fish_right_bar a { text-decoration: none; } -.fish_right_bar a:hover { text-decoration: underline; } -/* Adjust lists */ -.fish_left_bar ul { - padding-left: 2rem; - padding-right: 1rem; -} -.fish_right_bar ul { - list-style-type: circle; - padding-left: 2.4rem; - margin: 1.4rem 0; -} -.fish_right_bar ul li { - margin-bottom: 0.6rem; -} -.fish_right_bar p > code { - display: inline-block; -} -/* Typography */ -p { margin: 1rem 0; } -h1, h2, h3, h4, h5, h6 { - color: #1f2d53; - font-family: Roboto, "DejaVuSansCondensed-Bold", "DejaVuSans-Bold", Verdana, sans-serif; -} -h1 { - margin: 2rem 0 1.4rem 0; - font-weight: 700; - font-size: 2rem; -} -h2 { - margin: 1.6rem 0 1rem 0; - font-weight: 600; - font-size: 1.7rem; -} -h3 { - margin: 1rem 0 0.4rem 0; - font-weight: 500; - font-size: 1.6rem; -} -.interior_title { - font-size: 2rem; - color: #414141; - padding-bottom: 10px; - border-bottom: 1px solid #AAA; -} -/*Special Formmating for Code and keys*/ -.key span { - display:none; -} -.key em { - margin-right: 2px; - font-style: normal; -} -.key em, .key b { - padding: 0 4px; - background-color: #fafafa; - border: 1px solid #aaa; - border-radius: 3px; - font-weight: normal; - white-space: nowrap; -} -tt, code, pre, .fish { - font-family: "DejaVu Sans Mono", Menlo, Monaco, "Source Code Pro", "Ubuntu Mono", "Consolas", "Lucida Console", monospace, fixed; - font-weight: 500; - text-shadow: 0 0 0 rgba(0,0,0,1); /* Stronger anti-aliasing */ -} -tt { - color: red; /*REMOVE THIS*/ -} -code, pre, .line { - white-space: -moz-pre-wrap; - white-space: -pre-wrap; - white-space: -o-pre-wrap; - white-space: pre-wrap; - word-wrap: break-word; -} -h1 > code, h2 > code, h3 > code { - font-family: "DejaVu Sans Mono", Menlo, "Source Code Pro", "Consolas", "Lucida Console", Roboto, Verdana, sans-serif; - font-weight: 700; -} -.fish { - margin: 1rem; - padding: 0.4rem 1rem; - line-height: 1.9rem; - background-color: #fafafa; - border: 1px solid #f0f0f0; - border-radius: 0.4rem; -} - -.comment { color: #777; } -.command { color: #0A0; } -.function { color: #0A0; } -.binary { color: #060; } -.argument { color: #906; } -.variable { color: #339; } -.redirect { color: #F00; } -.operator { color: #990; } -.file { color: #c97922; } -.path { color: #c97922; } -.string { color: #770; } -.prompt { color: #03C; } -.suggest { color: cyan ; } -.error { color: red; font-weight: bold; } -.cursor { border-bottom: 2px solid green; } - - -/*.keyword, .keywordflow { color: #050; }*/ -/*.stringliteral, .charliteral { color: #226; }*/ -/*.preprocessor, .comment { color: #555; text-shadow: none; }*/ - -.cli-dark { - background-color: #111; - color: #ddd; - padding: 0.4rem 2rem; - border-radius: 0.4rem; -} -/* -.cli .command { - color: #0E0; - font-weight: bold; -} -.cli .function { - color: #0C0; -}*/ -/*Menus*/ -.menu { margin: 1.4rem 0; line-height: 2.2rem; } -.menu ul { list-style-type: none; } -.menu > ul li { position: relative; } -.menu > ul li:before { - content: "›"; - color: #88aaff; - font-size: 1.6rem; - position: absolute; - left: -1rem; - top: -1px; -} -/*Page overrides*/ -/*Documentation*/ -.docs_menu { line-height: 2rem } -.docs_menu > ul > li { position: static; } -.docs_menu > ul ul { margin: 0.6rem 0; } -.docs_menu > ul ul > li { margin-bottom: 0.2rem; } -/*Tutorial*/ - -/*Design*/ -.design { - max-width: 780px; - margin: 0 auto; - padding: 0 4rem; -} -/*Commands*/ -.commands_menu { line-height: 2rem } -/*FAQ*/ -.faq_menu { line-height: 2rem } -.faq_menu > ul li { margin-bottom: 0.6rem; } -/*Licenses*/ -.license { - max-width: 780px; - margin: 0 auto; - padding: 0 4rem; -} -.license li { margin: 1rem 0; } -.license ul li:first-child { - list-style-type: none; - position: relative; -} -.license ul li:first-child:before { - content: "0."; - position: absolute; - left: -2rem; -} - - diff --git a/doc_src/vared.txt b/doc_src/vared.txt index 90877553..7001be74 100644 --- a/doc_src/vared.txt +++ b/doc_src/vared.txt @@ -1,7 +1,7 @@ \section vared vared - interactively edit the value of an environment variable \subsection vared-synopsis Synopsis -\fish{syn} +\fish{synopsis} vared VARIABLE_NAME \endfish diff --git a/doc_src/while.txt b/doc_src/while.txt index 2fa74cb6..80ec959b 100644 --- a/doc_src/while.txt +++ b/doc_src/while.txt @@ -1,7 +1,7 @@ \section while while - perform a command multiple times \subsection while-synopsis Synopsis -\fish{syn} +\fish{synopsis} while CONDITION; COMMANDS...; end \endfish -- cgit v1.2.3 From 1cd50ba5722c424ddd70e26b0425d7496edcfa6a Mon Sep 17 00:00:00 2001 From: Mark Griffiths Date: Sat, 2 Aug 2014 04:51:43 +0100 Subject: Merged in latest changes to docs and formatting tweaks Addresses issue #1557 as well as fixing many typos, HTML errors and inconsistencies. Also introduces automatic syntax colouring and enables new documentation to be written in Markdown. TODO fix Tutorial. --- Makefile.in | 3 ++- doc_src/fish_lexicon_filter.in | 61 +++++++++++++++++++++++++++++++++++------- doc_src/index.hdr.in | 4 +-- doc_src/user_doc.css | 23 ++++++++-------- 4 files changed, 66 insertions(+), 25 deletions(-) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index ca4a33ab..39cbd8d7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -388,7 +388,8 @@ doc_src/fish_lexicon_filter: lexicon.txt doc_src/fish_lexicon_filter.in sed <$@.in >$@.tmp -e 's|@sed@|'"`command -v sed`"'|' -e '/^[ ]*#[^!]/d' # Scan through the lexicon, transforming each line to something usefue to Doxygen. sed >$@.tmp -n \ - -e 's|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,[[:<:]]\2[[:>:]],@\1{\2},g|p'; + -e 's|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,[[:<:]]\2[[:>:]],@\1{\2},g|p' \ + -e '$$G;s/.*\n/b tidy/p'; \ mv $@.tmp $@; if test -x $@; then true; else chmod a+x $@; fi # diff --git a/doc_src/fish_lexicon_filter.in b/doc_src/fish_lexicon_filter.in index 47ee345e..8a8c46b2 100644 --- a/doc_src/fish_lexicon_filter.in +++ b/doc_src/fish_lexicon_filter.in @@ -7,8 +7,8 @@ # by Mark Griffiths *but quite portable #. # Finds /fish../endfish blocks in documentation source files and enhances -# markup. Requires that the short tags declared here are added to Doxyfiles as -# aliases i.e.: +# markup. Requires that the four character word 'classes' declared here are +# added to Doxyfiles as aliases i.e.: #. # Enhance for HTML Help pages (Doxyfile.user)… # ALIASES = "fish=\htmlonly[block] \n
"
@@ -26,6 +26,16 @@
 # ALIASES  += "blah{1}=\1"
 # ALIASES  += "cmnd{1}=\1"...
 #.
+# It's meant to only ever be run once, during make, as Doxygen's 'INPUT
+# FILTER', though can be run interactively by passing a file in via stdin. It
+# wont respond to arguments.
+#.
+# It's most easily tested by passing test strings into the compiled script:
+#.
+# echo "Line to test" | ./fish_lexicon_filter
+#.
+# The, at times, archiac looking regex is down to ensuring portable sed BREs
+#.
 # Licensed under whatever terms are most compatible with Fish's GPLv2 license,
 # bascially free to use/reuse/redistribute/laugh at/be inspired by. Don't
 # pretend it's your code unless you've spent more late nights on it than me but
@@ -35,9 +45,10 @@
 #.
 # Pattern flow control for scanning doc.h
 /\\fish/,/\\endfish/ {
-    # Open \fish block
+    # Open \fish block, firstly it it's on it's own line
     /^\\fish$/b
     /^\\fish{[^}]*}$/b
+    # Then if it's inline. Remove and process immediately...
     /^\\fish.*$/ {
         s/^\\fish//
         s/\\endfish//
@@ -172,6 +183,7 @@ s|\([^/~A-Za-z0-9]\)\([~/][/]*\)\([A-Za-z_0-9./-]*\)|\1\\\
 |g
 #.
 b protect
+#.
 # Tidy up. Merge back 'pure' entities from hold space.
 :tidy
 #.
@@ -207,6 +219,7 @@ s/\n//g
     s/\(redr{[^@]*\)@func{\([^}]*\)}/\1\2/
     s/\(redr{[^@]*\)@sbin{\([^}]*\)}/\1\2/
     s/\(redr{[^@]*\)@fsfo{\([^}]*\)}/\1\2/
+    s/\(redr{[^}]*\)}\( *\)@path{\([^}]*\)/\1\2\3/
     t cleanredr
 }
 /@fsfo/{
@@ -216,13 +229,44 @@ s/\n//g
     s/\(fsfo{[^@]*\)@sbin{\([^}]*\)}/\1\2/
     t cleanfsfo
 }
-# Convert 2nd order commands/functions and binaries to arguments
-s/@cmnd/@args/g
-s/@args/@cmnd/1
+#.
+# Finally, restructure to follow Fish's command [arguments] semantics.
+# Find the initial command, and change any others to arguments, up to a ( or ;
+# Assumes that a valid line will start with either a builtin, a function or a binary.
+#.
+:nextcmnd
+s/@cmnd\(.*\)$/@xcmd\
+\1/
+t castargs
+s/@func\(.*\)$/@xfnc\
+\1/
+t castargs
+s/@sbin\(.*\)$/@xbin\
+\1/
+t castargs
+b cleancmd
+:castargs
+s/\n\([^;(]*[;(]\)/\1/
+t nextcmnd
+s/\n\([^@]*\)@cmnd\(.*\)/\1@args\
+\2/
+t castargs
+s/\n\([^@]*\)@func\(.*\)/\1@args\
+\2/
+t castargs
+s/\n\([^@]*\)@sbin\(.*\)/\1@args\
+\2/
+t castargs
+:cleancmd
+s/xcmd/cmnd/g
+s/xfnc/func/g
+s/xbin/sbin/g
+s/\n//g
 # Character Entities
 #.
 # Mark up a few sesitive characters.
 #.
+:entities
 s//\>/g
 #.
@@ -274,12 +318,9 @@ s/\([$%][$%]*\)\([A-Za-z_0-9][A-Za-z_0-9]*\)/@vars{@optr{\1}\2}/g
 # Files
 s/\([A-Za-z*][A-Za-z]*\.[a-z0-9][a-z0-9]*\)/@fsfo{\1}/g
 #.
-# Operators
-# s/\([^^=|+*&%<>{-]\)\([=|+*&%<>^-][|+*&%<>^-]*\)\([^0-9A-Za-z]\)/\1@optr{\2}\3/g
-#.
 :commands
 #.
-# Manually add a few commands not harvested from source.
+# Manually add a few commands not harvested from source files.
 #.
 s,[[:<:]]in[[:>:]],@args{in},g
 s,[[:<:]]whoami[[:>:]],@sbin{whoami},g
diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in
index 95b1559c..526954fc 100644
--- a/doc_src/index.hdr.in
+++ b/doc_src/index.hdr.in
@@ -605,8 +605,8 @@ end
 function avast
     set phrase 'Avast, mateys'
 
-    # Calling the shiver function here can not change any variables
-    # in the local scope
+    # Calling the shiver function here can not
+    # change any variables in the local scope
     shiver
 
     echo $phrase
diff --git a/doc_src/user_doc.css b/doc_src/user_doc.css
index d2f00642..abe70835 100644
--- a/doc_src/user_doc.css
+++ b/doc_src/user_doc.css
@@ -30,7 +30,6 @@ body {
     position: relative;
     width: 100%;
     height: 3.6rem;
-    overflow: hidden;
 }
 /* Don't show the header */
 .header { display: none; }
@@ -45,7 +44,7 @@ body {
     bottom: 0;
     overflow-y: scroll;
     -webkit-overflow-scrolling: touch; /* necessary for momentum scrolling */
-    font: 400 1.4rem/2.3rem "DejaVuSans", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
+    font: 400 1.3rem/2.1rem "DejaVuSans", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
 }
 .fish_left_bar {
     width: 250px;
@@ -54,16 +53,14 @@ body {
     background-color: #1f2d53;
 }
 .fish_left_little { width: 200px; }
-.fish_left_big { width: 380px; }
 .fish_right_bar {
     margin-left: 250px;
     margin-right: 0;
     padding: 0 3rem;
     -moz-box-shadow: -6px 0 6px 4px black;
     -webkit-box-shadow: -6px 0 6px 4px black;
-    box-shadow: -0.6rem 0 0.6rem 0.4rem rgba(0,0,0,0.4);
+    box-shadow: -0.3rem 0.3rem 1rem #000818;
 }
-.fish_right_little { margin-left: 380px; }
 .fish_right_big { margin-left: 200px; }
 .fish_only_bar {
     width: 100%;
@@ -90,7 +87,7 @@ a { color: #3d5cb3; }
 .fish_right_bar a:hover { text-decoration: underline; }
 /* Adjust lists */
 .fish_left_bar ul {
-    padding-left: 2rem;
+    padding-left: 1.4rem;
     padding-right: 1rem;
 }
 .fish_right_bar ul {
@@ -111,22 +108,23 @@ h1, h2, h3, h4, h5, h6 {
     font-family: Roboto, "DejaVuSansCondensed-Bold", "DejaVuSans-Bold", Verdana, sans-serif;
 }
 h1 {
-    margin: 2rem 0 1.4rem 0;
+    margin: 1.6rem 0 1rem 0;
     font-weight: 700;
-    font-size: 2rem;
+    font-size: 1.7rem;
 }
 h2 {
     margin: 1.6rem 0 1rem 0;
-    font-weight: 600;
+    font-weight: 700;
     font-size: 1.7rem;
 }
 h3 {
     margin: 1rem 0 0.4rem 0;
     font-weight: 500;
-    font-size: 1.6rem;
+    font-size: 1.5rem;
 }
 .interior_title {
     font-size: 2rem;
+    margin: 2rem 0 1.4rem 0;
     color: #414141;
     padding-bottom: 10px;
     border-bottom: 1px solid #AAA;
@@ -167,8 +165,9 @@ h1 > code, h2 > code, h3 > code {
     font-weight: 700;
 }
 .fish {
-    margin: 1rem;
-    padding: 0.4rem 1rem;
+    margin: 1rem 0;
+    padding: 0.6rem 1rem;
+    font-size: 1.3rem;
     line-height: 1.9rem;
     background-color: #fafafa;
     border: 1px solid #f0f0f0;
-- 
cgit v1.2.3


From c900f23662a34599570ee54a36343c4136c58698 Mon Sep 17 00:00:00 2001
From: Mark Griffiths 
Date: Sun, 3 Aug 2014 02:25:47 +0100
Subject: Add lexicon filter to manpages.

 Fixed manpage 'NAME'. Under Doxygen 1.8, the output format has
changed, so the old sed script was leaving man pages with two titles.
---
 Doxyfile.help                      | 16 ++++++++--------
 Makefile.in                        | 11 ++++++-----
 build_tools/build_documentation.sh | 14 +++++++++-----
 3 files changed, 23 insertions(+), 18 deletions(-)

(limited to 'Makefile.in')

diff --git a/Doxyfile.help b/Doxyfile.help
index beda7bbb..74673382 100644
--- a/Doxyfile.help
+++ b/Doxyfile.help
@@ -241,9 +241,9 @@ ALIASES               += "endfish=
" ALIASES += "asis{1}=\1" ALIASES += "blah{1}=\1" -ALIASES += "cmnd{1}=\1" -ALIASES += "func{1}=\1" -ALIASES += "sbin{1}=\1" +ALIASES += "cmnd{1}=\b \1" +ALIASES += "func{1}=\b \1" +ALIASES += "sbin{1}=\b \1" ALIASES += "args{1}=\1" ALIASES += "opts{1}=\1" ALIASES += "vars{1}=\1" @@ -253,18 +253,18 @@ ALIASES += "fsfo{1}=\1" ALIASES += "path{1}=\1" ALIASES += "clrv{1}=\1" -ALIASES += "strg{1}=\1" +ALIASES += "strg{1}=\1" ALIASES += "sglq{1}=\'\1\'" ALIASES += "dblq{1}=\"\1\"" -ALIASES += "prmt{1}=" -ALIASES += "sgst{1}=\1" +ALIASES += "prmt{1}=\1" +ALIASES += "sgst{1}=\1" ALIASES += "eror{1}=\1" -ALIASES += "curs{1}=_" +ALIASES += "curs{1}=\1" ALIASES += "bold{1}=\1" ALIASES += "emph{1}=\1" -ALIASES += "undr{1}=\1" +ALIASES += "undr{1}=\1" ALIASES += "span{2}=\1" ALIASES += "spcl{2}=\1" diff --git a/Makefile.in b/Makefile.in index 39cbd8d7..cd1c5738 100644 --- a/Makefile.in +++ b/Makefile.in @@ -277,7 +277,7 @@ doc_src/user_doc.css: doc_src/user_doc.css.in doc_src/fish_lexicon_filter # doc: *.h *.cpp doc.h Doxyfile - (cat Doxyfile ; echo PROJECT_NUMBER=$(FISH_BUILD_VERSION)) | doxygen - ; + (cat Doxyfile; echo PROJECT_NUMBER=$(FISH_BUILD_VERSION)) | doxygen - ; # @@ -386,7 +386,7 @@ doc_src/fish_lexicon_filter: lexicon.txt doc_src/fish_lexicon_filter.in # Clean the filter input comments and set the shebang as sed can reside in # /bin or /usr/bin and some versions dont allow more than one comment!. sed <$@.in >$@.tmp -e 's|@sed@|'"`command -v sed`"'|' -e '/^[ ]*#[^!]/d' - # Scan through the lexicon, transforming each line to something usefue to Doxygen. + # Scan through the lexicon, transforming each line to something useful to Doxygen. sed >$@.tmp -n \ -e 's|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,[[:<:]]\2[[:>:]],@\1{\2},g|p' \ -e '$$G;s/.*\n/b tidy/p'; \ @@ -493,11 +493,12 @@ common.o: $(COMMON_FILES) # There ought to be something simpler. # -share/man: $(HELP_SRC) +share/man: $(HELP_SRC) doc_src/fish_lexicon_filter -mkdir share/man touch share/man -rm -Rf share/man/man1 - PROJECT_NUMBER=`echo $(FISH_BUILD_VERSION)| sed "s/-.*//"` ./build_tools/build_documentation.sh Doxyfile.help ./doc_src ./share + PROJECT_NUMBER=`echo $(FISH_BUILD_VERSION)| sed "s/-.*//"` INPUT_FILTER=doc_src/fish_lexicon_filter \ + ./build_tools/build_documentation.sh Doxyfile.help ./doc_src ./share # # The build rules for installing/uninstalling fish @@ -811,7 +812,7 @@ clean: rm -f $(PROGRAMS) fish_tests key_reader rm -f command_list.txt command_list_toc.txt toc.txt rm -f doc_src/index.hdr doc_src/commands.hdr - rm -f doc_src/fish_lexicon_filter lexicon.txt + rm -f doc_src/fish_lexicon_filter lexicon.txt debug-lexicon.log rm -f FISH-BUILD-VERSION-FILE if test "$(HAVE_DOXYGEN)" = 1; then \ rm -rf doc user_doc share/man; \ diff --git a/build_tools/build_documentation.sh b/build_tools/build_documentation.sh index 0c4a2aac..2705898e 100755 --- a/build_tools/build_documentation.sh +++ b/build_tools/build_documentation.sh @@ -37,10 +37,12 @@ resolve_path() # Expand relative paths DOXYFILE=`resolve_path "$DOXYFILE"` INPUTDIR=`resolve_path "$INPUTDIR"` +INPUTFILTER=`resolve_path "$INPUT_FILTER"` OUTPUTDIR=`resolve_path "$OUTPUTDIR"` echo " doxygen file: $DOXYFILE" echo " input directory: $INPUTDIR" +echo " input filter: $INPUTFILTER" echo " output directory: $OUTPUTDIR" echo " skipping: $CONDEMNED_PAGES" @@ -87,6 +89,7 @@ done # This prevents doxygen from generating "documentation" for intermediate directories DOXYPARAMS=$(cat < "${CMD_NAME}.1.tmp" + sed < ${CMD_NAME}.1 > ${CMD_NAME}.1.tmp \ + -e "/.SH \"$CMD_NAME/d" \ + -e "s/^$CMD_NAME * \\\- \([^ ]*\) /\\\fB\1\\\fP -/" mv "${CMD_NAME}.1.tmp" "${CMD_NAME}.1" done - + # Erase condemned pages rm -f $CONDEMNED_PAGES - fi # Destroy TMPLOC -- cgit v1.2.3 From 509d152e5407856ce00833b931ef29c3d98c3573 Mon Sep 17 00:00:00 2001 From: Mark Griffiths Date: Fri, 8 Aug 2014 03:44:37 +0100 Subject: Tutorial auto colouring, Man page and Make fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Completely fixes #1557 and the underlying Doxygen changes that caused it. Should make fish docs simpler and more robust, more consistent and generally prettier. todo: - trap unmarked text as arguments in context - test & fix sed portability - see in particular. (so far tested on BSD (Mac) and GNU sed). - test Makefile changes - last round of aesthetic changes and getting that ascii fish in there… --- .gitignore | 5 +- Doxyfile | 44 +++- Doxyfile.help | 79 +++---- Doxyfile.user | 79 +++---- Makefile.in | 26 ++- doc_src/alias.txt | 4 +- doc_src/commands.hdr.in | 4 +- doc_src/design.hdr | 6 +- doc_src/echo.txt | 2 +- doc_src/faq.hdr | 4 +- doc_src/fish.txt | 2 +- doc_src/fish_indent.txt | 2 +- doc_src/fish_lexicon_filter.in | 411 ----------------------------------- doc_src/fish_prompt.txt | 3 +- doc_src/functions.txt | 2 +- doc_src/if.txt | 5 +- doc_src/index.hdr.in | 69 +++--- doc_src/nextd.txt | 2 +- doc_src/psub.txt | 8 +- doc_src/set.txt | 18 +- doc_src/set_color.txt | 2 +- doc_src/source.txt | 7 +- doc_src/trap.txt | 7 +- doc_src/tutorial.hdr | 356 +++++++++++++++--------------- doc_src/type.txt | 6 +- doc_src/user_doc.css | 3 +- doc_src/while.txt | 7 +- lexicon_filter.in | 475 +++++++++++++++++++++++++++++++++++++++++ 28 files changed, 888 insertions(+), 750 deletions(-) delete mode 100644 doc_src/fish_lexicon_filter.in create mode 100644 lexicon_filter.in (limited to 'Makefile.in') diff --git a/.gitignore b/.gitignore index 492c5758..2fe2f215 100644 --- a/.gitignore +++ b/.gitignore @@ -30,14 +30,15 @@ share/man/ toc.txt user_doc/ xcuserdata +fish.xccheckout tests/*tmp.* tests/foo.txt FISH-BUILD-VERSION-FILE version messages.pot lexicon.txt -doc_src/fish_lexicon_filter -debug-lexicon.log +lexicon_filter +lexicon-debug.log Fish-Shell.sublime-workspace Fish-Shell.sublime-project diff --git a/Doxyfile b/Doxyfile index 3cd01663..38cbd687 100644 --- a/Doxyfile +++ b/Doxyfile @@ -228,8 +228,48 @@ TAB_SIZE = 8 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = "fish=\n
\verbatim" -ALIASES += "endfish=\endverbatim
" +ALIASES = "key{1}=\1" +ALIASES += "key{2}=\1-\2" +ALIASES += "key{3}=\1-\3" +ALIASES += "cursor_key{2}=\2" + +ALIASES += "fish=\htmlonly[block] \n
"
+ALIASES += "fish{1}=\htmlonly[block] \n
"
+ALIASES += "endfish=
\endhtmlonly \n" + +ALIASES += "asis{1}=\1" +ALIASES += "outp{1}=\1" +ALIASES += "blah{1}=#\1" +ALIASES += "cmnd{1}=\1" +ALIASES += "func{1}=\1" +ALIASES += "sbin{1}=\1" +ALIASES += "args{1}=\1" +ALIASES += "opts{1}=\1" +ALIASES += "vars{1}=\1" +ALIASES += "optr{1}=\1" +ALIASES += "redr{1}=\1" +ALIASES += "fsfo{1}=\1" +ALIASES += "path{1}=\1" +ALIASES += "clrv{1}=\1" + +ALIASES += "strg{1}=\1" +ALIASES += "sglq{1}='\1'" +ALIASES += "dblq{1}=\"\1\"" + +ALIASES += "prmt=>" +ALIASES += "prmt{1}=\1>" +ALIASES += "sgst{1}=\1" +ALIASES += "mtch{1}=\1" +ALIASES += "smtc{1}=\1" +ALIASES += "eror{1}=\1" +ALIASES += "curs=_" +ALIASES += "curs{1}=\1" + +ALIASES += "bold{1}=\1" +ALIASES += "emph{1}=\1" +ALIASES += "undr{1}=\1" +ALIASES += "span{2}=\2" +ALIASES += "spcl{2}=\2" # 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" diff --git a/Doxyfile.help b/Doxyfile.help index 74673382..7b905572 100644 --- a/Doxyfile.help +++ b/Doxyfile.help @@ -230,43 +230,48 @@ TAB_SIZE = 4 # Simplify Fish output from Doxygen for man pages. (see fish_lexicon_filter) -ALIASES = "key{1}=\1" -ALIASES += "key{2}=\1-\2" -ALIASES += "key{3}=\1-\3" -ALIASES += "cursor_key{2}=\2" - -ALIASES += "fish=
"
-ALIASES               += "fish{1}=
"
-ALIASES               += "endfish=
" - -ALIASES += "asis{1}=\1" -ALIASES += "blah{1}=\1" -ALIASES += "cmnd{1}=\b \1" -ALIASES += "func{1}=\b \1" -ALIASES += "sbin{1}=\b \1" -ALIASES += "args{1}=\1" -ALIASES += "opts{1}=\1" -ALIASES += "vars{1}=\1" -ALIASES += "optr{1}=\1" -ALIASES += "redr{1}=\1" -ALIASES += "fsfo{1}=\1" -ALIASES += "path{1}=\1" -ALIASES += "clrv{1}=\1" - -ALIASES += "strg{1}=\1" -ALIASES += "sglq{1}=\'\1\'" -ALIASES += "dblq{1}=\"\1\"" - -ALIASES += "prmt{1}=\1" -ALIASES += "sgst{1}=\1" -ALIASES += "eror{1}=\1" -ALIASES += "curs{1}=\1" - -ALIASES += "bold{1}=\1" -ALIASES += "emph{1}=\1" -ALIASES += "undr{1}=\1" -ALIASES += "span{2}=\1" -ALIASES += "spcl{2}=\1" +ALIASES = "key{1}=\1" +ALIASES += "key{2}=\1-\2" +ALIASES += "key{3}=\1-\3" +ALIASES += "cursor_key{2}=\2" + +ALIASES += "fish=
"
+ALIASES += "fish{1}=
"
+ALIASES += "endfish=
" + +ALIASES += "asis{1}=\1" +ALIASES += "outp{1}=\1" +ALIASES += "blah{1}= \1" +ALIASES += "cmnd{1}=\1" +ALIASES += "func{1}=\1" +ALIASES += "sbin{1}=\1" +ALIASES += "args{1}=\1" +ALIASES += "opts{1}=\1" +ALIASES += "vars{1}=\1" +ALIASES += "optr{1}=\1" +ALIASES += "redr{1}=\1" +ALIASES += "fsfo{1}=\1" +ALIASES += "path{1}=\1" +ALIASES += "clrv{1}=\1" + +ALIASES += "strg{1}=\1" +ALIASES += "sglq{1}='\1'" +ALIASES += "dblq{1}=\"\1\"" + +ALIASES += "prmt=>" +ALIASES += "prmt{1}=\1>" +ALIASES += "sgst{1}=\1" +ALIASES += "mtch{1}=\1" +ALIASES += "smtc{1}=\1" +ALIASES += "eror{1}=\1" +ALIASES += "curs=_" +ALIASES += "curs{1}=\1" + +ALIASES += "bold{1}=\1" +ALIASES += "emph{1}=\1" +ALIASES += "undr{1}=\1" +ALIASES += "span{2}=\2" +ALIASES += "spcl{2}=\2" # 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" diff --git a/Doxyfile.user b/Doxyfile.user index 09683abd..b1319a78 100644 --- a/Doxyfile.user +++ b/Doxyfile.user @@ -230,43 +230,48 @@ TAB_SIZE = 4 # Enhance Fish docs output from Doxygen. (See fish_lexicon_filter.in) -ALIASES = "key{1}=\1" -ALIASES += "key{2}=\1-\2" -ALIASES += "key{3}=\1-\2" -ALIASES += "cursor_key{2}=\1" - -ALIASES += "fish=\htmlonly[block] \n
"
-ALIASES               += "fish{1}=\htmlonly[block] \n
"
-ALIASES               += "endfish=
\endhtmlonly \n" - -ALIASES += "asis{1}=\1" -ALIASES += "blah{1}=\1" -ALIASES += "cmnd{1}=\1" -ALIASES += "func{1}=\1" -ALIASES += "sbin{1}=\1" -ALIASES += "args{1}=\1" -ALIASES += "opts{1}=\1" -ALIASES += "vars{1}=\1" -ALIASES += "optr{1}=\1" -ALIASES += "redr{1}=\1" -ALIASES += "fsfo{1}=\1" -ALIASES += "path{1}=\1" -ALIASES += "clrv{1}=\1" - -ALIASES += "strg{1}=\1" -ALIASES += "sglq{1}='\1'" -ALIASES += "dblq{1}=\"\1\"" - -ALIASES += "prmt{1}=" -ALIASES += "sgst{1}=" -ALIASES += "eror{1}=" -ALIASES += "curs{1}=" - -ALIASES += "bold{1}=\1" -ALIASES += "emph{1}=\1" -ALIASES += "undr{1}=\1" -ALIASES += "span{2}=\2" -ALIASES += "spcl{2}=\2" +ALIASES = "key{1}=\1" +ALIASES += "key{2}=\1-\2" +ALIASES += "key{3}=\1-\2" +ALIASES += "cursor_key{2}=\1" + +ALIASES += "fish=\htmlonly[block] \n
"
+ALIASES += "fish{1}=\htmlonly[block] \n
"
+ALIASES += "endfish=
\endhtmlonly \n" + +ALIASES += "asis{1}=\1" +ALIASES += "outp{1}=\1" +ALIASES += "blah{1}=#\1" +ALIASES += "cmnd{1}=\1" +ALIASES += "func{1}=\1" +ALIASES += "sbin{1}=\1" +ALIASES += "args{1}=\1" +ALIASES += "opts{1}=\1" +ALIASES += "vars{1}=\1" +ALIASES += "optr{1}=\1" +ALIASES += "redr{1}=\1" +ALIASES += "fsfo{1}=\1" +ALIASES += "path{1}=\1" +ALIASES += "clrv{1}=\1" + +ALIASES += "strg{1}=\1" +ALIASES += "sglq{1}='\1'" +ALIASES += "dblq{1}=\"\1\"" + +ALIASES += "prmt=>" +ALIASES += "prmt{1}=\1>" +ALIASES += "sgst{1}=\1" +ALIASES += "mtch{1}=\1" +ALIASES += "smtc{1}=\1" +ALIASES += "eror{1}=\1" +ALIASES += "curs= " +ALIASES += "curs{1}=\1" + +ALIASES += "bold{1}=\1" +ALIASES += "emph{1}=\1" +ALIASES += "undr{1}=\1" +ALIASES += "span{2}=\2" +ALIASES += "spcl{2}=\2" # 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" diff --git a/Makefile.in b/Makefile.in index cd1c5738..afcba3c9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -259,8 +259,8 @@ prof: all # The sed command deletes everything including and after the first -, for simpler version numbers # Cleans up the user_doc/html directory once Doxygen is done. -user_doc: $(HDR_FILES_SRC) Doxyfile.user $(HTML_SRC) $(HELP_SRC) doc.h $(HDR_FILES) doc_src/fish_lexicon_filter - (cat Doxyfile.user; echo INPUT_FILTER=doc_src/fish_lexicon_filter; \ +user_doc: $(HDR_FILES_SRC) Doxyfile.user $(HTML_SRC) $(HELP_SRC) doc.h $(HDR_FILES) lexicon_filter + (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 @@ -276,8 +276,8 @@ doc_src/user_doc.css: doc_src/user_doc.css.in doc_src/fish_lexicon_filter # Source code documentation. Also includes user documentation. # -doc: *.h *.cpp doc.h Doxyfile - (cat Doxyfile; echo PROJECT_NUMBER=$(FISH_BUILD_VERSION)) | doxygen - ; +doc: *.h *.cpp doc.h Doxyfile lexicon_filter + (cat Doxyfile; echo INPUT_FILTER=./lexicon_filter; echo PROJECT_NUMBER=$(FISH_BUILD_VERSION)) | doxygen - ; # @@ -368,6 +368,7 @@ lexicon.txt: doc_src/commands.hdr $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES -e "s|'\(.*\)'|func \1|p"; \ sed >lexicon.tmp -n \ -e '/set_default/s/.*\(fish_[a-z][a-z_]*\).*$$/clrv \1/p'; \ + echo "sbin whoami\nsbin mkdir\nsbin basename" >> lexicon.tmp; \ mv lexicon.tmp lexicon.txt; rm -f lexicon_catalog.tmp lexicon_catalog.txt; # @@ -381,14 +382,19 @@ lexicon.txt: doc_src/commands.hdr $(FUNCTIONS_DIR_FILES) $(COMPLETIONS_DIR_FILES # providing suitable CSS in user_doc.css.in # -doc_src/fish_lexicon_filter: lexicon.txt doc_src/fish_lexicon_filter.in +lexicon_filter: lexicon.txt lexicon_filter.in -rm $@.tmp $@ # Clean the filter input comments and set the shebang as sed can reside in # /bin or /usr/bin and some versions dont allow more than one comment!. - sed <$@.in >$@.tmp -e 's|@sed@|'"`command -v sed`"'|' -e '/^[ ]*#[^!]/d' + sed <$@.in >$@.tmp -e 's|@sed@|'"`which sed`"'|' -e '/^[ ]*#[^!]/d' # Scan through the lexicon, transforming each line to something useful to Doxygen. + if `echo "x" | sed "/[[:<:]]x/d"`; then \ + WORDBL='[[:<:]]'; WORDBR='[[:>:]]'; \ + else\ + WORDBL='\\<'; WORDBR='\\>'; \ + fi; \ sed >$@.tmp -n \ - -e 's|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,[[:<:]]\2[[:>:]],@\1{\2},g|p' \ + -e "s|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,$$WORDBL\2$$WORDBR,@\1{\2},g|p" \ -e '$$G;s/.*\n/b tidy/p'; \ mv $@.tmp $@; if test -x $@; then true; else chmod a+x $@; fi @@ -493,11 +499,11 @@ common.o: $(COMMON_FILES) # There ought to be something simpler. # -share/man: $(HELP_SRC) doc_src/fish_lexicon_filter +share/man: $(HELP_SRC) lexicon_filter -mkdir share/man touch share/man -rm -Rf share/man/man1 - PROJECT_NUMBER=`echo $(FISH_BUILD_VERSION)| sed "s/-.*//"` INPUT_FILTER=doc_src/fish_lexicon_filter \ + PROJECT_NUMBER=`echo $(FISH_BUILD_VERSION)| sed "s/-.*//"` INPUT_FILTER=./lexicon_filter \ ./build_tools/build_documentation.sh Doxyfile.help ./doc_src ./share # @@ -812,7 +818,7 @@ clean: rm -f $(PROGRAMS) fish_tests key_reader rm -f command_list.txt command_list_toc.txt toc.txt rm -f doc_src/index.hdr doc_src/commands.hdr - rm -f doc_src/fish_lexicon_filter lexicon.txt debug-lexicon.log + rm -f lexicon_filter lexicon.txt lexicon.log rm -f FISH-BUILD-VERSION-FILE if test "$(HAVE_DOXYGEN)" = 1; then \ rm -rf doc user_doc share/man; \ diff --git a/doc_src/alias.txt b/doc_src/alias.txt index c1450cc4..079cabff 100644 --- a/doc_src/alias.txt +++ b/doc_src/alias.txt @@ -23,11 +23,9 @@ The following code will create `rmi`, which runs `rm` with additional arguments \fish alias rmi "rm -i" -\endfish -This is equivalent to entering the following function: +# This is equivalent to entering the following function: -\fish function rmi rm -i $argv end diff --git a/doc_src/commands.hdr.in b/doc_src/commands.hdr.in index 12269b2b..fb9ebefa 100644 --- a/doc_src/commands.hdr.in +++ b/doc_src/commands.hdr.in @@ -1,5 +1,5 @@ -/** \page commands Commands - +/** +\page commands Commands \htmlonly[block]