Permalink
Browse files

Generating documentation now

  • Loading branch information...
1 parent 38873e1 commit 8fa6eb3bee5e1a5bfcb8e661cfaf1d2a7b010e7e @hintjens committed Mar 24, 2011
Showing with 1,304 additions and 219 deletions.
  1. +1 −0 .gitignore
  2. +11 −0 NEWS
  3. +1 −1 configure.in
  4. +1 −0 doc/Makefile.am
  5. +20 −0 doc/_template.wd
  6. +99 −0 doc/mkman
  7. +68 −0 doc/mksite
  8. +43 −0 doc/wdput
  9. +228 −0 doc/xml2wd.pl
  10. +5 −3 doc/zapi.txt
  11. +6 −1 doc/zclock.txt
  12. +7 −0 doc/zctx.txt
  13. +55 −0 doc/zframe.txt
  14. +100 −6 doc/zhash.txt
  15. +82 −3 doc/zlist.txt
  16. +35 −0 doc/zloop.txt
  17. +114 −0 doc/zmsg.txt
  18. +33 −0 doc/zstr.txt
  19. +6 −2 include/zclock.h
  20. +9 −0 include/zctx.h
  21. +17 −0 include/zframe.h
  22. +27 −6 include/zhash.h
  23. +26 −3 include/zlist.h
  24. +17 −0 include/zloop.h
  25. +37 −0 include/zmsg.h
  26. +9 −0 include/zstr.h
  27. +14 −0 mkdoc
  28. +5 −5 src/zclock.c
  29. +103 −100 src/zctx.c
  30. +12 −2 src/zframe.c
  31. +57 −56 src/zhash.c
  32. +29 −28 src/zlist.c
  33. +9 −1 src/zloop.c
  34. +8 −1 src/zmsg.c
  35. +10 −1 src/zstr.c
