Skip to content

Commit

Permalink
ci: Build docs by texinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
ieQu1 committed Jan 1, 2025
1 parent 00f0344 commit d073d6b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install additional packages
run: |
apt-get update
apt-get install -y openjdk-11-jdk asciidoctor xsltproc docbook-xsl
apt-get install -y texinfo
- name: Compile and run tests
env:
BUILD_WITHOUT_QUIC: "true"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ jobs:
name: Install additional packages
run: |
apt-get update
apt-get install -y openjdk-11-jdk asciidoctor xsltproc docbook-xsl python3-pygments
apt-get install -y texinfo
- name: Build
shell: bash
run: |
export BUILD_WITHOUT_QUIC=1
git config --global --add safe.directory $(pwd)
make release
tar czf docs.tar.gz _build/lee_doc/html _build/lee_doc/man _build/lee_doc/src/
tar czf docs.tar.gz doc/html doc/info
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
Expand Down
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ release: compile docs
@$(REBAR) as emqttb tar
@$(CURDIR)/scripts/rename-package.sh

$(DOCBOOK): scripts/docgen.escript compile
escript scripts/docgen.escript $@

.PHONY: docs
docs: doc/info/emqttb.info doc/html/index.html

Expand All @@ -46,8 +43,8 @@ doc/html/index.html: $(TEXINFO)
# -c MATHJAX_CONFIGURATION="$(MATHJAX_OPTS)"
texi2any -I doc/lee --html -c INFO_JS_DIR=js -c HTML_MATH=mathjax -o doc/html/ $<

$(TEXINFO): compile
./scripts/docgen.escript doc/lee
$(TEXINFO): scripts/docgen.escript compile
$(CURDIR)/scripts/docgen.escript doc/lee

.PHONY: clean
clean: distclean
Expand Down
8 changes: 7 additions & 1 deletion bin/emqttb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ ERTS_PATH=$RUNNER_ROOT_DIR/erts-$ERTS_VSN/bin
ulimit -n $(ulimit -Hn)

help() {
info "${RUNNER_ROOT_DIR}/doc/info/emqttb.info" "$@"
local file
file="${RUNNER_ROOT_DIR}/doc/info/emqttb.info"
if command -v emacs; then
emacs -eval "(info \"${file}\")"
else
info "${file}" "${@}"
fi
}

if [ $# -eq 2 ] && [ $1 = "--help" ]; then
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{deps,
[ {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.13.5"}}}
, {gproc, "0.9.1"}
, {lee, {git, "https://github.com/k32/lee", {tag, "0.5.0"}}}
, {lee, {git, "https://github.com/k32/lee", {tag, "0.5.1"}}}
, {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe", {tag, "1.0.10"}}}
, {prometheus, {git, "https://github.com/deadtrickster/prometheus.erl", {tag, "v4.8.2"}}}
, hackney
Expand Down
2 changes: 1 addition & 1 deletion scripts/docgen.escript
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/escript
%%! -pa _build/default/lib/lee/ebin -pa _build/default/lib/typerefl/ebin -pa _build/default/lib/emqttb/ebin -pa ./_build/default/checkouts/lee/ebin
%%! -pa _build/default/lib/lee/ebin -pa _build/default/lib/typerefl/ebin -pa _build/default/lib/emqttb/ebin
%% -*- erlang -*-

-include_lib("lee/include/lee.hrl").
Expand Down

0 comments on commit d073d6b

Please sign in to comment.