From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16589 invoked from network); 25 Apr 2021 15:07:13 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Apr 2021 15:07:13 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619363233; b=H6L+Dl0aMSaA9epMJskzGzcTKB9arB9WrS16sM5MLiCfflj0RJDazD+jBgzghLRi0FoUPpUzMi zHDlHbiuAvJxJh9GKp6/2hMBAM+ED8r4ra7Q8Jxs9EMHyiRhO5TazrIeiGjAVYRcJ248EJEB4o lo3OEBAKDHn0whMtEwtV1nsEyUYKpJFQJ8xRWzqd4qNQ93iXvQKJ7VE1FdSpTId1HZ09Mx0LwY IW484Iow1jZaAruFUi2/tNflupyPTXSIzr9tp5B+j9JCIfY7ZQruxkHyaOx86p/7Wn9H5n/8H/ YFejiB1rE3+UjsROa7Yhp9WrJ5tusN11VjV2w3qrVWG+dA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd01003-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.19; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1619363233; bh=PNucddxGRisAAgx1SFFm5IBMExKoFM1/oJdhfzu+nMM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:Date:Message-ID:Subject:MIME-Version: Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=t7kIUCy/mzs4HGrPj3uw9wX7aBJTredgGEAFBUpGqn3AhJ7GUGxntRrI4H5PJ6AdN7c46EvZuv sg+XU7F4NuiS9kN18+xAYln3Yi6/UBw7+c5mrwynre4t0RhEKJkrvV4oYsevKns+i5O9YMcxV6 gb9CzHrypAy4wTmlC/2YjDo09gWBrYfpeozcd7+TJ35y8Ih5WNRveA44RK1X3jm6NI2tUWciou 8aZXLErofQuui6kzIIxSUWQYhxEWcSTZzjJsTatZql3V3cbY7iYZMrtMcy9o1iUVYcbNYbuCSh 157JXW3kkbz5O56bURFs2vtpNLT7aYSipuc+Ld9FutuJCQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:To:Date:Message-Id:Subject: Mime-Version:Content-Transfer-Encoding:Content-Type:From:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=7fPe1Ei1ezASNdED9gfc661ZLMmQkWbU7+g+LP/xTK4=; b=CcASzaOpOxWl6BCWCCZBttkZo0 RKHkZpziG8ZgftO0fUr6eM2g6LGba5GU6mvtiamIPRA3UDAjM+DrXFC3bVBrLvZMjAvsqgPMkn9zG LSAdoLPA8OwYd9/624EBnlPoaor7X07Q6Uydh2OtVvq7Ckfe/g+Dexb/IEDUmPFX0KDkW+l5y9fKY nPJJR2lsk2nQt2AevlIQam6lpbVdb806wAEssXSGYl0jbvAxWNnHLuDC0hIKEwY6croGAlqx/RDqW fU3haSDSVkPnpxMK63dzlZHXw7InWrdBYgpHc65lq5dN9b3sgDM5RITcaSVjRyJtGgb1IN/LMC2MX CEC2nvcA==; Received: from authenticated user by zero.zsh.org with local id 1lagLo-000Cka-Ia; Sun, 25 Apr 2021 15:07:12 +0000 Authentication-Results: zsh.org; iprev=pass (snd01003-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.19; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd01003-bg.im.kddi.ne.jp ([27.86.113.19]:26945 helo=omta1014.biglobe.ne.jp) by zero.zsh.org with esmtp id 1lagK7-000Be4-Qk; Sun, 25 Apr 2021 15:05:28 +0000 Received: from mail.biglobe.ne.jp by omta1014.biglobe.ne.jp with ESMTP id <20210425150525155.OVZL.101956.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Mon, 26 Apr 2021 00:05:25 +0900 From: "Jun. T" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: [PATCH 2/2] _pandoc: various simple fixes and updates Message-Id: Date: Mon, 26 Apr 2021 00:05:24 +0900 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3445.104.17) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 48704 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: [5] Since option -s does not take argument, pandoc -s should offer input file name, but currently nothing is offered. This is due to an error in optspec '-s[....]: : ' ---> should be '-s[...]' There are many errors of this type. [6] Add + to single letter option that take an argument: -o[...] ---> -o+[...] [7] Removed old options, add several new options. --- Completion/Unix/Command/_pandoc | 120 ++++++++++++++++---------------- 1 file changed, 59 insertions(+), 61 deletions(-) diff --git a/Completion/Unix/Command/_pandoc = b/Completion/Unix/Command/_pandoc index 97f1190be..2ff481e32 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -30,8 +30,8 @@ _pandoc_all_formats(){ (( $+functions[_pandoc_pdf_engine] )) || _pandoc_pdf_engine(){ _alternative \ - 'engines:engine:{_values "engine" pdflatex lualatex xelatex = wkhtmltopdf weasyprint prince context pdfroff}' \ - 'engine_files:engine:_files' + 'engines:engine:(pdflatex lualatex xelatex latexmk tectonic = wkhtmltopdf weasyprint prince context pdfroff)' \ + 'engine-executables:engine executable:_files -g "*(#q*)"' } # }}} # {{{ options to pass to --pdf-engine command @@ -43,10 +43,7 @@ _pandoc_pdf_engine_opts(){ _tex ;; *) - type _${pdf_engine} > /dev/null - if [[ $? =3D=3D 1 ]]; then - _message "Options for ${pdf_engine}" - fi + _message "Options for ${pdf_engine}" ;; esac } @@ -104,6 +101,15 @@ _pandoc_lua_filter(){ 'data-dir-filters:filter in data-dir:_files -W filters_dir -g = "*.lua"' } # }}} +# {{{ default file in $PWD or data-dir/defaults/ +(( $+functions[_pandoc_defaults_file] )) || +_pandoc_defaults_file() { + local defaults_dir=3D$(_pandoc_default_dir)/defaults + _alternative \ + 'local-defaults:default file:_files -g "*.yaml"' \ + 'data-dir-defaults:default in data-dir:_files -W defaults_dir -g = "*.yaml"' +} +# }}} # {{{ choose reference location (( $+functions[_pandoc_reference_location] )) || _pandoc_reference_location(){ @@ -116,23 +122,12 @@ _pandoc_reference_location(){ _describe 'location' policies } # }}} -# --base-header-level must be 1-5: = https://github.com/jgm/pandoc/blob/34d8ffbcfc33b86766ff7229be4d8a0d1fbffb5= 0/src/Text/Pandoc/App.hs#L867 # {{{ choose top level division (( $+functions[_pandoc_top_level_division] )) || _pandoc_top_level_division(){ _values 'top level division' default section chapter part } # }}} -# {{{ choose header levels -(( $+functions[_pandoc_header_levels] )) || -_pandoc_header_levels(){ - _values -s , "number" 1 2 3 4 5 6 -} -(( $+functions[_pandoc_header_level] )) || -_pandoc_header_level(){ - _values "number" 1 2 3 4 5 6 -} -# }}} # {{{ choose email obfusication (( $+functions[_pandoc_email_obfusication] )) || _pandoc_email_obfusication(){ @@ -186,64 +181,71 @@ _pandoc_track_changes() { _arguments -s \ {-f+,-r+,--from=3D,--read=3D}'[specify input format]: :_pandoc_format = -T input' \ {-t+,-w+,--to=3D,--write=3D}'[specify output format]: :_pandoc_format = -T output' \ - {-o,--output=3D}'[write output to FILE instead of = stdout]:file:_files' \ + {-o+,--output=3D}'[write output to FILE instead of = stdout]:file:_files' \ '--data-dir=3D[specify the user data directory to search for pandoc = data files]:data directory:_files -/' \ - '--base-header-level=3D[specify the base level for headers (defaults = to 1)]:number:_pandoc_header_level' \ - '--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs = extension instead]: :' \ + {-d+,--defauls=3D}'[read default from YAMAL file]: = :_pandoc_defaults_file' \ + '--shift-heading-level-by=3D[shift heading levels by specified = number]:positive or negative integer: ' \ + '!--base-header-level=3D[(deprecated) specify the base level for = headers]:number (default 1):(1 2 3 4 5)' \ + '!--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs = extension instead]' \ '--indented-code-classes=3D[classes to use for indented code = blocks]:class:{_message "Classes separated with ,"}' \ - '*--filter=3D[specify an executable to be used as a filter = transforming the pandoc AST after the input is parsed and before the = output is written]:file:_pandoc_filter' \ - '*--lua-filter=3D[transform the document in a similar fashion as JSON = filters (see --filter), but use pandoc'"'"'s built-in lua filtering = system]:file:_pandoc_lua_filter' \ - {-p,--preserve-tabs}'[preserve tabs instead of converting them to = spaces]: :' \ + '--default-image-extension=3D[specify a default extension to use when = image paths/URLs have no extension]:extension: ' \ + '--file-scope[parse each file individually before combining for = multifile documents]' \ + {\*-F+,\*--filter=3D}'[specify an executable to be used as a filter = transforming the pandoc AST after the input is parsed and before the = output is written]: :_pandoc_filter' \ + {\*-L+,\*--lua-filter=3D}"[transform the document by using pandoc's = built-in lua filtering system]: :_pandoc_lua_filter" \ + {\*-M+,\*--metadata=3D}'[set the metadata field KEY to the value = VALUE]:key\:value: ' \ + '*--metadata_file=3D[read metadata from file]:YAML or JSON = file:_files' \ + {-p,--preserve-tabs}'[preserve tabs instead of converting them to = spaces]' \ '--tab-stop=3D[specify the number of spaces per tab (default is = 4)]:number:{_message -r "choose a number equals to or greater then 1"}' = \ '--track-changes=3D[specifies what to do with insertions, deletions, = and comments produced by the MS Word "Track Changes" feature]: = :_pandoc_track_changes' \ - '--file-scope[parse each file individually before combining for = multifile documents]: :' \ - '--extract-media=3D[extract images and other media contained in or = linked from the source document to the path DIR]:dir:{_dir_list}' \ - {-s,--standalone}'[produce output with an appropriate header and = footer]: :' \ + '--extract-media=3D[extract media in source document to specified = directory]:directory:_files -/' \ + '--abbreviations=3D[specifies a custom abbreviations = file]:file:_files ' \ + {-s,--standalone}'[produce output with an appropriate header and = footer]' \ '--template=3D[use FILE as a custom template for the generated = document. Implies --standalone]: :_pandoc_template' \ - {\*-M,\*--metadata=3D}'[set the metadata field KEY to the value = VALUE]:key\:value: ' \ - {\*-V,\*--variable=3D}'[set the variable KEY to the value = VALUE]:key\:value: ' \ - '(- :)'{-D+,--print-default-template=3D}"[print the system default = template for an output]:format:( $(pandoc --list-output-formats) )" \ + {\*-V+,\*--variable=3D}'[set the variable KEY to the value = VALUE]:key\:value: ' \ + '(- :)'{-D+,--print-default-template=3D}'[print the system default = template for an output]:format:( $(pandoc --list-output-formats) )' \ '(- :)--print-default-data-file=3D[print a system default data = file]:file: ' \ - '(- :)--print-highlight-style=3D[prints a JSON version of a = highlighting style]:style|file: ' \ - '--dpi=3D[specify the dpi (dots per inch) value for conversion from = pixels to inch/centimeters and vice versa]:number: ' \ '--eol=3D[manually specify line endings (crlf|lf|native)]: = :_pandoc_eol' \ + '--dpi=3D[specify the dpi (dots per inch) value for conversion from = pixels to inch/centimeters and vice versa]:number: ' \ '--wrap=3D[determine how text is wrapped in the output (the source = code, not the rendered version)]: :_pandoc_wrap ' \ '--columns=3D[specify length of lines in characters (default = 72)]:number: ' \ - '--strip-comments[strip out HTML comments in the Markdown or Textile = source]: : ' \ - {--toc,--table-of-contents}'[include an automatically generated table = of contents]: : ' \ + {--toc,--table-of-contents}'[include an automatically generated table = of contents]' \ '--toc-depth=3D[specify the number of section levels to include in = the table of contents]:number:{_message -r "choose a number equals to or = greater then 1"}' \ - '--no-highlight[disables syntax highlighting for code blocks and = inlines]: : ' \ + '--strip-comments[strip out HTML comments in the Markdown or Textile = source]' \ + '--no-highlight[disables syntax highlighting for code blocks and = inlines]' \ '--highlight-style=3D[specifies the coloring style to be used in = highlighted source code]:style|file:_pandoc_highlight_style' \ + '(- :)--print-highlight-style=3D[prints a JSON version of a = highlighting style]: :_pandoc_highlight_style' \ '--syntax-definition=3D[load a KDE XML syntax definition = file]:file:{_files -g "*.xml"}' \ - {\*-H,\*--include-in-header=3D}'[include contents of FILE, verbatim, = at the end of the header, implies --standalone]:file:_files' \ - {\*-B,\*--include-before-body=3D}'[include contents of FILE, = verbatim, at the beginning of the document body, implies = --standalone]:file:_files' \ - {\*-A,\*--include-end-body=3D}'[include contents of FILE, verbatim, = at the end of the document body, implies --standalone]:file:_files' \ + {\*-H+,\*--include-in-header=3D}'[include contents of FILE, verbatim, = at the end of the header, implies --standalone]:file:_files' \ + {\*-B+,\*--include-before-body=3D}'[include contents of FILE, = verbatim, at the beginning of the document body, implies = --standalone]:file:_files' \ + {\*-A+,\*--include-end-body=3D}'[include contents of FILE, verbatim, = at the end of the document body, implies --standalone]:file:_files' \ '--resource-path=3D[list of paths to search for images and other = resources]:searchpath:_dir_list' \ '--request-header=3D[set the request header NAME to the value VAL = when making HTTP requests]:name\:val: ' \ - '--self-contained[produce a standalone HTML file with no external = dependencies, using data: URIs to incorporate the contents of linked = scripts, stylesheets, images, and videos. Implies --standalone]: : ' \ - '--html-q-tags[use tags for quotes in HTML]: : ' \ - '--ascii[use only ASCII characters in output, supported only for HTML = and DocBook output]: : ' \ - '--reference-links[use reference-style links, rather than inline = links]: : ' \ + '--no-check-certificate[disable the certificate verification]' \ + '--self-contained[produce a standalone HTML file with no external = dependencies, using data: URIs to incorporate the contents of linked = scripts, stylesheets, images, and videos. Implies --standalone]' \ + '--html-q-tags[use tags for quotes in HTML]' \ + '--ascii[use only ASCII characters in output, supported only for HTML = and DocBook output]' \ + '--reference-links[use reference-style links, rather than inline = links]' \ '--reference-location=3D[specify where footnotes (and references, if = reference-links is set) are placed (block|section|document)]: = :_pandoc_reference_location' \ - '--atx-headers[use ATX-style headers in Markdown and AsciiDoc = output]: : ' \ + '--markdown-headings[specify style for level1 and 2 headings in = markdown output]:style (default atx):(setext atx)' \ + '!--atx-headers[use ATX-style headers in Markdown and AsciiDoc = output]' \ '--top-level-division=3D[treat top-level headers as the given = division type in LaTeX, ConTeXt, DocBook, and TEI output]: = :_pandoc_top_level_division' \ - {-N,--number-sections}'[number section headings in LaTeX, ConTeXt, = HTML, or EPUB output]: : ' \ - '--number-offset=3D[offset for section headings in HTML output = (ignored in other output formats)]: :_pandoc_header_levels' \ - '--listings[use the listings package for LaTeX code blocks]: : ' \ - {-i,--incremental}'[make list items in slide shows display = incrementally (one by one)]: : ' \ - '--slide-level=3D[specifies that headers with the specified level = create slides (for beamer, s5, slidy, slideous, dzslides)]: = :_pandoc_header_levels' \ - '--section-divs[wrap sections in
tags (or
tags for = html4)Use the section-divs package for LaTeX code blocks]: : ' \ + {-N,--number-sections}'[number section headings in LaTeX, ConTeXt, = HTML, or EPUB output]' \ + '--number-offset=3D[offset for section headings in HTML output = (ignored in other output formats)]:number[number,...] (default 0): ' \ + '--listings[use the listings package for LaTeX code blocks]' \ + {-i,--incremental}'[make list items in slide shows display = incrementally (one by one)]' \ + '--slide-level=3D[specifies that headers with the specified level = create slides (for beamer, s5, slidy, slideous, dzslides)]:slide = level:(1 2 3 4 5 6)' \ + '--section-divs[wrap sections in
tags (or
tags for = html4)Use the section-divs package for LaTeX code blocks]' \ '--email-obfusication=3D[treat top-level headers as the given = division type in LaTeX, ConTeXt, DocBook, and TEI output = (none|javascript|references)]: :_pandoc_email_obfusication' \ - '--default-image-extension=3D[specify a default extension to use when = image paths/URLs have no extension]:extension: ' \ '--id-prefix=3D[specify a prefix to be added to all identifiers and = internal links in HTML and DocBook output]:string: ' \ - {-T,--title-prefix=3D}'[specify STRING as a prefix at the beginning = of the title that appears in the HTML header]:string: ' \ - {\*-c,\*--css=3D}'[link to a CSS style sheet]:url: ' \ + {-T+,--title-prefix=3D}'[specify STRING as a prefix at the beginning = of the title that appears in the HTML header]:string: ' \ + {\*-c+,\*--css=3D}'[link to a CSS style sheet]: :_urls' \ '--reference-doc=3D[use the specified file as a style reference in = producing a docx or ODT file]:file: ' \ - '--epub-subdirectory=3D[specify the subdirectory in the OCF container = that is to hold the EPUB-specific contents]:dir:{_files -/}' \ + '--epub-subdirectory=3D[specify the subdirectory in the OCF container = that is to hold the EPUB-specific contents]:directory:_files -/' \ '--epub-cover-image=3D[use the specified image as the EPUB = cover]:file:_files' \ '--epub-metadata=3D[look in the specified XML file for metadata for = the EPUB]:file:{_files -g "*.xml"}' \ '*--epub-embed-font=3D[embed the specified font in the = EPUB]:file:_files ' \ - '--epub-chapter-level=3D[specify the header level at which to split = the EPUB into separate "chapter" files]:number:_pandoc_header_level' \ + '--epub-chapter-level=3D[specify the header level at which to split = the EPUB into separate "chapter" files]:number:(1 2 3 4 5 6)' \ + '--ipynb-output=3D[specify how to tread ipynb output = cells]:method:(all none best)' \ '--pdf-engine=3D[use the specified engine when producing PDF = output]:program:_pandoc_pdf_engine' \ '*--pdf-engine-opt=3D[use the given string as a command-line argument = to the pdf-engine]:string:_pandoc_pdf_engine_opts' \ '*--bibliography=3D[set the bibliography field in the document'"'"'s = metadata to FILE]:file:{_files -g = "*.(bib|bibtex|copac|json|yaml|enl|xml|wos|medline|mods|ris)"}' \ @@ -252,14 +254,10 @@ _arguments -s \ '--natbib[use natbib for citations in LaTeX output]' \ '--biblatex[use biblatex for citations in LaTeX output]' \ '--mathml[convert TeX math to MathML (in epub3, docbook4, docbook5, = jats, html4 and html5)]' \ - '--webtex=3D[convert TeX formulas to tags that link to an = external script that converts formulas to images]::url: ' \ - '--mathjax=3D[use MathJax to display embedded TeX math in HTML = output]::url: ' \ - '--katex=3D[use KaTeX to display embedded TeX math in HTML = output]::url: ' \ - {-m,--latexmathml=3D,--asciimathml=3D}'[deprecated. Use the = LaTeXMathML script to display embedded TeX math in HTML output]::url: ' = \ - '--mimetex=3D[deprecated. Render TeX math using the mimeTeX CGI = script, which generates an image for each TeX formula]::url: ' \ - '--jsmath=3D[deprecated. Use jsMath (the predecessor of MathJax) to = display embedded TeX math in HTML output]::url: ' \ - '--gladtex[deprecated. Enclose TeX math in tags in HTML output]: = : ' \ - '--abbreviations=3D[specifies a custom abbreviations = file]:file:_files ' \ + '--webtex=3D[convert TeX formulas to tags that link to an = external script that converts formulas to images]:: :_urls' \ + '--mathjax=3D[use MathJax to display embedded TeX math in HTML = output]:: :_urls' \ + '--katex=3D[use KaTeX to display embedded TeX math in HTML output]:: = :_urls' \ + '--gladtex[Enclose TeX math in tags in HTML output]' \ '--trace[enable tracing]' \ '--dump-args[print information about command-line arguments to = stdout, then exit]' \ '--ignore-args[ignore command-line arguments (for use in wrapper = scripts)]' \ --=20 2.21.1 (Apple Git-122.3)