doc/Makefile
author Denis Laxalde <denis.laxalde@logilab.fr>
Thu, 09 Mar 2017 16:36:33 +0100
changeset 12053 c3c9f2e1424c
parent 11057 0b59724cb3f2
permissions -rw-r--r--
[pyramid] Add a "pyramid" instance configuration type In a new module 'cubicweb.pyramid.config' we define a "pyramid" instance configuration type. The noticeable feature of this configuration is that it manages a 'development.ini' file that gets installed in application home (along with `.conf` file). This file is templated and includes generated values for secrets of session and authtk tokens. This means that we can just call: pserve etc/cubicweb.d/<appname>/development.ini or gunicorn --paste etc/cubicweb.d/<appname>/development.ini -b :8080 just after instance creation to get a pyramid instance running without having to hack around a 'pyramid.ini' file. This patch drops 'development.ini' from skeleton and moves it in cubicweb/pyramid so that it gets installed at instance creation which is more appropriate than in cube creation. The new configuration class sets "cubicweb.bwcompat" setting to false so it is not intended to replace the "all-in-one" configuration type (which would require a bit more work). This configuration is close to the the 'repository' configuration type with just a couple of options from WebConfiguration that are needed for Pyramid (anonymous user/password plus some miscellaneous options that I'm not so sure are really needed). Note, in particular, that we do not pull CORS settings to be injected as a WSGI middleware like in wsgi_application_from_cwconfig() since I believe this should be left as an end-user responsibility and since this can be defined in a standard way in paste configuration. This configuration inherits from ServerConfiguration but registers the same appobjects as WebConfiguration. In cubicweb.web.request._CubicWebRequestBase, we guard against access to "uiprops" and "datadir_url" of the config because this new "pyramid" config does not have these (this does not make sense without bwcompat mode). At some point, we should either avoid using `cw_request`'s pyramid request attribute or make cubicweb's web request really independant of existing implementation and drop these assumptions.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10491
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     1
SRC=.
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     2
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     3
# You can set these sphinx variables from the command line.
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     4
SPHINXOPTS    =
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     5
SPHINXBUILD   = sphinx-build
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     6
PAPER         =
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     7
#BUILDDIR      = build
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
     8
BUILDDIR      = _build
11057
0b59724cb3f2 Reorganize source tree to have a "cubicweb" top-level package
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 10491
diff changeset
     9
CWDIR         = ../cubicweb
10491
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    10
JSDIR         = ${CWDIR}/web/data
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    11
JSTORST       = tools/pyjsrest.py
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    12
BUILDJS       = js_api
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    13
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    14
# Internal variables for sphinx
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    15
PAPEROPT_a4     = -D latex_paper_size=a4
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    16
PAPEROPT_letter = -D latex_paper_size=letter
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    17
ALLSPHINXOPTS   = -d ${BUILDDIR}/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    18
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    19
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    20
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    21
.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    22
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    23
help:
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    24
	@echo "Please use \`make <target>' where <target> is one of"
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    25
	@echo "  all       to make standalone HTML files, developer manual and API doc"
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    26
	@echo "  html      to make standalone HTML files"
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    27
	@echo "---  "
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    28
	@echo "  pickle    to make pickle files (usable by e.g. sphinx-web)"
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    29
	@echo "  htmlhelp  to make HTML files and a HTML help project"
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    30
	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    31
	@echo "  changes   to make an overview over all changed/added/deprecated items"
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    32
	@echo "  linkcheck to check all external links for integrity"
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    33
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    34
clean:
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    35
	rm -f *.html
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    36
	-rm -rf ${BUILDDIR}/html ${BUILDDIR}/doctrees
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    37
	-rm -rf ${BUILDJS}
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    38
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    39
all: html
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    40
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    41
# run sphinx ###
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    42
html: js
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    43
	mkdir -p ${BUILDDIR}/html ${BUILDDIR}/doctrees
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    44
	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) ${BUILDDIR}/html
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    45
	@echo
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    46
	@echo "Build finished. The HTML pages are in ${BUILDDIR}/html."
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    47
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    48
js:
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    49
	mkdir -p ${BUILDJS}
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    50
	$(JSTORST) -p ${JSDIR} -o ${BUILDJS}
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    51
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    52
pickle:
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    53
	mkdir -p ${BUILDDIR}/pickle ${BUILDDIR}/doctrees
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    54
	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) ${BUILDDIR}/pickle
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    55
	@echo
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    56
	@echo "Build finished; now you can process the pickle files or run"
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    57
	@echo "  sphinx-web ${BUILDDIR}/pickle"
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    58
	@echo "to start the sphinx-web server."
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    59
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    60
web: pickle
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    61
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    62
htmlhelp:
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    63
	mkdir -p ${BUILDDIR}/htmlhelp ${BUILDDIR}/doctrees
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    64
	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) ${BUILDDIR}/htmlhelp
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    65
	@echo
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    66
	@echo "Build finished; now you can run HTML Help Workshop with the" \
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    67
	      ".hhp project file in ${BUILDDIR}/htmlhelp."
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    68
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    69
latex:
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    70
	mkdir -p ${BUILDDIR}/latex ${BUILDDIR}/doctrees
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    71
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) ${BUILDDIR}/latex
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    72
	@echo
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    73
	@echo "Build finished; the LaTeX files are in ${BUILDDIR}/latex."
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    74
	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    75
	      "run these through (pdf)latex."
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    76
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    77
changes:
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    78
	mkdir -p ${BUILDDIR}/changes ${BUILDDIR}/doctrees
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    79
	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) ${BUILDDIR}/changes
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    80
	@echo
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    81
	@echo "The overview file is in ${BUILDDIR}/changes."
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    82
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    83
linkcheck:
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    84
	mkdir -p ${BUILDDIR}/linkcheck ${BUILDDIR}/doctrees
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    85
	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) ${BUILDDIR}/linkcheck
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    86
	@echo
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    87
	@echo "Link check complete; look for any errors in the above output " \
c67bcee93248 [doc] Restructure the documentation
Christophe de Vienne <christophe@unlish.com>
parents:
diff changeset
    88
	      "or in ${BUILDDIR}/linkcheck/output.txt."