View
@@ -23,6 +23,7 @@ src/mtrace.txt
src/outbin
src/zapi_selftest
doc/*.7
+doc/*.xml
src/.libs/
src/libzapi.la
src/platform.h
View
@@ -1,3 +1,14 @@
+zapi version 1.2.0 (beta), released on 2011/03/24
+=================================================
+
+Changes
+-------
+
+* Added zclock class for portable millisecond timers and delays.
+
+* Expanded documentation significantly.
+
+
zapi version 1.1.0 (beta), released on 2011/03/23
=================================================
View
@@ -6,7 +6,7 @@ AC_PREREQ(2.61)
# The version in git should reflect the *next* version planned.
# Version must be MAJOR.MINOR.PATCH otherwise things will break.
#
-AC_INIT([zapi],[1.1.1],[zeromq-dev@lists.zeromq.org])
+AC_INIT([zapi],[1.2.0],[zeromq-dev@lists.zeromq.org])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
View
@@ -29,6 +29,7 @@ if BUILD_DOC
SUFFIXES=.txt .xml .1 .3 .7
.txt.xml:
+ ./mkman $<
asciidoc -d manpage -b docbook -f asciidoc.conf \
-azapi_version=@PACKAGE_VERSION@ $<
.xml.1:
View
@@ -0,0 +1,20 @@
+[!-- live template used for API pages --]
+
+[[module CSS]]
+.foldedtoc #toc #toc-action-bar {
+ display: none
+}
+.foldedtoc #toc .title{
+ display: none;
+ border: 0px solid black;
+}
+.foldedtoc #toc {
+ border: 0px solid black;
+ margin: 0 0 0 -0,9em;
+}
+.foldedtoc .collapsible-block-link {
+ text-decoration:none
+}
+[[/module]]
+[[include include:print-css]]
+%%content%%
View
@@ -0,0 +1,99 @@
+#! /usr/bin/perl
+#
+# mkman - Generates man pages from C source and header files.
+#
+# Syntax: 'mkman classname', in doc subdirectory.
+#
+# Copyright (c) 1996-2011 iMatix Corporation
+#
+# This is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# This software is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABIL-
+# ITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+use File::Basename;
+
+$class = $ARGV [0];
+$class = $1 if $class =~ /(\w+)\.\w+/;
+
+# Look for class title in 2nd line of source
+# If there's no class file, leave hand-written man page alone
+exit unless open (SOURCE, "../src/$class.c");
+$_ = <SOURCE>;
+$_ = <SOURCE>;
+$title = "no title found";
+$title = $1 if (/ \w+ - (.*)/);
+close (SOURCE);
+
+# Open output file
+die "Can't create $class.txt: $!"
+ unless open (OUTPUT, ">$class.txt");
+
+printf "Generating $class.txt...\n";
+
+
+$template = <<"END";
+$class(7)
+=========
+
+NAME
+----
+$class - $title
+
+SYNOPSIS
+--------
+----
+pull ../include/$class.h\@interface
+----
+
+DESCRIPTION
+-----------
+
+pull ../src/$class.c\@header,left
+
+pull ../src/$class.c\@discuss,left
+
+EXAMPLE
+-------
+.From $class\_test method
+----
+pull ../src/$class.c\@selftest
+----
+
+SEE ALSO
+--------
+linkzapi:zapi[7]
+END
+
+# Now process template
+for (split /^/, $template) {
+ if (/^pull (.*)(@[a-zA-Z0-9]+)(,(.*)\s*)?/) {
+ $source = $1;
+ $tag = $2;
+ $opts = $4;
+ die "Can't read $source: $!"
+ unless open (SOURCE, $source);
+ while (<SOURCE>) {
+ if (/$tag/) {
+ while (<SOURCE>) {
+ last if /@[a-zA-Z0-9]+/;
+ $_ = " $_" if ($opts eq "code");
+ s/^ // if ($opts eq "left");
+ print OUTPUT $_;
+ }
+ }
+ }
+ close (SOURCE);
+ }
+ else {
+ print OUTPUT $_;
+ }
+}
View
@@ -0,0 +1,68 @@
+#! /bin/bash
+#
+# mksite - Upload zapi manual to zapi.zeromq.org/manual:
+#
+# Author: Pieter Hintjens <ph@imatix.com>
+# License: public domain
+#
+# syntax: mksite
+#
+
+# Export so child scripts can access these
+export UPLOAD=1 # If 0, don't actually upload
+export CATEGORY=manual # Category to receive man pages
+export WEBSITE=zapi # Wikidot website prefix
+
+# This function uploads a file to wikidot
+# Error in upload will cause the script to exit with non-zero status
+
+function do_upload {
+ ./wdput $WEBSITE $CATEGORY $1 $2
+ if [ $? != 0 ]; then
+ echo "Error uploading file to wikidot"
+ exit 1
+ fi
+}
+
+echo "Building docs..."
+make --quiet
+rm -f *.xml # Makefile does not detect version differences for XML
+for FILE in *.txt; do
+ ./mkman $FILE
+ make `basename $FILE .txt`.xml
+done
+
+echo "Generating XML pages for manual..."
+FILES=
+for FILE in z*.txt; do
+ BASE=`basename $FILE .txt`
+ make --quiet $BASE.xml;
+ FILES="$FILES $BASE"
+done
+
+echo "Generating Wikidot pages..."
+for FILE in $FILES; do
+ perl ./xml2wd.pl $FILE.xml > $FILE.wd
+done
+
+if [ $UPLOAD -eq 1 ]; then
+ echo "Uploading to $CATEGORY..."
+
+ # Send table of contents as category:_start
+ do_upload "_start" "zapi Documentation"
+
+ # Send template as category:_template
+ do_upload "_template" "Category template - generated"
+
+ # Now send individual man pages
+ for FILE in $FILES; do
+ TITLE=`egrep --after-context 1 PAGE_TITLE $FILE.wd | egrep $FILE`
+ do_upload $FILE $TITLE
+ done
+fi
+
+# Cleanup generated files
+rm _start.wd
+for FILE in $FILES; do
+ rm $FILE.wd
+done
View
@@ -0,0 +1,43 @@
+#! /usr/bin/python
+#
+# wdput - Send one Wikidot page to api.zero.mq
+# Part of the ztools/apisite toolkit. Install into any directory on PATH.
+#
+# Author: Pieter Hintjens <ph@imatix.com>
+# License: public domain
+#
+# syntax: wdput sitename category page title
+#
+# Wikidot text must be in page + '.wd'
+#
+# Supply your Wikidot user name as an environment variable APISITE_USER
+# Supply your Wikidot API key as an environment variable APISITE_KEY
+
+# Get script arguments
+import sys
+sitename = sys.argv [1]
+category = sys.argv [2]
+name = sys.argv [3]
+title = sys.argv [4]
+
+# Get authentication credentials
+import os
+user = os.environ ['APISITE_USER']
+key = os.environ ['APISITE_KEY']
+
+# Create XML/RPC connection to Wikidot
+from xmlrpclib import ServerProxy
+server = ServerProxy ('https://' + user + ':' + key + '@www.wikidot.com/xml-rpc-api.php')
+
+# Send page content (create or update)
+file = open (name + ".wd", "r")
+content = ""
+for line in file:
+ content = content + line
+
+print " - " + category + ":" + name
+server.pages.save_one ({
+ "site": sitename,
+ "page": category + ":" + name,
+ "title": title,
+ "content": content})
Oops, something went wrong. Retry.

0 comments on commit 8fa6eb3

Please sign in to comment.