Skip to content

Commit e3fee2c

Browse files
committed
[REF][MOV] documentation apocalypse
Prior to this commit, the Odoo documentation was mainly split between two repositories: odoo/odoo/doc and odoo/documentation-user. Some bits of documentation were also hosted elsewhere (e.g., wiki, upgrade, ...). This was causing several problems among which: - The theme, config, Makefile, and similar technical resources had to be duplicated. This resulted in inconsistent layout, features, and build environments from one documentation to another. - Some pages did not fit either documentation as they were relevant for both users and developers. Some were relevant to neither of the two (e.g., DB management). - Cross-doc references had to be absolute links and they broke often. - Merging large image files in the developer documentation would bloat the odoo/odoo repository. Some contributions had to be lightened to avoid merging too many images (e.g., Odoo development tutorials). - Long-time contributors to the user documentation were chilly about going through the merging process of the developer documentation because of the runbot, mergebot, `odoo-dev` repository, etc. - Some contributors would look for the developer documentation in the `odoo/documentation-user` repository. - Community issues about the user documentation were submitted on the `odoo/odoo` repository and vice-versa. Merging all documentations in one repository will allow us to have one place, one theme, one work process, and one set of tools (build environment, ...) for all of the Odoo docs. As this is a good opportunity to revamp the layout of the documentation, a brand new theme replaces the old one. It features a new way to navigate the documentation, centered on the idea of always letting the reader know what is the context (enclosing section, child pages, page structure ...) of the page they are reading. The previous theme would quickly confuse readers as they navigated the documentation and followed cross-application links. The chance is also taken to get rid of all the technical dangling parts, performance issues, and left-overs. Except for some page-specific JS scripts, the Odoo theme Sphinx extension is re-written from scratch based on the latest Sphinx release to benefit from the improvements and ease future contributions. task-2351938 task-2352371 task-2205684 task-2352544 Closes odoo#945
1 parent eac5e9f commit e3fee2c

File tree

2,471 files changed

+39895
-60136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,471 files changed

+39895
-60136
lines changed

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
.*
33
*.mo
44

5-
# sphinx build directories
5+
# Sphinx build files
66
_build/
7-
# venv
8-
bin/
9-
include/
10-
lib/
7+
extensions/odoo_theme/static/style.css
8+
9+
# Dependencies
10+
odoo

Makefile

Lines changed: 60 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -1,194 +1,78 @@
11
# Makefile for Sphinx documentation
2-
#
32

4-
# You can set these variables from the command line.
5-
SPHINXOPTS =
6-
SPHINXBUILD = sphinx-build
7-
PAPER =
8-
BUILDDIR = _build
9-
LESSOPTS =
10-
11-
# User-friendly check for sphinx-build
12-
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
13-
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed; then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively, you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
3+
# Pass WORKERS=auto for parallel build
4+
ifndef WORKERS
5+
WORKERS = 1
146
endif
157

16-
# Internal variables.
17-
PAPEROPT_a4 = -D latex_paper_size=a4
18-
PAPEROPT_letter = -D latex_paper_size=letter
19-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
20-
ALLI18NSPHINXOPTS = -d $(BUILDDIR)/doctrees/$(LANG) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) -D language=$(LANG) .
21-
# the i18n builder cannot share the environment and doctrees with the others
22-
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
8+
SPHINX_BUILD = sphinx-build
9+
CONFIG_DIR = .
10+
SPHINXOPTS = -D project_root=$(ROOT) -D canonical_version=$(CANONICAL_VERSION) \
11+
-D versions=$(VERSIONS) -D languages=$(LANGUAGES) -D language=$(CURRENT_LANG) \
12+
-D is_remote_build=$(IS_REMOTE_BUILD) \
13+
-A google_analytics_key=$(GOOGLE_ANALYTICS_KEY) \
14+
-j $(WORKERS)
15+
SOURCE_DIR = content
16+
BUILD_DIR = _build
17+
18+
HTML_BUILD_DIR = $(BUILD_DIR)/html
19+
ifdef VERSIONS
20+
HTML_BUILD_DIR := $(HTML_BUILD_DIR)/12.0
21+
endif
22+
ifneq ($(CURRENT_LANG),en)
23+
HTML_BUILD_DIR := $(HTML_BUILD_DIR)/$(CURRENT_LANG)
24+
endif
2325

