JavaDoc as an environment for shell scripts?

Is there an open source environment or a public domain that can document shell scripts similar to what JavaDoc produces? I don’t need to limit this to just the specific taste of the shell script, ideally I would like the general documentation for an API or command line commands on a web page that is easy to extend or even better, is a standalone documentation.

+3
source share
4 answers

If you have Perl, here is an example of who used the Perl POD to document the shell script.

The trick is to have the Perl POD section in the bash "Here-Document" right after the null command (no-op) :.

  • Start with : <<=cut
  • Write your service page in POD format
  • What is it. Your POD ends with =cut, which was also defined as the end of the Here-doc shell.

Then your script can be processed with all the usual Perl tools, such as perldoc or perl2html, and you can even create real pages with pod2man.

An example is the podtest.shscript:

#!/bin/dash

echo This is a plain shell script
echo Followed by POD documentation

: <<=cut
=pod
=head1 NAME

   podtest.sh - Example shell script with embedded POD documentation

...

No rights Reserved

=cut

To add this podtest.sh to your man pages:

 pod2man podtest.sh >/usr/local/share/man/man1/podtest.sh.1
+4
source

Although Doxygen does not support bash script files, you can make Doxygen work with bash

, , ronn.

Shocco, , JavaDoc ( ),

+2

Doxygen. C- , JavaDoc, , , , .

0

troff script, C. "Here-Document" Steve, -, troff/pod/rdoc/jdoc.

0

Source: https://habr.com/ru/post/1698524/


All Articles