From 5e10c0b6a02e4382057ac7bd0f3924cf61f54775 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Fri, 25 Mar 2022 16:22:55 +0100 Subject: build languages in their subdir & add version by separating builders commands from the other, we can directly choose the output dir --- Makefile | 20 +++++++++++++------- README.md | 7 +++++++ conf.py | 1 + 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c42af71..8f8e08e 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ # Minimal makefile for Sphinx documentation # # You can set these variables from the command line. -override LOCALE := $(or $(LOCALE),fr) +LOCALE ?= fr PUBHOST ?= club1.fr -PUBDIR ?= /var/www/docs/$(LOCALE) +PUBDIR ?= /var/www/docs ifneq "$(LOCALE)" "fr" override NOTFR = 1 @@ -14,7 +14,7 @@ endif SPHINXLANG = -D language=$(LOCALE) SPHINXOPTS += -a SPHINXBUILD ?= sphinx-build -SPHINXLCMDS = html dirhtml singlehtml epub latex latexpdf latexpdfja text man texinfo info +SPHINXBUILDERS = html dirhtml singlehtml epub latex text man texinfo SPHINXCMDS = pickle json htmlhelp changes xml pseudoxml linkcheck doctest coverage SOURCEDIR = . BUILDDIR = _build @@ -27,7 +27,7 @@ DIRS = locales help: $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $O -.PHONY: help clean update-po gettext publish $(SPHINXLCMDS) $(SPHINXCMDS) +.PHONY: help clean update-po gettext latexpdf info publish $(SPHINXBUILDERS) $(SPHINXCMDS) update-po: $(LOCALEFILES) @@ -47,12 +47,18 @@ $(BUILDDIR)/gettext/package.pot: $(MDFILES) $(SPHINXBUILD) -M gettext "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $O @touch $@ +latexpdf: latex + $(MAKE) -C $(BUILDDIR)/latex/$(LOCALE) + +info: texinfo + $(MAKE) -C $(BUILDDIR)/texinfo/$(LOCALE) + publish: html rsync -av --del _build/html/ $(USER)@$(PUBHOST):$(PUBDIR) -# Shinx commands that need locales. -$(SPHINXLCMDS): $(if $(NOTFR),locales/$(LOCALE)/LC_MESSAGES/package.po) - $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXLANG) $(SPHINXOPTS) $O +# Shinx commands that need locales (builders). +$(SPHINXBUILDERS): $(if $(NOTFR),locales/$(LOCALE)/LC_MESSAGES/package.po) + $(SPHINXBUILD) -b $@ "$(SOURCEDIR)" "$(BUILDDIR)/$@/$(LOCALE)" $(SPHINXLANG) $(SPHINXOPTS) $O # Other Sphinx commands for autocompletion $(SPHINXCMDS): diff --git a/README.md b/README.md index 60f6958..4db858f 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,13 @@ Documentation CLUB1 Ce dépôt contient la documentation de CLUB1. +Références +---------- + +- https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html +- https://docs.readthedocs.io/en/stable/guides/cross-referencing-with-sphinx.html +- https://tech.michaelaltfield.net/2020/07/18/sphinx-rtd-github-pages-1/ + Prérequis --------- diff --git a/conf.py b/conf.py index e14ffdc..b1d849d 100644 --- a/conf.py +++ b/conf.py @@ -20,6 +20,7 @@ project = 'Hébergement CLUB1' copyright = '2022, Nicolas PEUGNET' author = 'Nicolas PEUGNET' +version = 'main' # -- General configuration --------------------------------------------------- -- cgit v1.2.3