[FIX] doc: latex building
* add latex support for exercise admonition
* latex freezes/crashes on {HEAVY WIDE-HEADED RIGHTWARDS ARROW} so
replace them by more manual arrows
* add some preamble configuration, may not even be necessary
* generate WS setup code only in HTML output. WS doc in latex still
isn't great as it displays all 4 languages one after the other,
ideally they should be tagged or something, so only one language at a
time is generated in non-HTML outputs
This commit is contained in:
Vendored
+3
@@ -15,6 +15,9 @@ def setup(app):
|
|||||||
app.add_node(exercise, html=(
|
app.add_node(exercise, html=(
|
||||||
lambda self, node: self.visit_admonition(node, 'exercise'),
|
lambda self, node: self.visit_admonition(node, 'exercise'),
|
||||||
lambda self, node: self.depart_admonition(node)
|
lambda self, node: self.depart_admonition(node)
|
||||||
|
), latex=(
|
||||||
|
lambda self, node: self.visit_admonition(node),
|
||||||
|
lambda self, node: self.depart_admonition(node)
|
||||||
))
|
))
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|||||||
+47
-45
@@ -24,64 +24,66 @@ Connection and authentication
|
|||||||
|
|
||||||
.. kinda gross because it duplicates existing bits
|
.. kinda gross because it duplicates existing bits
|
||||||
|
|
||||||
.. rst-class:: setupcode hidden
|
.. only:: html
|
||||||
|
|
||||||
.. code-block:: python
|
.. rst-class:: setupcode hidden
|
||||||
|
|
||||||
import xmlrpclib
|
.. code-block:: python
|
||||||
info = xmlrpclib.ServerProxy('https://demo.odoo.com/start').start()
|
|
||||||
url, db, username, password = \
|
|
||||||
info['host'], info['database'], info['user'], info['password']
|
|
||||||
common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))
|
|
||||||
uid = common.authenticate(db, username, password, {})
|
|
||||||
models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))
|
|
||||||
|
|
||||||
.. code-block:: ruby
|
import xmlrpclib
|
||||||
|
info = xmlrpclib.ServerProxy('https://demo.odoo.com/start').start()
|
||||||
|
url, db, username, password = \
|
||||||
|
info['host'], info['database'], info['user'], info['password']
|
||||||
|
common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))
|
||||||
|
uid = common.authenticate(db, username, password, {})
|
||||||
|
models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))
|
||||||
|
|
||||||
require "xmlrpc/client"
|
.. code-block:: ruby
|
||||||
info = XMLRPC::Client.new2('https://demo.odoo.com/start').call('start')
|
|
||||||
url, db, username, password = \
|
|
||||||
info['host'], info['database'], info['user'], info['password']
|
|
||||||
common = XMLRPC::Client.new2("#{url}/xmlrpc/2/common")
|
|
||||||
uid = common.call('authenticate', db, username, password, {})
|
|
||||||
models = XMLRPC::Client.new2("#{url}/xmlrpc/2/object").proxy
|
|
||||||
|
|
||||||
.. code-block:: php
|
require "xmlrpc/client"
|
||||||
|
info = XMLRPC::Client.new2('https://demo.odoo.com/start').call('start')
|
||||||
|
url, db, username, password = \
|
||||||
|
info['host'], info['database'], info['user'], info['password']
|
||||||
|
common = XMLRPC::Client.new2("#{url}/xmlrpc/2/common")
|
||||||
|
uid = common.call('authenticate', db, username, password, {})
|
||||||
|
models = XMLRPC::Client.new2("#{url}/xmlrpc/2/object").proxy
|
||||||
|
|
||||||
require_once('ripcord.php');
|
.. code-block:: php
|
||||||
$info = ripcord::client('https://demo.odoo.com/start')->start();
|
|
||||||
list($url, $db, $username, $password) =
|
|
||||||
array($info['host'], $info['database'], $info['user'], $info['password']);
|
|
||||||
$common = ripcord::client("$url/xmlrpc/2/common");
|
|
||||||
$uid = $common->authenticate($db, $username, $password, array());
|
|
||||||
$models = ripcord::client("$url/xmlrpc/2/object");
|
|
||||||
|
|
||||||
.. code-block:: java
|
require_once('ripcord.php');
|
||||||
|
$info = ripcord::client('https://demo.odoo.com/start')->start();
|
||||||
|
list($url, $db, $username, $password) =
|
||||||
|
array($info['host'], $info['database'], $info['user'], $info['password']);
|
||||||
|
$common = ripcord::client("$url/xmlrpc/2/common");
|
||||||
|
$uid = $common->authenticate($db, $username, $password, array());
|
||||||
|
$models = ripcord::client("$url/xmlrpc/2/object");
|
||||||
|
|
||||||
final XmlRpcClient client = new XmlRpcClient();
|
.. code-block:: java
|
||||||
|
|
||||||
final XmlRpcClientConfigImpl start_config = new XmlRpcClientConfigImpl();
|
final XmlRpcClient client = new XmlRpcClient();
|
||||||
start_config.setServerURL(new URL("https://demo.odoo.com/start"));
|
|
||||||
final Map<String, String> info = (Map<String, String>)client.execute(
|
|
||||||
start_config, "start", Collections.emptyList());
|
|
||||||
|
|
||||||
final String url = info.get("host"),
|
final XmlRpcClientConfigImpl start_config = new XmlRpcClientConfigImpl();
|
||||||
db = info.get("database"),
|
start_config.setServerURL(new URL("https://demo.odoo.com/start"));
|
||||||
username = info.get("user"),
|
final Map<String, String> info = (Map<String, String>)client.execute(
|
||||||
password = info.get("password");
|
start_config, "start", Collections.emptyList());
|
||||||
|
|
||||||
final XmlRpcClientConfigImpl common_config = new XmlRpcClientConfigImpl();
|
final String url = info.get("host"),
|
||||||
common_config.setServerURL(new URL(String.format("%s/xmlrpc/2/common", url)));
|
db = info.get("database"),
|
||||||
|
username = info.get("user"),
|
||||||
|
password = info.get("password");
|
||||||
|
|
||||||
int uid = (int)client.execute(
|
final XmlRpcClientConfigImpl common_config = new XmlRpcClientConfigImpl();
|
||||||
common_config, "authenticate", Arrays.asList(
|
common_config.setServerURL(new URL(String.format("%s/xmlrpc/2/common", url)));
|
||||||
db, username, password, Collections.emptyMap()));
|
|
||||||
|
|
||||||
final XmlRpcClient models = new XmlRpcClient() {{
|
int uid = (int)client.execute(
|
||||||
setConfig(new XmlRpcClientConfigImpl() {{
|
common_config, "authenticate", Arrays.asList(
|
||||||
setServerURL(new URL(String.format("%s/xmlrpc/2/object", url)));
|
db, username, password, Collections.emptyMap()));
|
||||||
}});
|
|
||||||
}};
|
final XmlRpcClient models = new XmlRpcClient() {{
|
||||||
|
setConfig(new XmlRpcClientConfigImpl() {{
|
||||||
|
setServerURL(new URL(String.format("%s/xmlrpc/2/object", url)));
|
||||||
|
}});
|
||||||
|
}};
|
||||||
|
|
||||||
Configuration
|
Configuration
|
||||||
-------------
|
-------------
|
||||||
|
|||||||
@@ -166,6 +166,12 @@ html_sidebars = {
|
|||||||
# base URL from which the finished HTML is served.
|
# base URL from which the finished HTML is served.
|
||||||
#html_use_opensearch = ''
|
#html_use_opensearch = ''
|
||||||
|
|
||||||
|
latex_elements = {
|
||||||
|
'papersize': r'a4paper',
|
||||||
|
'preamble': u'''\\setcounter{tocdepth}{2}
|
||||||
|
''',
|
||||||
|
}
|
||||||
|
|
||||||
# default must be set otherwise ifconfig blows up
|
# default must be set otherwise ifconfig blows up
|
||||||
todo_include_todos = False
|
todo_include_todos = False
|
||||||
|
|
||||||
|
|||||||
@@ -1241,10 +1241,10 @@ Workflows are also used to track processes that evolve over time.
|
|||||||
In the session form, add a (read-only) field to
|
In the session form, add a (read-only) field to
|
||||||
visualize the state, and buttons to change it. The valid transitions are:
|
visualize the state, and buttons to change it. The valid transitions are:
|
||||||
|
|
||||||
* Draft ➔ Confirmed
|
* Draft -> Confirmed
|
||||||
* Confirmed ➔ Draft
|
* Confirmed -> Draft
|
||||||
* Confirmed ➔ Done
|
* Confirmed -> Done
|
||||||
* Done ➔ Draft
|
* Done -> Draft
|
||||||
|
|
||||||
.. only:: solutions
|
.. only:: solutions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user