Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Doxygen for shell scripts
- X-seq: zsh-users 22895
- From: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@xxxxxxxxx>
- To: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Doxygen for shell scripts
- Date: Mon, 11 Sep 2017 23:37:17 +0300
- Authentication-results: mxback8o.mail.yandex.net; dkim=pass header.i=@yandex.ru
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1505162237; bh=DIHhgahyivQqFyHLFtdeti6EGDu+vaDGDiiXFlo7An0=; h=From:To:In-Reply-To:References:Subject:Message-Id:Date; b=w7ZjGQvtTSOkInSIxyu3iwM4vCk8srF6P5+lg1NVDmucqWkzb20yE2jKPeyH+RKO2 xYGRyNZKlPjK+iRpXcNVfYgSatSoW+tz6bkFxJeiZKcR5L6jdJr+1yxoNgOv4/6wP9 yWDjFFMQBE35gYmET7TyIEFnwzAJh3uI9u4uw5NI=
- In-reply-to: <etPan.59b67e51.5b90a6d4.134@zdharma.org>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <etPan.59b4e3ca.42b18817.134@zdharma.org> <2669581505036634@web1j.yandex.ru> <etPan.59b67e51.5b90a6d4.134@zdharma.org>
11.09.2017, 15:15, "Sebastian Gniazdowski" <psprint@xxxxxxxxxxx>:
> On 10.09.2017 at 11:43:54, Nikolay Aleksandrovich Pavlov (ZyX) (kp-pav@xxxxxxxxx) 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author