Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team manual back2tex #2242

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/jobs/syntax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ $MYDIR/syntax-check

make configure
./configure --with-baseurl='http://localhost/domjudge/' --with-domjudge-user=root
make install-docs
make clean

cd doc/manual/
Expand Down
10 changes: 1 addition & 9 deletions Makefile.global
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,8 @@ ifneq ($(wildcard $(TOPDIR)/paths.mk),)
include $(TOPDIR)/paths.mk
endif

# We should build docs if it not explicitly disabled and we're not
# running "make maintainer-conf" or "make inplace-conf":
# We should build docs if it is explicitly enabled
BUILD_DOCS=no
ifneq ($(DOC_BUILD_ENABLED),no)
ifneq ($(MAKECMDGOALS),maintainer-conf)
ifneq ($(MAKECMDGOALS),inplace-conf)
BUILD_DOCS=yes
endif
endif
endif
export BUILD_DOCS

# Determine revision info:
Expand Down
17 changes: 5 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,13 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_MKDIR_P

# Check option to build documentation. This option is provided to
# allow disabling it.
AC_ARG_ENABLE(doc-build,AS_HELP_STRING([--enable-doc-build],
[enable building documentation (default: yes).]))
[enable building documentation (default: no).]))

if test "x$enable_doc_build" = "xno"; then
AC_SUBST(DOC_BUILD_ENABLED,[no])
else
if test "x$enable_doc_build" = "xyes"; then
AC_SUBST(DOC_BUILD_ENABLED,[yes])
else
AC_SUBST(DOC_BUILD_ENABLED,[no])
fi

# See 'man feature_test_macros' under Linux:
Expand Down Expand Up @@ -330,12 +328,7 @@ echo " * webserver group.....: $WEBSERVER_GROUP"
echo ""
echo " * website base URL....: $BASEURL"
echo ""
echo -n " * documentation.......: AX_VAR_EXPAND($domjudge_docdir)"
if test "x$DOC_BUILD_ENABLED" != xyes ; then
echo " (disabled)"
else
echo ""
fi
echo " * documentation.......: AX_VAR_EXPAND($domjudge_docdir)"
echo ""
echo " * domserver...........: AX_VAR_EXPAND($domserver_root)"
echo " - bin..............: AX_VAR_EXPAND($domserver_bindir)"
Expand Down
1 change: 0 additions & 1 deletion doc/manual/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
/version.py
/substitutions.py
/html
/team
/conf_ref.rst
22 changes: 6 additions & 16 deletions doc/manual/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,51 +18,41 @@ $(SUBST_CONFIGS): %: %.in $(TOPDIR)/paths.mk

config: $(SUBST_CONFIGS)

ifeq ($(BUILD_DOCS),yes)
docs: config
# KLUDGE: call make instead of a dependency so that the html target
# will run after config from inside the doc target.
docs:
$(MAKE) html team
$(MAKE) html

distdocs:
$(MAKE) html team
$(MAKE) html
# Run make clean here to get a cleaner tarball and make sure
# that make distclean returns to the original tarball state.
$(MAKE) clean
endif

install-docs: docs
$(call install_tree,$(DESTDIR)$(domjudge_docdir)/manual,build/html)
$(INSTALL_DATA) -t $(DESTDIR)$(domjudge_docdir)/manual build/domjudge-team-manual.pdf

inplace-install: docs
inplace-install-l:
ln -sf build/html
ln -sf build/team

inplace-uninstall-l:
-rm -f html team
-rm -f html

clean-l:
rm -rf build/doctrees build/team/.doctrees
-$(MAKE) -C build/team clean
rm -rf build/doctrees

maintainer-clean-l:
rm -rf build conf_ref.rst

distclean-l:
-rm -f $(SUBST_CONFIGS) html team
-rm -f $(SUBST_CONFIGS) html

conf_ref.rst: gen_conf_ref.py
./gen_conf_ref.py

html: conf_ref.rst
sphinx-build -M $@ . build $(subst 1,-Q,$(QUIET))

