doc: add generation of man pages from asciidoc sources
authorAntonio Ospite <ospite@studenti.unina.it>
Fri, 23 Mar 2012 23:25:57 +0000 (00:25 +0100)
committerAntonio Ospite <ospite@studenti.unina.it>
Fri, 23 Mar 2012 23:28:51 +0000 (00:28 +0100)
cmake_modules/FindAsciidoc.cmake [new file with mode: 0644]
doc/CMakeLists.txt
doc/man/CMakeLists.txt [new file with mode: 0644]
doc/man/am7xxx-play.1.txt [new file with mode: 0644]
doc/man/picoproj.1.txt [new file with mode: 0644]

diff --git a/cmake_modules/FindAsciidoc.cmake b/cmake_modules/FindAsciidoc.cmake
new file mode 100644 (file)
index 0000000..9b3e414
--- /dev/null
@@ -0,0 +1,27 @@
+# - Find Asciidoc
+# this module looks for asciidoc
+#
+# ASCIIDOC_EXECUTABLE - the full path to asciidoc
+# ASCIIDOC_A2X_EXECUTABLE - the full path to asciidoc's a2x
+# ASCIIDOC_FOUND - If false, don't attempt to use asciidoc.
+#
+# Taken from:
+# http://lissyx.dyndns.org/redmine/projects/qpdfpresenterconsole/repository/revisions/master/raw/cmake/FindAsciidoc.cmake
+
+FIND_PROGRAM(ASCIIDOC_EXECUTABLE asciidoc)
+FIND_PROGRAM(ASCIIDOC_A2X_EXECUTABLE a2x)
+
+MARK_AS_ADVANCED(
+ASCIIDOC_EXECUTABLE
+ASCIIDOC_A2X_EXECUTABLE
+)
+
+IF ((NOT ASCIIDOC_EXECUTABLE) OR (NOT ASCIIDOC_A2X_EXECUTABLE))
+SET(ASCIIDOC_FOUND "NO")
+ELSE ((NOT ASCIIDOC_EXECUTABLE) OR (NOT ASCIIDOC_A2X_EXECUTABLE))
+SET(ASCIIDOC_FOUND "YES")
+ENDIF ((NOT ASCIIDOC_EXECUTABLE) OR (NOT ASCIIDOC_A2X_EXECUTABLE))
+
+IF (NOT ASCIIDOC_FOUND AND Asciidoc_FIND_REQUIRED)
+MESSAGE(FATAL_ERROR "Could not find asciidoc")
+ENDIF (NOT ASCIIDOC_FOUND AND Asciidoc_FIND_REQUIRED)
index ce111b2..0569f9d 100644 (file)
@@ -13,3 +13,5 @@ if(DOXYGEN_FOUND)
     DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}")
 
 endif(DOXYGEN_FOUND)
