diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..bed3c5d2
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,43 @@
+name: ci
+
+on:
+ push:
+ branches:
+ - master
+
+permissions:
+ contents: write
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Configure Git Credentials
+ run: |
+ git config user.name github-actions[bot]
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
+ - uses: actions/setup-python@v5
+ with:
+ python-version: 3.x
+ - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
+ - uses: actions/cache@v4
+ with:
+ key: mkdocs-material-${{ env.cache_id }}
+ path: .cache
+ restore-keys: |
+ mkdocs-material-
+ - run: pip install mkdocs-material \
+ "mkdocs-material[imaging]" \
+ mkdocs-material-extensions \
+ mkdocs-htmlproofer-plugin \
+ mkdocs-redirects \
+ mkdocs-with-pdf \
+ beautifulsoup4
+ - run: make home
+ - run: make pdf
+ - run: make zip
+ #- run: make test
+ - run: mkdocs gh-deploy --force
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..672f4d71
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+*.swp
+__pycache__
+content/ejabberd-docs-*.pdf
+content/ejabberd-docs-*.zip
+.venv/*
+site/*
+temp/*
diff --git a/Makefile b/Makefile
index 63f28555..ad6732fa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,146 +1,301 @@
+#' definitions
+#
+
EJA = `pwd`/../ejabberd/
+DOCKER = `pwd`/../docker-ejabberd/
VERSIONPRE = $(shell git tag --sort=creatordate | tail -n 2 | head -n 1)
VERSION = $(shell git tag --sort=creatordate | tail -n 1)
-VERSION_ = $(shell git tag --sort=creatordate | tail -n 1 | tr . _)
VERSION- = $(shell git tag --sort=creatordate | tail -n 1 | tr . -)
VERSIONU = $(shell git tag --sort=creatordate | tail -n 1 | tr -d .)
-ARCHIVE = archive/$(VERSION_)
+ARCHIVE = archive/$(VERSION)
DEST = content/$(ARCHIVE)
-ARCHIVESTRING=" If you are using an old ejabberd release, please refer to the corresponding archived version of this page in the [Archive](/archive/)."
+ARCHIVESTRING=" If you are using an old ejabberd release, please refer to the corresponding archived version of this page in the [Archive](../../archive/index.md)."
-all: api man
+READMES=content/README-DOCS.md
-api:
- ejabberdctl gen_markdown_doc_for_tags `pwd`/admin-tags.md
- # Convert *`something`* API into a link to API Reference
- sed -i 's|\*`\([a-z0-9_]*\)`\*|[\1](/developer/ejabberd-api/admin-api/#\1)|g' admin-tags.md
- sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' admin-tags.md
- sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' admin-tags.md
- sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' admin-tags.md
- sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' admin-tags.md
- sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' admin-tags.md
- mv admin-tags.md content/developer/ejabberd-api
- ejabberdctl gen_markdown_doc_for_commands `pwd`/admin-api.md "runtime" json
- # Remove three consecutive empty lines after Tags: and Modules:
- sed -i 's/^__Tags:__/__Tags:__\nCLEANLINES/g' admin-api.md
- sed -i 's/^__Module:__/__Module:__\nCLEANLINES/g' admin-api.md
- sed -i '/^CLEANLINES/{N;N;N;//d}' admin-api.md
- # Add disclaimer about Archive page for older ejabberd releases
- sed -i 's|\(This section.*\)|> \1'$(ARCHIVESTRING)'|g' admin-api.md
- # Make URL when mentioning an ejabberd release
- sed -i 's| \([0-9][0-9]\)\.\([0-9][0-9]\)| \1.\2|g' admin-api.md
- # Convert tricky absolute URLs into valid relative URLS
- sed -i 's|http://\./\(#.*\)\(\[[_a-z0-9]*\]\)|\2(/developer/ejabberd-api/admin-api/\1)|g' admin-api.md
- # Convert *`mod_something`* into a link to modules section
- sed -i 's|\*`mod_\([a-z0-9_]*\)`\*|[mod_\1](/admin/configuration/modules/#mod-\1)|g' admin-api.md
- # Convert *`something`* into a link to tags section
- sed -i 's|\*`\([a-z0-9_]*\)`\*|[\1](/developer/ejabberd-api/admin-tags/#\1)|g' admin-api.md
- # Anchors must use -, not _ characters
- sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' admin-api.md
- sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' admin-api.md
- sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' admin-api.md
- mv admin-api.md content/developer/ejabberd-api
+TTOPLEVEL=temp/toplevel.md
+TTOPLEVELO=$(TTOPLEVEL).orig
+TOPLEVEL=content/admin/configuration/toplevel.md
-test:
- # URLs without trailing slash like this cause broken links: [Basic](basic)
- git grep "\[.*\]([-\.\/a-z0-9]*[a-z])" content/ | grep -v ".png"
- linkchecker --no-status http://localhost:8080/
+TMODULES=temp/modules.md
+TMODULES0=$(TMODULES).orig
+MODULES=content/admin/configuration/modules.md
+
+TAPI=temp/admin-api.md
+TAPI0=$(TAPI).orig
+API=content/developer/ejabberd-api/admin-api.md
+
+TTAGS=temp/admin-tags.md
+TTAGS0=$(TTAGS).orig
+TAGS=content/developer/ejabberd-api/admin-tags.md
+
+PDFNAME=ejabberd-docs-$(VERSION).pdf
+PDF=content/ejabberd-docs.pdf
+PDFV=content/$(PDFNAME)
+
+ZIPNAME=ejabberd-docs-$(VERSION).zip
+ZIP=content/ejabberd-docs.zip
+ZIPV=content/$(ZIPNAME)
+
+#.
+#' help
+#
+
+help:
+ @echo ""
+ @echo " [help] Show this help"
+ @echo ""
+ @echo " all clean + extract + site + pdf + zip (requires ejabberd running)"
+ @echo ""
+ @echo " clean Remove temporary files"
+ @echo ""
+ @echo " extract Extract some documentation from ejabberd (requires ejabberd running)"
+ @echo ""
+ @echo " site Generate site as HTML files"
+ @echo " pdf Generate PDF file of the offline site"
+ @echo " zip Generate ZIP file of the offline site"
+ @echo ""
+ @echo " serve Start MkDocs web server"
+ @echo " dev Start MkDocs web server in development mode"
+ @echo ""
+ @echo " test Test URLs"
+ @echo ""
+ @echo " archive Copy some files and generate Archive page"
+ @echo ""
+
+all: clean extract site zip pdf
-man:
+#.
+#' extract
+#
+
+extract: temp home livebooks $(READMES) $(TOPLEVEL) $(MODULES) $(API) $(TAGS)
+
+#.
+#' copy markdown files
+#
+
+home:
+ sed -i 's|\(ejabberd-docs-[0-9\.]*.zip\)|$(ZIPNAME)|g' overrides/home.html
+ sed -i 's|\(ejabberd-docs-[0-9\.]*.pdf\)|$(PDFNAME)|g' overrides/home.html
+
+livebooks:
+ cd content/livebooks/ && for i in $$(ls *.livemd); do cp $$i $${i%.livemd}.md; done
+ cd content/livebooks/ && for i in $$(ls *.md); do sed -i '2r markdown_head.txt' $$i ; done
+ cd content/livebooks/ && for i in $$(ls *.md); do sed -i "s|NAME|$${i%.md}.livemd|" $$i ; done
+
+$(READMES):
+ cp README.md content/README-DOCS.md
+ cp $(EJA)/CONTAINER.md content/CONTAINER.md
+ cp $(EJA)/CONTRIBUTING.md content/contributing/index.md
+ cp $(EJA)/CODE_OF_CONDUCT.md content/contributing/CODE_OF_CONDUCT.md
+ cp $(EJA)/CONTRIBUTORS.md content/contributing/CONTRIBUTORS.md
+ cp $(EJA)/README.md content/README-GIT.md
+ sed -i '1i# Readme\n' content/README-GIT.md
+ sed -i 's|(COMPILE.md)|(admin/install/source.md)|g' content/README-GIT.md
+ sed -i 's|(COPYING)|(COPYING.md)|g' content/README-GIT.md
+ sed -i 's|(CONTRIBUTING.md)|(contributing/index.md)|g' content/README-GIT.md
+ cp $(EJA)/CHANGELOG.md content/CHANGELOG.md
+ sed -i '1i# ChangeLog\n' content/CHANGELOG.md
+ sed -i 's|^\([a-zA-Z0-9_ ]*:\)|#### \1\n|g' content/CHANGELOG.md
+ cp $(DOCKER)/ecs/README.md content/README-ECS.md
+ sed -i 's|# ejabberd Community Server|# `ecs` Container Image|g' content/README-ECS.md
+ sed -i 's|HUB-README.md|README-HUB.md|g' content/README-ECS.md
+ cp $(DOCKER)/ecs/HUB-README.md content/README-HUB.md
+
+#.
+#' get files
+#
+
+temp:
+ mkdir temp
+
+TTXT=temp/ejabberd.yml.5.txt
+
+$(TTXT):
ejabberdctl man
+ mv $(EJA)/ejabberd.yml.5.txt $(TTXT)
+TXML=temp/ejabberd.yml.5.xml
+
+$(TXML): $(TTXT)
# This prevents suboptions (like acl->ip, ...) to get a TOC entry:
- sed -E 's/\*(.*)\*: (.*):::/- *\1*: \2/g' $(EJA)/ejabberd.yml.5.txt >ejabberd.yml.5.txt
+ sed -E 's/\*(.*)\*: (.*):::/- *\1*: \2/g' $(TTXT) >$(TTXT).1
+ mv $(TTXT).1 $(TTXT)
- a2x -f docbook ejabberd.yml.5.txt
+ a2x -f docbook $(TTXT)
# Workaround required since Pandoc 2.8
# https://github.com/jgm/pandoc/commit/9b5082b086359a63b92bdb40166fa59dea27afe1
# Alternate workaround would be: https://github.com/jgm/pandoc/issues/6906
- sed -i 's|
|g' ejabberd.yml.5.xml - sed -i 's|Warning \1
|g' ejabberd.yml.5.xml + sed -i 's|Note \1
|g' $(TXML) + sed -i 's|Warning \1
|g' $(TXML) - pandoc -f docbook -t markdown_strict --markdown-headings=setext ejabberd.yml.5.xml -o man-tmp1.md +temp/man-02 temp/man-03: $(TXML) + pandoc -f docbook -t markdown_strict+fenced_code_blocks --markdown-headings=setext $(TXML) -o temp/man-tmp1 # Also required by the Pandoc 2.8 workaround - sed -i 's|> \*\*\(.*\)\.\*\*|> **\1**|g' man-tmp1.md + sed -i 's|> \*\*\(.*\)\.\*\*|> **\1**|g' temp/man-tmp1 # Allow to split the man page in sections: # for pandoc 2.9.2, or pandoc 3 with --markdown-headings=setext - sed -E '$!N;s/[A-Z ]+\n===+/===---===/;P;D' man-tmp1.md >man-tmp2.md + sed -E '$!N;s/[A-Z ]+\n===+/===---===/;P;D' temp/man-tmp1 >temp/man-tmp2 # for pandoc 2.17.1 - #sed -E '$!N;s/^# [A-Z ]+/===---===/;P;D' man-tmp1.md >man-tmp2.md + #sed -E '$!N;s/^# [A-Z ]+/===---===/;P;D' man-tmp1 >man-tmp2 + + csplit temp/man-tmp2 /===---===/ {*} -f temp/man- --suppress-matched + +$(TTOPLEVEL): temp/man-02 + mv temp/man-02 $(TTOPLEVEL) - csplit man-tmp2.md /===---===/ {*} -f man- --suppress-matched +$(TMODULES): temp/man-02 + mv temp/man-03 $(TMODULES) - echo "---\ntitle: Top-Level Options\ntoc: true\nmenu: Top-Level Opts\norder: 80\n---" >toplevel.md - cat man-02 >>toplevel.md +$(TAPI): + ejabberdctl gen_markdown_doc_for_commands `pwd`/$(TAPI) "runtime" json + +$(TTAGS): + ejabberdctl gen_markdown_doc_for_tags `pwd`/$(TTAGS) + +#. +#' process markdown +# + +$(TOPLEVEL): $(TTOPLEVEL) + mv $(TTOPLEVEL) $(TTOPLEVELO) + echo "# Top-Level Options" >$(TTOPLEVEL) + cat $(TTOPLEVELO) >>$(TTOPLEVEL) # Add headers to options so they get TOC entries: - sed -i 's/^\*\*\(.*\)\*\*: \(.*\)/## \1\n\n\2\n/g' toplevel.md + sed -i 's/^\*\*\(.*\)\*\*: \(.*\)/## \1\n\n\2\n/g' $(TTOPLEVEL) # Split paragraph of suboptions, it's nicer to read - sed -i 's/^- \*\*\(.*\)\*\*: \*\([^*]*\)\* \(.*\)/- **\1**: *\2* \n \3/g' toplevel.md + sed -i 's/^- \*\*\(.*\)\*\*: \*\([^*]*\)\* \(.*\)/- **\1**: *\2* \n \3/g' $(TTOPLEVEL) # Add disclaimer about Archive page for older ejabberd releases - sed -i 's|\(This section.*\)|> \1'$(ARCHIVESTRING)'|g' toplevel.md - # Convert tricky absolute URLs into valid relative URLS - sed -i 's|http://\.\.|/admin/configuration|g' toplevel.md - # Convert tricky absolute URLs into valid relative URLS - sed -i 's|http://\.\.|/admin/configuration|g' toplevel.md + sed -i 's|\(This section.*\)\. |> \1. '$(ARCHIVESTRING)' |g' $(TTOPLEVEL) # Convert *`mod_something`* into a link to modules section - sed -i 's|\*`mod_\([a-z_]*\)`\*|[mod_\1](/admin/configuration/modules/#mod-\1)|g' toplevel.md + sed -i 's|\*`mod_\([a-z_]*\)`\*|[mod_\1](modules.md#mod_\1)|g' $(TTOPLEVEL) # Convert *`something`* API into a link to API Reference - sed -i 's|\*`\([a-z0-9_]*\)`\* API|[\1](/developer/ejabberd-api/admin-api/#\1) API|g' toplevel.md + sed -i 's|\*`\([a-z0-9_]*\)`\* API|[\1](/developer/ejabberd-api/admin-api/#\1) API|g' $(TTOPLEVEL) # Convert *`something`* into a link to top-level options - sed -i 's|\*`\([a-z0-9_]*\)`\*|[\1](/admin/configuration/toplevel/#\1)|g' toplevel.md - # Anchors must use -, not _ characters - sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' toplevel.md - sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' toplevel.md - sed -i 's|#\([a-z0-9-]*\)_\([a-z0-9_-]*\))|#\1-\2)|g' toplevel.md + sed -i 's|\*`\([a-z0-9_]*\)`\*|[\1](#\1)|g' $(TTOPLEVEL) # Convert note to div HTML elements - sed -i 's|\*Note\* about the next option: \(.*\):|Note \1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Excerpt from XMPP Academy #1 starting at 1m33s.
-
-
- Excerpt from XMPP Academy #2 starting at 2m05s.
-
-
- Excerpt from XMPP Academy #2 starting at 14m00s.
-
-
- Excerpt from XMPP Academy #2 starting at 19m42s.
-
-
- Excerpt from XMPP Academy #1 starting at 16m44s.
-
-
- Excerpt from XMPP Academy #3 starting at 1m20s.
-
-
- Excerpt from XMPP Academy #3 starting at 22m34s.
-
-
- Excerpt from XMPP Academy #2 starting at 27m30s.
-
-
- Excerpt from XMPP Academy #2 starting at 29m51s.
-
-
- Excerpt from XMPP Academy #1 starting at 27m43s.
-
-
- Excerpt from XMPP Academy #3 starting at 25m02s.
-Excerpt from XMPP Academy #2 starting at 34m15s.
-
-
- Excerpt from XMPP Academy #3 starting at 27m45s.
-
-
- Excerpt from XMPP Academy #1 starting at 22m42s.
-
-
- Excerpt from XMPP Academy #1 starting at 25m54s.
-
-
- Excerpt from XMPP Academy #3 starting at 32m20s.
-
+
+ Dive into a wealth of knowledge to master all aspects of ejabberd Community Server. + From setup to optimization, discover everything you need to know about configuring and deploying your + messaging server. +
+ Get Started + What's new? ++ ejabberd is an open-source, robust, scalable and + extensible realtime + platform built using Erlang/OTP, that includes XMPP Server, + MQTT Broker and SIP Service. +
+Get an Overview of ejabberd, + its features, + some big use cases, + its license, + and finally enter a Quickstart
+You have many ways to install ejabberd: + using containers, + binary installers, ... + or compile it yourself from the source code. +
+The development section includes details about ejabberd architecture, and how to + extend it in various forms.
+ejabberd provides a comprehensive ReST API, check its + API Reference + Tags, + and learn how to configure it. +
+In addition to view this site online, you can download it as a pdf + and as a static site in zip. +
++ + {% include ".icons/fontawesome/brands/mastodon.svg" %}Follow + @ejabberd on Mastodon + + + {% include ".icons/fontawesome/brands/github.svg" + %}ejabberd repository on GitHub + + + {% include ".icons/fontawesome/brands/github.svg" + %}ejabberd Docs repository on GitHub + + + {% include ".icons/fontawesome/brands/docker.svg" %} + ecs container on DockerHub + + + {% include ".icons/octicons/container-16.svg" %} + ejabberd container on GitHub Container Registry + + + {% include ".icons/material/hexagon-outline.svg" %} + ejabberd package on hex.pm + +
+