zsh-users
 help / color / mirror / code / Atom feed
From: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@yandex.ru>
To: Sebastian Gniazdowski <psprint@zdharma.org>,
	Zsh Users <zsh-users@zsh.org>
Subject: Re: Doxygen for shell scripts
Date: Mon, 11 Sep 2017 23:37:17 +0300	[thread overview]
Message-ID: <852431505162237@web27j.yandex.ru> (raw)
In-Reply-To: <etPan.59b67e51.5b90a6d4.134@zdharma.org>



11.09.2017, 15:15, "Sebastian Gniazdowski" <psprint@zdharma.org>:
> On 10.09.2017 at 11:43:54, Nikolay Aleksandrovich Pavlov (ZyX) (kp-pav@yandex.ru) wrote:
>>  Why not a sphinx plugin? It is most logical: you need to teach it how to extract documentation
>>  comments and whatever those “more things” you want and it takes the job of yielding nicely
>>  formatted documentation in many different formats (one of which includes man pages),
>
> There's a problem with this route – zsd uses (z) flag, which apparently exposes the original parser used by Zsh. So it's easy to parse and this is robust, because the parser has enough attention from developers. With Sphinx I would have to write own parser in Python.

No, you don’t, there is no requirement to not call external applications during documentation build process. You may have to invoke zsh which will do some parsing and serialize the result for Python which will do most of the job for creating documentation.

> This is for sure doable, especially because shell syntax has multiple simplifications (like: require space after [[ in condition [[ ... ]]), but AFAIK nobody has done this yet, so no resources, examples, etc. I think many people had this idea, to write doxygen-like tool or something similar for shell scripts, but everybody stepped down because of the parser effort and doubts if shell scripts are sophisticated enough to address them. Zsh plugins are often sophisticated so maybe ZSD will be used, and (z) flag solves the effort-problem, even for Bash – just tried to run ZSD on an old 550-line Bash script with 9 functions (it implements youtube-dl queue, for slow networks), and it worked.
>
> --
> Sebastian Gniazdowski
> psprint /at/ zdharma.org


      reply	other threads:[~2017-09-11 20:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-10  7:03 Sebastian Gniazdowski
2017-09-10  9:43 ` Nikolay Aleksandrovich Pavlov (ZyX)
2017-09-11 12:15   ` Sebastian Gniazdowski
2017-09-11 20:37     ` Nikolay Aleksandrovich Pavlov (ZyX) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=852431505162237@web27j.yandex.ru \
    --to=kp-pav@yandex.ru \
    --cc=psprint@zdharma.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).