+
+add_subdirectory(man)
diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8029513
--- /dev/null
@@ -0,0 +1,16 @@
+# add a target to generate man pages with asciidoc
+find_package(Asciidoc)
+if(ASCIIDOC_FOUND)
+  add_custom_target(manpages
+    ${ASCIIDOC_A2X_EXECUTABLE} -f manpage ${CMAKE_CURRENT_SOURCE_DIR}/am7xxx-play.1.txt -D ${CMAKE_CURRENT_BINARY_DIR}
+    COMMAND ${ASCIIDOC_A2X_EXECUTABLE} -f manpage ${CMAKE_CURRENT_SOURCE_DIR}/picoproj.1.txt -D ${CMAKE_CURRENT_BINARY_DIR}
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    COMMENT "Generating man pages with Asciidoc" VERBATIM
+  )
+
+install(FILES
+  ${DOC_OUTPUT_PATH}/man/am7xxx-play.1
+  ${DOC_OUTPUT_PATH}/man/picoproj.1
+  DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1/")
+
+endif(ASCIIDOC_FOUND)
diff --git a/doc/man/am7xxx-play.1.txt b/doc/man/am7xxx-play.1.txt
new file mode 100644 (file)
index 0000000..5054da4
--- /dev/null
@@ -0,0 +1,100 @@
+AM7XXX-PLAY(1)
+==============
+:doctype: manpage
+
+
+NAME
+----
+am7xxx-play - play stuff on an am7xxx device (e.g. Acer C110, PicoPix 1020)
+
+
+SYNOPSIS
+--------
+*am7xxx-play* ['OPTIONS']
+
+
+DESCRIPTION
+-----------
+am7xxx-play(1) uses libavdevice, libavformat, libavcodec and libswscale to
+decode the input, encode it to jpeg and display it with libam7xxx.
+
+
+OPTIONS
+-------
+*-f* '<input format>'::
+    the input device format
+
+*-i* '<input path>'::
+    the input path
+
+*-o* '<options>'::
+    a comma separated list of input format options
++
+EXAMPLE:
++
+  -o draw_mouse=1,framerate=100,video_size=800x480
+
+*-s* '<scaling method>'::
+    the rescaling method (see swscale.h)
+
+*-u*::
+    upscale the image if smaller than the display dimensions
+
+*-F* '<format>'::
+    the image format to use (default is JPEG)
++
+.SUPPORTED FORMATS:
+* 1 - JPEG
+* 2 - NV12
+
+*-q* '<quality>'::
+    quality of jpeg sent to the device, between 1 and 100
+
+*-l* '<log level>'::
+    the verbosity level of libam7xxx output (0-5)
+
+*-p* '<power level>'::
+    power level of device, between 0 (off) and 4 (maximum) +
+    WARNING: Level 2 and greater require the master AND
+             the slave connector to be plugged in.
+
+*-h*::
+    this help message
+
+
+EXAMPLES OF USE
+---------------
+
+   am7xxx-play -f x11grab -i :0.0 -o video_size=800x480
+   am7xxx-play -f fbdev -i /dev/fb0
+   am7xxx-play -f video4linux2 -i /dev/video0 -o video_size=320x240,frame_rate=100 -u -q 90
+   am7xxx-play -i http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v
+
+
+EXIT STATUS
+-----------
+*0*::
+    Success
+
+*!0*::
+    Failure (libam7xxx error; libav error)
+
+
+AUTHORS
+-------
+Antonio Ospite and Reto Schneider
+
+
+RESOURCES
+---------
+Main web site: <http://git.ao2.it/libam7xxx.git>
+
+
+COPYING
+-------
+Copyright \(C) 2012  Antonio Ospite <ospite@studenti.unina.it>
+
+This program 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.
diff --git a/doc/man/picoproj.1.txt b/doc/man/picoproj.1.txt
new file mode 100644 (file)
index 0000000..e26df26
--- /dev/null
@@ -0,0 +1,80 @@
+PICOPROJ(1)
+===========
+:doctype: manpage
+
+
+NAME
+----
+picoproj - test program for libam7xxx
+
+
+SYNOPSIS
+--------
+*picoproj* ['OPTIONS']
+
+
+DESCRIPTION
+-----------
+picoproj(1) is a minimal example to show how to use libam7xxx to display a static image.
+
+
+OPTIONS
+-------
+
+*-f* '<filename>'::
+    the image file to upload
+
+
+*-F* '<format>'::
+    the image format to use (default is JPEG)
++
+.SUPPORTED FORMATS:
+* 1 - JPEG
+* 2 - NV12
+
+*-l* '<log level>'::
+    the verbosity level of libam7xxx output (0-5)
+
+*-W* '<image width>'::
+    the width of the image to upload
+
+*-H* '<image height>'::
+    the height of the image to upload
+
+*-h*::
+    this help message
+
+
+EXAMPLE OF USE
+--------------
+
+picoproj -f file.jpg -F 1 -l 5 -W 800 -H 480
+
+
+EXIT STATUS
+-----------
+*0*::
+    Success
+
+*!0*::
+    Failure (libam7xxx error)
+
+
+AUTHORS
+-------
+Antonio Ospite and Reto Schneider
+
+
+RESOURCES
+---------
+Main web site: <http://git.ao2.it/libam7xxx.git>
+
+
+COPYING
+-------
+Copyright \(C) 2012  Antonio Ospite <ospite@studenti.unina.it>
+
+This program 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.