aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-15 02:59:35 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-15 02:59:35 -0300
commitf7a4ecf2add403c8b078658406fcfed5486fdd2c (patch)
treee0ea1862e0ef3bc9445dbf49d14637c279f0d968
parentae6443e44a2a6e242cf97d58e608e6f21dcdc464 (diff)
downloadblogc-f7a4ecf2add403c8b078658406fcfed5486fdd2c.tar.gz
blogc-f7a4ecf2add403c8b078658406fcfed5486fdd2c.tar.bz2
blogc-f7a4ecf2add403c8b078658406fcfed5486fdd2c.zip
added initial man pages
-rw-r--r--.gitignore4
-rw-r--r--Makefile.am47
-rw-r--r--configure.ac20
-rw-r--r--man/blogc-source.7.ronn18
-rw-r--r--man/blogc-template.7.ronn18
-rw-r--r--man/blogc.1.ronn88
-rw-r--r--man/index.txt8
7 files changed, 202 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index c08b333..e0013d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,6 +37,10 @@ Makefile.in
/m4/*.m4
!/m4/pkg.m4
+# man pages
+/man/blogc*.[17]
+/man/blogc*.html
+
# blogc
/blogc
diff --git a/Makefile.am b/Makefile.am
index 9302a7e..9d56ca3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,9 @@ ACLOCAL_AMFLAGS = -I m4
AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-tests \
- --disable-valgrind
+ --disable-ronn \
+ --disable-valgrind \
+ $(NULL)
## File listings
@@ -18,6 +20,9 @@ EXTRA_DIST = \
CLEANFILES = \
$(NULL)
+MAINTAINERCLEANFILES = \
+ $(NULL)
+
noinst_HEADERS = \
src/content-parser.h \
src/file.h \
@@ -81,6 +86,46 @@ blogc_LDADD = \
$(NULL)
+## Build rules: man pages
+
+if USE_RONN
+
+EXTRA_DIST += \
+ man/blogc.1.ronn \
+ man/blogc-source.7.ronn \
+ man/blogc-template.7.ronn \
+ man/index.txt \
+ $(NULL)
+
+dist_man_MANS = \
+ man/blogc.1 \
+ man/blogc-source.7 \
+ man/blogc-template.7 \
+ $(NULL)
+
+MAINTAINERCLEANFILES += \
+ $(dist_man_MANS) \
+ $(NULL)
+
+man/blogc.1: man/blogc.1.ronn
+ $(AM_V_GEN)$(RONN) \
+ --roff \
+ --pipe \
+ --organization "Rafael G. Martins" \
+ --manual "$(PACKAGE_NAME) Manual" \
+ $< > $@
+
+man/blogc%.7: man/blogc%.7.ronn
+ $(AM_V_GEN)$(RONN) \
+ --roff \
+ --pipe \
+ --organization "Rafael G. Martins" \
+ --manual "$(PACKAGE_NAME) Manual" \
+ $< > $@
+
+endif
+
+
## Build rules: tests
if USE_CMOCKA
diff --git a/configure.ac b/configure.ac
index a2cace4..d79fc47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,25 @@ AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"], [
AC_MSG_ERROR([no C99 compiler found, blogc requires a C99 compiler.])
])
+AC_ARG_ENABLE([ronn], AS_HELP_STRING([--disable-ronn],
+ [ignore presence of ronn and disable man pages generation]))
+AS_IF([test "x$enable_ronn" != "xno"], [
+ AC_PATH_PROG([ronn], [ronn])
+ AS_IF([test "x$ac_cv_path_ronn" = "x"], [
+ have_ronn=no
+ ], [
+ have_ronn=yes
+ ])
+])
+AS_IF([test "x$have_ronn" = "xyes"], , [
+ AS_IF([test "x$enable_ronn" = "xyes"], [
+ AC_MSG_ERROR([ronn requested but not found])
+ ])
+])
+AM_CONDITIONAL([USE_RONN], [test "x$have_ronn" = "xyes"])
+RONN="$ac_cv_path_ronn"
+AC_SUBST(RONN)
+
AC_ARG_ENABLE([valgrind], AS_HELP_STRING([--disable-valgrind],
[ignore presence of valgrind]))
AS_IF([test "x$enable_valgrind" != "xno"], [
@@ -93,5 +112,6 @@ AS_ECHO("
tests: ${TESTS}
+ ronn: ${RONN}
valgrind: ${VALGRIND}
")
diff --git a/man/blogc-source.7.ronn b/man/blogc-source.7.ronn
new file mode 100644
index 0000000..71be994
--- /dev/null
+++ b/man/blogc-source.7.ronn
@@ -0,0 +1,18 @@
+blogc-source(7) -- blogc's source file format
+=============================================
+
+## SYNOPSIS
+
+TODO
+
+## DESCRIPTION
+
+TODO
+
+## AUTHOR
+
+Rafael G. Martins &lt;<rafael@rafaelmartins.eng.br>&gt;
+
+## SEE ALSO
+
+blogc(1), strptime(3)
diff --git a/man/blogc-template.7.ronn b/man/blogc-template.7.ronn
new file mode 100644
index 0000000..5883d09
--- /dev/null
+++ b/man/blogc-template.7.ronn
@@ -0,0 +1,18 @@
+blogc-template(7) -- blogc's template format
+============================================
+
+## SYNOPSIS
+
+TODO
+
+## DESCRIPTION
+
+TODO
+
+## AUTHOR
+
+Rafael G. Martins &lt;<rafael@rafaelmartins.eng.br>&gt;
+
+## SEE ALSO
+
+blogc(1)
diff --git a/man/blogc.1.ronn b/man/blogc.1.ronn
new file mode 100644
index 0000000..ddf33ca
--- /dev/null
+++ b/man/blogc.1.ronn
@@ -0,0 +1,88 @@
+blogc(1) -- a blog compiler
+===========================
+
+## SYNOPSIS
+
+`blogc` [`-D` <KEY>=<VALUE> ...] `-t` <TEMPLATE> [`-o` <OUTPUT>] <SOURCE><br>
+`blogc` `-l` [`-D` <KEY>=<VALUE> ...] `-t` <TEMPLATE> [`-o` <OUTPUT>] <SOURCE> [<SOURCE> ...]<br>
+`blogc` [`-h`|`-v`]
+
+## DESCRIPTION
+
+**blogc** converts source files and templates into blog/website resources. It
+gets one (or more) source files and a template, and generates an output file,
+based on the template and the content read from the source file(s). It was
+designed to be used with make(1).
+
+`blogc` works on two modes:
+
+ * `entry`:
+ Default mode, first example in [SYNOPSIS][]. Accepts only one source
+ file, and process it as a single entry of the blog/website, like a static
+ page or a post.
+
+ * `listing`:
+ Listing mode, second example in [SYNOPSIS][], activated when
+ calling `blogc` with `-l` option. Accepts multiple source files, and allow
+ users to iterate over the content of all the source files to produce listing
+ pages, like indexes and feeds.
+
+## OPTIONS
+
+ * `-l`:
+ Activates listing mode, allowing user to provide multiple source files. See
+ blogc-source(7) for details.
+
+ * `-D` <KEY>=<VALUE>:
+ Set global configuration parameter. <KEY> must be an ascii uppercase string,
+ with only letters, numbers (after the first letter) and underscores (after
+ the first letter). These parameters are available anywhere in templates,
+ but may be overridden by local configuration parameters set in source files.
+ See blogc-template(7) for details.
+
+ * `-t` <TEMPLATE>:
+ Template file. It is a required option. See blogc-template(7) for details.
+
+ * `-o` <OUTPUT>:
+ Output file. If provided this option, save the compiled output to the given
+ file. Otherwise, the compiled output is sent to `stdout`.
+
+ * `-v`:
+ Show program name, version and exit.
+
+ * `-h`:
+ Show help message and exit.
+
+## FILES
+
+The `blogc` command expects a template file blogc-template(7), one (or more)
+source files blogc-source(7) and an output file, if wanted.
+
+## ENVIRONMENT
+
+No environment variables are required by `blogc`, but global timezone will
+be used by locale-dependant datetime input field descriptors (like `%c`, and
+can be overridden using environment variables. See strptime(3).
+
+## EXAMPLES
+
+Build index from source files:
+
+ $ blogc -l -t template.tmpl -o index.html source1.txt source2.txt source3.txt
+
+Build entry page from source file:
+
+ $ blogc -t template.tmpl -o entry.html entry.txt
+
+## BUGS
+
+**blogc** is based in handwritten parsers, that even being well tested, may be
+subject of parsing bugs.
+
+## AUTHOR
+
+Rafael G. Martins &lt;<rafael@rafaelmartins.eng.br>&gt;
+
+## SEE ALSO
+
+blogc-source(7), blogc-template(7), make(1), strptime(3)
diff --git a/man/index.txt b/man/index.txt
new file mode 100644
index 0000000..4ff99f5
--- /dev/null
+++ b/man/index.txt
@@ -0,0 +1,8 @@
+# manuals
+blogc(1) blogc.1.ronn
+blogc-source(7) blogc-source.7.ronn
+blogc-template(7) blogc-template.7.ronn
+
+# external manuals
+make(1) http://man.cx/make(1)
+strptime(3) http://man.cx/strptime(3)