aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-29 10:50:19 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-29 10:50:19 -0800
commit1a44d5bc9bb6178f254a96d3e694dd4c9f4ffecb (patch)
tree6ebadece01a36dbc5556e6c8f6c5d46bcc836197
parentad8b39e550f2ff9a8b8e409d1654fc26135dc9fa (diff)
Moved man page generation to man/CMakeLists.txt.
Removed doxygen stuff for now. It seems too complex for what we need. We'll find another way to create cmark.3.
-rw-r--r--CMakeLists.txt6
-rw-r--r--Makefile9
-rw-r--r--man/CMakeLists.txt19
-rw-r--r--man/Doxyfile.in (renamed from Doxyfile)4
-rw-r--r--man/man1/cmark.134
5 files changed, 23 insertions, 49 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a16f82..2e4c870 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,11 +14,7 @@ set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_
add_subdirectory(src)
add_subdirectory(api_test)
-
-if(UNIX)
- INSTALL(FILES man/man1/cmark.1 DESTINATION share/man/man1)
- INSTALL(FILES man/man3/cmark.3 DESTINATION share/man/man3)
-endif(UNIX)
+add_subdirectory(man)
enable_testing()
diff --git a/Makefile b/Makefile
index a11e1da..fe2b8d2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,4 @@
SRCDIR?=src
-DOCDIR=doc
DATADIR?=data
BUILDDIR?=build
GENERATOR?=Unix Makefiles
@@ -70,16 +69,13 @@ archive: spec.html $(BUILDDIR) man/man3/cmark.3 man/man1/cmark.1
echo "Created $(TARBALL) and $(ZIPARCHIVE)."
clean:
- rm -rf $(BUILDDIR) $(MINGW_BUILDDIR) $(MINGW_INSTALLDIR) $(TARBALL) $(ZIPARCHIVE) $(PKGDIR) $(DOCDIR)
+ rm -rf $(BUILDDIR) $(MINGW_BUILDDIR) $(MINGW_INSTALLDIR) $(TARBALL) $(ZIPARCHIVE) $(PKGDIR)
$(PROG): all
apidoc: src/cmark.h
doxygen Doxyfile
-$(DOCDIR)/man/man3/cmark.h.3: src/cmark.h
- doxygen Doxyfile
-
# We include html_unescape.h in the repository, so this shouldn't
# normally need to be generated.
$(SRCDIR)/html/html_unescape.h: $(SRCDIR)/html/html_unescape.gperf
@@ -97,9 +93,6 @@ man/man1/cmark.1: man/cmark.1.md
man/man3:
mkdir -p $@
-man/man3/cmark.3: $(DOCDIR)/man/man3/cmark.h.3 man/man3
- cp $< $@
-
test: $(SPEC) $(BUILDDIR)
make -C $(BUILDDIR) test ARGS="-V"
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
new file mode 100644
index 0000000..29bb19c
--- /dev/null
+++ b/man/CMakeLists.txt
@@ -0,0 +1,19 @@
+set(MANDEST ${CMAKE_CURRENT_BINARY_DIR})
+file(MAKE_DIRECTORY ${MANDEST}/man1)
+
+add_custom_target(doc ALL
+ DEPENDS ${MANDEST}/man1/cmark.1
+)
+
+add_custom_command(OUTPUT ${MANDEST}/man1/cmark.1
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/cmark.1.md
+ COMMAND pandoc "-s" "-t" "man"
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmark.1.md
+ -o ${MANDEST}/man1/cmark.1
+ VERBATIM)
+
+INSTALL(FILES ${MANDEST}/man1/cmark.1 DESTINATION share/man/man1)
+
+# TODO: create cmark.3 man page.
+# file(MAKE_DIRECTORY ${MANDEST}/man3)
+# INSTALL(FILES ${MANDEST}/man3/cmark.3 DESTINATION share/man/man3)
diff --git a/Doxyfile b/man/Doxyfile.in
index 93ff981..4d35cc9 100644
--- a/Doxyfile
+++ b/man/Doxyfile.in
@@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = "doc"
+OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
@@ -753,7 +753,7 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = src
+INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../src/
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/man/man1/cmark.1 b/man/man1/cmark.1
deleted file mode 100644
index 3681456..0000000
--- a/man/man1/cmark.1
+++ /dev/null
@@ -1,34 +0,0 @@
-.TH "cmark" "1" "October 22, 2014" "cmark manual" ""
-.SH NAME
-.PP
-cmark \- convert CommonMark formatted text to HTML
-.SH SYNOPSIS
-.PP
-cmark [\f[I]options\f[]] [file*]
-.SH DESCRIPTION
-.PP
-\f[C]cmark\f[] acts as a pipe, reading from stdin or from the specified
-files and writing to stdout.
-It converts Markdown formatted plain text to HTML, using the conventions
-described in the CommonMark spec.
-If multiple files are specified, the contents of the files are simply
-concatenated before parsing.
-.SH OPTIONS
-.TP
-.B \f[C]\-\-ast\f[]
-Print an abstract syntax tree instead of HTML.
-.RS
-.RE
-.TP
-.B \f[C]\-\-help\f[]
-Print usage information.
-.RS
-.RE
-.TP
-.B \f[C]\-\-version\f[]
-Print version.
-.RS
-.RE
-.SH AUTHORS
-.PP
-John MacFarlane