Merge changes from svn/asterisk/team/russell/LaTeX_docs.

* Convert most of the doc directory into a single LaTeX formatted document
  so that we can generate a PDF, HTML, or other formats from this
  information.
* Add a CLI command to dump the application documentation into LaTeX format
  which will only be include if the configure script is run with 
  --enable-dev-mode.
* The PDF turned out to be close to 1 MB, so it is not included.  However, you
  can simply run "make asterisk.pdf" to generate it yourself.  We may include
  it in release tarballs or have automatically generated ones on the web site,
  but that has yet to be decided.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-03-15 22:25:12 +00:00
parent 6548086af0
commit c474809cdf
60 changed files with 5325 additions and 2739 deletions

View File

@@ -3202,6 +3202,56 @@ static int handle_show_application(int fd, int argc, char *argv[])
return RESULT_SUCCESS;
}
#ifdef AST_DEVMODE
static char core_dumpappdocs_help[] =
"Usage: core dumpappdocs [application]\n"
" Dump Application documentation to \\tmp\\ast_appdocs.tex.\n";
static int handle_core_dumpappdocs(int fd, int argc, char *argv[])
{
struct ast_app *app;
FILE *f;
char *appname = NULL;
const char *fn = "/tmp/ast_appdocs.tex";
if (argc > 3)
appname = argv[3];
if (!(f = fopen(fn, "w+"))) {
ast_cli(fd, "Unable to open %s for writing!\n", fn);
return RESULT_FAILURE;
}
fprintf(f, "%% This file is automatically generated. Any manual edits will be lost.\n");
AST_LIST_LOCK(&apps);
AST_LIST_TRAVERSE(&apps, app, list) {
if (appname && strcasecmp(app->name, appname))
continue;
fprintf(f, "\\section{%s}\n"
"\\subsection{Synopsis}\n"
"\\begin{verbatim}\n"
"%s\n"
"\\end{verbatim}\n"
"\\subsection{Description}\n"
"\\begin{verbatim}\n"
"%s\n"
"\\end{verbatim}\n\n\n", app->name, app->synopsis, app->description);
if (appname)
break;
}
AST_LIST_UNLOCK(&apps);
fclose(f);
ast_cli(fd, "Documentation has been dumped to %s\n", fn);
return RESULT_SUCCESS;
}
#endif
/*! \brief handle_show_hints: CLI support for listing registred dial plan hints */
static int handle_show_hints(int fd, int argc, char *argv[])
{
@@ -3788,6 +3838,12 @@ static struct ast_cli_entry pbx_cli[] = {
handle_show_application, "Describe a specific dialplan application",
show_application_help, complete_show_application, &cli_show_application_deprecated },
#ifdef AST_DEVMODE
{ { "core", "dumpappdocs", NULL },
handle_core_dumpappdocs, "Dump App docs in LaTeX format",
core_dumpappdocs_help, NULL },
#endif
{ { "core", "set", "global", NULL },
handle_set_global, "Set global dialplan variable",
set_global_help, NULL, &cli_set_global_deprecated },