24-
lessfiles = _extensions/odoo/static/*.less
25-
_extensions/odoo/static/style.css: $(lessfiles)
26-
lessc $(LESSOPTS) $(subst .css,.less,$@) $@
26+
#=== Standard rules ===#
2727

28-
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
28+
# In first position to build the documentation from scratch by default
29+
all: html
2930

30-
# Displays list of commands
3131
help:
32-
@echo "Please use \`make <target>' where <target> is one of"
33-
@echo " clean to delete the build"
34-
@echo " html to make standalone HTML files"
35-
@echo " i18nhtml to make standalone translated HTML files"
36-
@echo " dirhtml to make HTML files named index.html in directories"
37-
@echo " singlehtml to make a single large HTML file"
38-
@echo " pickle to make pickle files"
39-
@echo " json to make JSON files"
40-
@echo " htmlhelp to make HTML files and an HTML help project"
41-
@echo " qthelp to make HTML files and a qthelp project"
42-
@echo " devhelp to make HTML files and a Devhelp project"
43-
@echo " epub to make an epub"
44-
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
45-
@echo " latexpdf to make LaTeX files and run them through pdflatex"
46-
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
47-
@echo " text to make text files"
48-
@echo " man to make manual pages"
49-
@echo " texinfo to make Texinfo files"
50-
@echo " info to make Texinfo files and run them through makeinfo"
51-
@echo " gettext to make PO message catalogs"
52-
@echo " changes to make an overview of all changed/added/deprecated items"
53-
@echo " xml to make Docutils-native XML files"
54-
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
55-
@echo " linkcheck to check all external links for integrity"
56-
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
32+
@echo "Please use 'make <target>' where <target> is one of"
33+
@echo " html to build the documentation to HTML"
34+
@echo " fast to build the documentation to HTML with shallow menu (faster)"
35+
@echo " clean to delete the build files"
5736

58-
# Deletes the build
5937
clean:
60-
rm -rf $(BUILDDIR)/*
61-
62-
# These commands are used to create files or run tests
63-
html: _extensions/odoo/static/style.css
64-
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
65-
@echo
66-
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
67-
68-
i18nhtml: _extensions/odoo/static/style.css
69-
$(SPHINXBUILD) -b html $(ALLI18NSPHINXOPTS) $(BUILDDIR)/html/$(LANG)
70-
@echo
71-
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/$(LANG)."
72-
73-
dirhtml:
74-
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
75-
@echo
76-
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
77-
78-
singlehtml:
79-
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
80-
@echo
81-
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
82-
83-
pickle:
84-
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
85-
@echo
86-
@echo "Build finished. Now you can process the pickle files."
87-
88-
json:
89-
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
90-
@echo
91-
@echo "Build finished. Now you can process the JSON files."
92-
93-
htmlhelp:
94-
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
95-
@echo
96-
@echo "Build finished. Now you can run HTML Help Workshop with the" \
97-
".hhp project file in $(BUILDDIR)/htmlhelp."
98-
99-
qthelp:
100-
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
101-
@echo
102-
@echo "Build finished. Now you can run "qcollectiongenerator" with the" \
103-
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
104-
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/UnderstandingAccountingForEntrepreneurs.qhcp"
105-
@echo "To view the help file:"
106-
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/UnderstandingAccountingForEntrepreneurs.qhc"
107-
108-
devhelp:
109-
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
110-
@echo
38+
@echo "Cleaning build files..."
39+
rm -rf $(BUILD_DIR)/*
40+
rm extensions/odoo_theme/static/style.css
41+
@echo "Cleaning finished."
42+
43+
html: extensions/odoo_theme/static/style.css
44+
@echo "Starting build..."
45+
$(SPHINX_BUILD) -c $(CONFIG_DIR) -b html $(SPHINXOPTS) $(SOURCE_DIR) $(HTML_BUILD_DIR)
11146
@echo "Build finished."
112-
@echo "To view the help file:"
113-
@echo "# mkdir -p $$HOME/.local/share/devhelp/UnderstandingAccountingForEntrepreneurs"
114-
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/UnderstandingAccountingForEntrepreneurs"
115-
@echo "# devhelp"
116-
117-
epub:
118-
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
119-
@echo
120-
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
121-
122-
latex:
123-
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
124-
@echo
125-
@echo "Build finished. The LaTeX files are in $(BUILDDIR)/latex."
126-
@echo "Run \`make' in that directory to run these through (pdf)latex" \
127-
"(use \`make latexpdf' here to do that automatically)."
12847

48+
# To call *after* `make html`
49+
# Binary dependencies (Debian): texlive-fonts-recommended texlive-latex-extra
50+
# texlive-generic-recommended texlive-fonts-extra
12951
latexpdf:
130-
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
131-
@echo "Running LaTeX files through pdflatex..."
132-
$(MAKE) -C $(BUILDDIR)/latex all-pdf
133-
@echo "pdflatex finished. The PDF files are in $(BUILDDIR)/latex."
134-
cp $(BUILDDIR)/latex/*.pdf $(BUILDDIR)/html/
135-
136-
latexpdfja:
137-
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
138-
@echo "Running LaTeX files through platex and dvipdfmx..."
139-
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
140-
@echo "pdflatex finished. The PDF files are in $(BUILDDIR)/latex."
141-
142-
text:
143-
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
144-
@echo
145-
@echo "Build finished. The text files are in $(BUILDDIR)/text."
146-
147-
man:
148-
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
149-
@echo
150-
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
151-
152-
texinfo:
153-
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
154-
@echo
155-
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
156-
@echo "Run \`make' in that directory to run these through makeinfo" \
157-
"(use \`make info' here to do that automatically)."
158-
159-
info:
160-
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
161-
@echo "Running Texinfo files through makeinfo..."
162-
make -C $(BUILDDIR)/texinfo info
163-
@echo "makeinfo finished. The Info files are in $(BUILDDIR)/texinfo."
164-
165-
gettext:
166-
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) locale/sources
167-
@echo
168-
@echo "Build finished. The message catalogs are in locale/sources."
52+
@echo "Starting build..."
53+
$(SPHINX_BUILD) -c $(CONFIG_DIR) -b latex $(SPHINXOPTS) $(SOURCE_DIR) $(BUILD_DIR)/latex
54+
$(MAKE) -C $(BUILD_DIR)/latex
55+
cp $(BUILD_DIR)/latex/*.pdf $(BUILD_DIR)/html/
56+
@echo "Build finished."
16957

170-
changes:
171-
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
172-
@echo
173-
@echo "The overview file is in $(BUILDDIR)/changes."
58+
l10n:
59+
@echo "Generating translatable files..."
60+
$(SPHINX_BUILD) -c $(CONFIG_DIR) -b gettext $(SOURCE_DIR) $(BUILD_DIR)/gettext
61+
@echo "Generation finished."
62+
@echo "Localizing translation strings..."
63+
sphinx-intl update -p $(BUILD_DIR)/gettext -l $(L10N_LANGUAGES)
64+
@echo "Localization finished."
17465

175-
linkcheck:
176-
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
177-
@echo
178-
@echo "Link check complete. Look for any errors in the above output " \
179-
"or in $(BUILDDIR)/linkcheck/output.txt."
66+
extensions/odoo_theme/static/style.css: extensions/odoo_theme/static/style.scss extensions/odoo_theme/static/scss/*.scss
67+
@echo "Compiling stylesheets..."
68+
pysassc $(subst .css,.scss,$@) $@
69+
@echo "Compilation finished."
18070

181-
doctest:
182-
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
183-
@echo "Testing of doctests in the sources finished. Look at the " \
184-
"results in $(BUILDDIR)/doctest/output.txt."
71+
#=== Development and debugging rules ===#
18572

186-
xml:
187-
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
188-
@echo
189-
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
73+
fast: SPHINXOPTS += -A collapse_menu=True -j auto
74+
fast: html
19075

191-
pseudoxml:
192-
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
193-
@echo
194-
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
76+
static: extensions/odoo_theme/static/style.css
77+
cp -r extensions/odoo_theme/static/* _build/html/_static/
78+
cp -r static/* _build/html/_static/

0 commit comments

Comments
 (0)