team:
sphinx-build -b latex . build/team $(subst 1,-Q,$(QUIET))
$(MAKE) -C build/team domjudge-team-manual.pdf $(QUIET_REDIRECT)
cp build/team/domjudge-team-manual.pdf build

.PHONY: docs distdocs install-docs inplace-install html team
.PHONY: docs distdocs install-docs inplace-install html
21 changes: 0 additions & 21 deletions doc/manual/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
extensions = [
'sphinx.ext.ifconfig',
# 'sphinx_rtd_theme',
'rst2pdf.pdfbuilder',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -187,8 +186,6 @@
latex_documents = [
(master_doc, 'DOMjudge.tex', 'DOMjudge Documentation',
'DOMjudge Team', 'manual'),
('team', 'domjudge-team-manual.tex', 'DOMjudge Team Manual',
'DOMjudge Team', 'manual'),
]


Expand Down Expand Up @@ -233,21 +230,3 @@


# -- Extension configuration -------------------------------------------------

# Options specifically for the Team manual PDF

pdf_documents = [
('team', u'domjudge-team-manual', u'DOMjudge Team Manual', u'The DOMjudge Developers'),
]

pdf_compressed = True
pdf_stylesheets = ['sphinx','kerning','a4','sphinx-team']

pdf_use_coverpage = False

# This is of string type, not bool. See: https://github.com/rst2pdf/rst2pdf/pull/846
pdf_use_toc = ''

# This is needed to avoid a bug in rst2pdf << 0.94 (Debian buster has 0.93)
# See: https://github.com/rst2pdf/rst2pdf/issues/678
pdf_invariant = False
22 changes: 12 additions & 10 deletions doc/manual/develop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,21 @@ already listed under
:ref:`judgehost <judgehost_requirements>` and
:ref:`submit client <submit_client_requirements>` requirements)::

sudo apt install autoconf automake bats \
python-sphinx python-sphinx-rtd-theme rst2pdf fontconfig python3-yaml latexmk

On Debian 11 (Bullseye) and above, instead install::

sudo apt install autoconf automake bats \
python3-sphinx python3-sphinx-rtd-theme rst2pdf fontconfig python3-yaml \
latexmk texlive-latex-recommended texlive-latex-extra tex-gyre
sudo apt install autoconf automake

When this software is present, bootstrapping can be done by running
``make dist``, which creates the ``configure`` script,
downloads and installs the PHP dependencies via composer and
generates documentation from RST/LaTeX sources.
downloads and installs the PHP dependencies via composer.

Rebuilding the documentation
----------------------------

Should you wish to rebuild the DOMjudge manual, you need the
following software installed::

sudo apt install python3-sphinx python3-yaml

Then run ``make docs`` to rebuild them.

Maintainer mode installation
----------------------------
Expand Down
1 change: 0 additions & 1 deletion doc/manual/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Appendices

.. toctree::
quick-install
team
problem-format
shadow
configuration-reference
11 changes: 3 additions & 8 deletions doc/manual/install-workstation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ to inspect its configuration and options.
Rebuilding team documentation
-----------------------------

The source of the team manual can be found in ``doc/manual/team.rst``.
The source of the team manual can be found in ``doc/team/``.
The team manual can incorporate specific settings of your environment,
most notably the URL of the DOMjudge installation. To achieve this,
rebuild the team manual *after* configuration of the system.
Expand All @@ -84,13 +84,8 @@ When DOMjudge is configured and site-specific configuration set,
the team manual can be generated with the command ``make docs``.
The following should do it on a Debian-like system::

sudo apt install python-sphinx python-sphinx-rtd-theme rst2pdf fontconfig python3-yaml
cd <INSTALL_PATH>/doc/
sudo apt install make texlive-latex-extra texlive-latex-recommended texlive-lang-european
cd <INSTALL_PATH>/docs/team
make docs

On Debian 11 and above, install
``python3-sphinx python3-sphinx-rtd-theme rst2pdf fontconfig python3-yaml`` instead.

The resulting manual will then be found in the ``team/`` subdirectory.

.. _netrc manual page: https://ec.haxx.se/usingcurl/usingcurl-netrc
Loading
Loading