Skip to content

Commit

Permalink
Merge a6e3027 into 95caddb
Browse files Browse the repository at this point in the history
  • Loading branch information
f18m committed Oct 24, 2023
2 parents 95caddb + a6e3027 commit e823be9
Show file tree
Hide file tree
Showing 80 changed files with 1,189 additions and 2,003 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/Docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy API docs content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["feature/asciidoctor"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

## libzmq-specific CI/CD ##
- name: Install AsciiDoctor
run: sudo apt install -y asciidoctor
- name: Convert AsciiDoc with AsciiDoctor into HTML
run: ./autogen.sh && ./configure && make --directory=doc

## boilerplate steps to publish github Pages ##
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'doc/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
25 changes: 5 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1255,26 +1255,11 @@ endif()
option(WITH_DOCS "Build html docs" ON)
if(WITH_DOCS)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
file(
GLOB docs
RELATIVE ${CMAKE_CURRENT_BINARY_DIR}/
"${CMAKE_CURRENT_SOURCE_DIR}/doc/*.txt")
set(html-docs)
foreach(txt ${docs})
string(REGEX REPLACE ".*/(.*)\\.txt" "\\1.html" html ${txt})
set(src ${txt})
set(dst doc/${html})
if(WITH_DOC)
add_custom_command(
OUTPUT ${dst}
COMMAND ${ASCIIDOC_EXECUTABLE} -d manpage -b xhtml11 -f ${CMAKE_CURRENT_SOURCE_DIR}/doc/asciidoc.conf
-azmq_version=${ZMQ_VERSION} -o ${dst} ${src}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating ${html}")
list(APPEND html-docs ${CMAKE_CURRENT_BINARY_DIR}/${dst})
endif()
endforeach()
add_custom_command(
COMMAND asciidoctor -b html -azmq_version=${ZMQ_VERSION} *.adoc
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating ${html}")
endif()

if(ZMQ_BUILD_FRAMEWORK)
Expand Down
9 changes: 4 additions & 5 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ dnl # Check whether to build documentation and install man-pages
dnl ##############################################################################
AC_DEFUN([LIBZMQ_CHECK_DOC_BUILD], [{
# Man pages are built/installed if asciidoc and xmlto are present
# Man pages are built/installed if asciidoctor and xmlto are present
# --with-docs=no overrides this
AC_ARG_WITH([docs],
AS_HELP_STRING([--without-docs],
Expand All @@ -109,14 +109,13 @@ AC_DEFUN([LIBZMQ_CHECK_DOC_BUILD], [{
libzmq_build_doc="yes"
libzmq_install_man="yes"
# Check for asciidoc and xmlto and don't build the docs if these are not installed.
AC_CHECK_PROG(libzmq_have_asciidoc, asciidoc, yes, no)
AC_CHECK_PROG(libzmq_have_xmlto, xmlto, yes, no)
if test "x$libzmq_have_asciidoc" = "xno" -o "x$libzmq_have_xmlto" = "xno"; then
AC_CHECK_PROG(libzmq_have_asciidoctor, asciidoctor, yes, no)
if test "x$libzmq_have_asciidoctor" = "xno"; then
libzmq_build_doc="no"
# Tarballs built with 'make dist' ship with prebuilt documentation.
if ! test -f doc/zmq.7; then
libzmq_install_man="no"
AC_MSG_WARN([You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed.])
AC_MSG_WARN([You are building an unreleased version of 0MQ and asciidoctor is not installed.])
AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.])
fi
fi
Expand Down
43 changes: 23 additions & 20 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#
# documentation
#
MAN3 = zmq_bind.3 zmq_unbind.3 zmq_connect.3 zmq_connect_peer.3 zmq_disconnect.3 zmq_close.3 \
MAN3 = \
zmq_bind.3 zmq_unbind.3 zmq_connect.3 zmq_connect_peer.3 zmq_disconnect.3 zmq_close.3 \
zmq_ctx_new.3 zmq_ctx_term.3 zmq_ctx_get.3 zmq_ctx_set.3 zmq_ctx_shutdown.3 \
zmq_msg_init.3 zmq_msg_init_data.3 zmq_msg_init_size.3 zmq_msg_init_buffer.3 \
zmq_msg_move.3 zmq_msg_copy.3 zmq_msg_size.3 zmq_msg_data.3 zmq_msg_close.3 \
Expand All @@ -22,45 +23,47 @@ MAN3 = zmq_bind.3 zmq_unbind.3 zmq_connect.3 zmq_connect_peer.3 zmq_disconnect.3
zmq_atomic_counter_inc.3 zmq_atomic_counter_dec.3 \
zmq_atomic_counter_value.3 zmq_atomic_counter_destroy.3

MAN7 = zmq.7 zmq_tcp.7 zmq_pgm.7 zmq_inproc.7 zmq_ipc.7 \
MAN7 = \
zmq.7 zmq_tcp.7 zmq_pgm.7 zmq_inproc.7 zmq_ipc.7 \
zmq_null.7 zmq_plain.7 zmq_curve.7 zmq_tipc.7 zmq_vmci.7 zmq_udp.7 \
zmq_gssapi.7

MAN_DOC =

MAN_TXT = $(MAN3:%.3=%.txt)
MAN_TXT += $(MAN7:%.7=%.txt)
MAN_ADOC = $(MAN3:%.3=%.adoc)
MAN_ADOC += $(MAN7:%.7=%.adoc)
MAN_HTML =

MAINTAINERCLEANFILES =

EXTRA_DIST = asciidoc.conf $(MAN_TXT)
EXTRA_DIST = $(MAN_ADOC)

if INSTALL_MAN
MAN_DOC += $(MAN1) $(MAN3) $(MAN7)
MAN_DOC += $(MAN3) $(MAN7)
dist_man_MANS = $(MAN_DOC)
MAINTAINERCLEANFILES += $(MAN_DOC)
endif

if BUILD_DOC
MAN_HTML += $(MAN_TXT:%.txt=%.html)
MAN_HTML += $(MAN_ADOC:%.adoc=%.html)
MAN_DOC += $(MAN_HTML)
EXTRA_DIST += $(MAN_HTML)
MAINTAINERCLEANFILES += $(MAN_HTML)

SUFFIXES=.html .txt .xml .3 .7
SUFFIXES=.html .adoc .xml .3 .7

.txt.html:
asciidoc -d manpage -b xhtml11 -f $(srcdir)/asciidoc.conf \
-azmq_version=@PACKAGE_VERSION@ -o$@ $<
.txt.xml:
asciidoc -d manpage -b docbook -f $(srcdir)/asciidoc.conf \
-azmq_version=@PACKAGE_VERSION@ -o$@ $<
.xml.1:
xmlto man $<
.xml.3:
xmlto man $<
.xml.7:
xmlto man $<
.adoc.html:
asciidoctor -b html -azmq_version=@PACKAGE_VERSION@ $<
.adoc.3:
asciidoctor -b manpage -azmq_version=@PACKAGE_VERSION@ $<
.adoc.7:
asciidoctor -b manpage -azmq_version=@PACKAGE_VERSION@ $<
endif

dist-hook : $(MAN_DOC) $(MAN_HTML)

all-local :
ln -sf zmq.html index.html

clean-local :
rm -f $(MAN3) $(MAN7) $(MAN_HTML)
56 changes: 0 additions & 56 deletions doc/asciidoc.conf

This file was deleted.

0 comments on commit e823be9

Please sign in to comment.