Skip to content

Commit

Permalink
Keep cmark.1 in repository, so pandoc isn't required to build.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Nov 30, 2014
1 parent e466700 commit dc5345d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 7 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ JSMODULES=$(wildcard js/lib/*.js)

.PHONY: all spec leakcheck clean fuzztest dingus upload jshint test testjs benchjs update-site upload-site check npm debug mingw archive tarball ziparchive testarchive testtarball testziparchive testlib bench apidoc

all: $(BUILDDIR) $(SRCDIR)/html/html_unescape.h $(SRCDIR)/case_fold_switch.inc
all: $(BUILDDIR)
@make -C $(BUILDDIR)

check:
@cmake --version > /dev/null || (echo "You need cmake to build this program: http://www.cmake.org/download/" && exit 1)

$(BUILDDIR): check
$(BUILDDIR): check $(SRCDIR)/html/html_unescape.h $(SRCDIR)/case_fold_switch.inc man/man1/cmark.1
mkdir -p $(BUILDDIR); \
cd $(BUILDDIR); \
cmake .. -G "$(GENERATOR)" -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
Expand Down Expand Up @@ -71,6 +71,9 @@ clean:

$(PROG): all

man/man1/cmark.1: man/cmark.1.md
mkdir -p man/man1 && pandoc -t man -s $< -o $@

apidoc: src/cmark.h
doxygen Doxyfile

Expand Down
18 changes: 13 additions & 5 deletions man/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ add_custom_target(manpages ALL
DEPENDS ${MANDEST}/man1/cmark.1
)

# This is a temporary fallback until we get a cmark-based
# build procedure for the man pages:
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)
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man1/cmark.1
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/man1/cmark.1
${MANDEST}/man1/cmark.1 VERBATIM
)

# 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)

Expand Down
34 changes: 34 additions & 0 deletions man/man1/cmark.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.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

0 comments on commit dc5345d

Please sign in to comment.