From 4afdfa6055a5ed1599bd8bbab350a11fc2901b22 Mon Sep 17 00:00:00 2001 From: David Rosa Date: Tue, 27 Aug 2019 00:10:54 -0700 Subject: [PATCH] docs: Place warning at the top of every page in /latest/production. - Added warning block to dev docs using _templates/layout.html - Removed copy-pasted warning from install.md and requirements.md - Removed unreleased tag in docs/conf.py that's no longer used Useful ref: https://www.sphinx-doc.org/en/master/templating.html Fixes #13056. --- docs/_templates/layout.html | 26 ++++++++++++++++++++++++++ docs/conf.py | 5 ----- docs/production/install.md | 18 ------------------ docs/production/requirements.md | 18 ------------------ 4 files changed, 26 insertions(+), 41 deletions(-) create mode 100644 docs/_templates/layout.html diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html new file mode 100644 index 0000000000..2900d70020 --- /dev/null +++ b/docs/_templates/layout.html @@ -0,0 +1,26 @@ +{% extends "!layout.html" %} +{% block document %} + + {% if pagename == "production/email-gateway" and release.endswith('+git') %} + +
+

Warning

+

You are reading a development version of the Zulip documentation. These instructions may not correspond to the latest Zulip Server release. + See documentation for the latest stable release.

+
+ {% elif pagename.split("/")[0] == "production" and release.endswith('+git') %} +
+

Warning

+

You are reading a development version of the Zulip documentation. These instructions may not correspond to the latest Zulip Server release. + See documentation for the latest stable release.

+
+ {% endif %} + {{ super() }} +{% endblock %} diff --git a/docs/conf.py b/docs/conf.py index cb0c532588..15582e5c71 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,11 +54,6 @@ version = '2.0+git' # The full version, including alpha/beta/rc tags. release = '2.0.4+git' -# This allows us to insert a warning that appears only on an unreleased -# version, e.g. to say that something is likely to have changed. -if release.endswith('+git'): - tags.add('unreleased') - # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # diff --git a/docs/production/install.md b/docs/production/install.md index 00a0e26836..ecf44866d9 100644 --- a/docs/production/install.md +++ b/docs/production/install.md @@ -1,23 +1,5 @@ # Production Installation - - -```eval_rst -.. only:: unreleased - - .. warning:: - You are reading a **development version** of the Zulip documentation. - These instructions may not correspond to the latest Zulip Server - release. See `documentation for the latest release`__. - -__ https://zulip.readthedocs.io/en/stable/production/install.html -``` - You'll need an Ubuntu or Debian system that satisfies [the installation requirements](../production/requirements.html). Alternatively, you can use a preconfigured diff --git a/docs/production/requirements.md b/docs/production/requirements.md index b8a58f402d..8179c0656b 100644 --- a/docs/production/requirements.md +++ b/docs/production/requirements.md @@ -1,23 +1,5 @@ # Requirements - - -```eval_rst -.. only:: unreleased - - .. warning:: - You are reading a **development version** of the Zulip documentation. - These instructions may not correspond to the latest Zulip Server - release. See `documentation for the latest release`__. - -__ https://zulip.readthedocs.io/en/stable/production/requirements.html -``` - To run a Zulip server, you will need: * A dedicated machine or VM * A supported OS: