ansible nginx
@ -0,0 +1 @@
|
|||||||
|
server1 ansible_host="mistergwen.site" ansible_ssh_user="ubuntu" ansible_python_interpreter="/usr/bin/python3"
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
- hosts: server1
|
||||||
|
#remote_user: debian
|
||||||
|
become: true
|
||||||
|
become_method: sudo
|
||||||
|
tasks:
|
||||||
|
- name: ensure nginx is at the latest version
|
||||||
|
apt: name=nginx state=latest
|
||||||
|
- name: start nginx
|
||||||
|
service:
|
||||||
|
name: nginx
|
||||||
|
state: started
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
- name: Installation et configuration de Nginx
|
||||||
|
hosts: oracle-server
|
||||||
|
become: yes # Utilise sudo pour les commandes
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: Mettre à jour les paquets apt
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
cache_valid_time: 3600 # Cache valide pendant 1 heure
|
||||||
|
|
||||||
|
- name: Installer Nginx
|
||||||
|
apt:
|
||||||
|
name: nginx
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Démarrer et activer Nginx
|
||||||
|
service:
|
||||||
|
name: nginx
|
||||||
|
state: started
|
||||||
|
enabled: yes
|
||||||
|
|
||||||
|
- name: Générer le certificat et mettre en place le HTTPS
|
||||||
|
command: /usr/bin/certbot --nginx -d oscar.nicolas-bardin.ovh --email rouquette.oscar@gmail.com --agree-tos --redirect --non-interactive --quiet
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
- hosts: server1
|
||||||
|
#remote_user: debian
|
||||||
|
become: true
|
||||||
|
become_method: sudo
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: Update & upgrade system
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
upgrade: dist
|
||||||
|
|
||||||
|
- name: Install required packages
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- cron
|
||||||
|
- python3-pip
|
||||||
|
- python3-virtualenv
|
||||||
|
- python3-setuptools
|
||||||
|
- htop
|
||||||
|
- man
|
||||||
|
- net-tools
|
||||||
|
- bash-completion
|
||||||
|
- locales
|
||||||
|
- python-is-python3
|
||||||
|
- wget
|
||||||
|
- zip
|
||||||
|
- bzip2
|
||||||
|
- tree
|
||||||
|
- vim
|
||||||
|
- vim-common
|
||||||
|
- screen
|
||||||
|
- curl
|
||||||
|
- unzip
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Remove useless stuff
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- bind9
|
||||||
|
- telnet
|
||||||
|
- ftp
|
||||||
|
state: absent
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
ansible-playbook -i hosts playbook.yml
|
||||||
@ -1,17 +0,0 @@
|
|||||||
let headers = new Headers();
|
|
||||||
headers.append("Authorization", "Bearer 53fee4e31a06d538bd18562e7eb3450ce714e63f");
|
|
||||||
|
|
||||||
var formdata = new FormData();
|
|
||||||
formdata.append("name", "exercices");
|
|
||||||
|
|
||||||
var options = {
|
|
||||||
method: 'POST',
|
|
||||||
headers: headers,
|
|
||||||
body: formdata,
|
|
||||||
redirect: 'follow'
|
|
||||||
};
|
|
||||||
|
|
||||||
fetch("https://forge.gwenaelremond.fr/api/v1/user/repos", options)
|
|
||||||
.then(response => response.text())
|
|
||||||
.then(result => console.log(result))
|
|
||||||
.catch(error => console.log('error', error));
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
"""
|
|
||||||
curl -X 'POST' \
|
|
||||||
'https://forge.gwenaelremond.fr/api/v1/admin/users' \
|
|
||||||
-H 'accept: application/json' \
|
|
||||||
-H 'Authorization: token XXXX'\
|
|
||||||
-H 'Content-Type: application/json' \
|
|
||||||
-d '{
|
|
||||||
"email": "user@example.com",
|
|
||||||
"full_name": "dupont",
|
|
||||||
"login_name": "dupont",
|
|
||||||
"must_change_password": true,
|
|
||||||
"password": "blabla%TulPoint45",
|
|
||||||
"restricted": true,
|
|
||||||
"send_notify": false,
|
|
||||||
"source_id": 0,
|
|
||||||
"username": "dupont"
|
|
||||||
|
|
||||||
}'
|
|
||||||
"""
|
|
||||||
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
# Minimal makefile for Sphinx documentation
|
|
||||||
#
|
|
||||||
|
|
||||||
# You can set these variables from the command line, and also
|
|
||||||
# from the environment for the first two.
|
|
||||||
SPHINXOPTS ?=
|
|
||||||
SPHINXBUILD ?= sphinx-build
|
|
||||||
SOURCEDIR = .
|
|
||||||
BUILDDIR = _build
|
|
||||||
|
|
||||||
# Put it first so that "make" without argument is like "make help".
|
|
||||||
help:
|
|
||||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
||||||
|
|
||||||
.PHONY: help Makefile
|
|
||||||
|
|
||||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
||||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
||||||
%: Makefile
|
|
||||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
# Sphinx build info version 1
|
|
||||||
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
|
|
||||||
config: 7be7baf0b81831c5cc24a8fa58277187
|
|
||||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
|
||||||
|
Before Width: | Height: | Size: 733 KiB |
@ -1,6 +0,0 @@
|
|||||||
La roulette
|
|
||||||
=====================
|
|
||||||
|
|
||||||
.. index:: roulette
|
|
||||||
|
|
||||||
La roulette c'est **super** chouette
|
|
||||||
|
Before Width: | Height: | Size: 78 B |
@ -1,294 +0,0 @@
|
|||||||
/**@constructor*/
|
|
||||||
BaseStemmer = function() {
|
|
||||||
this.setCurrent = function(value) {
|
|
||||||
this.current = value;
|
|
||||||
this.cursor = 0;
|
|
||||||
this.limit = this.current.length;
|
|
||||||
this.limit_backward = 0;
|
|
||||||
this.bra = this.cursor;
|
|
||||||
this.ket = this.limit;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getCurrent = function() {
|
|
||||||
return this.current;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.copy_from = function(other) {
|
|
||||||
this.current = other.current;
|
|
||||||
this.cursor = other.cursor;
|
|
||||||
this.limit = other.limit;
|
|
||||||
this.limit_backward = other.limit_backward;
|
|
||||||
this.bra = other.bra;
|
|
||||||
this.ket = other.ket;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.in_grouping = function(s, min, max) {
|
|
||||||
if (this.cursor >= this.limit) return false;
|
|
||||||
var ch = this.current.charCodeAt(this.cursor);
|
|
||||||
if (ch > max || ch < min) return false;
|
|
||||||
ch -= min;
|
|
||||||
if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false;
|
|
||||||
this.cursor++;
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.in_grouping_b = function(s, min, max) {
|
|
||||||
if (this.cursor <= this.limit_backward) return false;
|
|
||||||
var ch = this.current.charCodeAt(this.cursor - 1);
|
|
||||||
if (ch > max || ch < min) return false;
|
|
||||||
ch -= min;
|
|
||||||
if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false;
|
|
||||||
this.cursor--;
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.out_grouping = function(s, min, max) {
|
|
||||||
if (this.cursor >= this.limit) return false;
|
|
||||||
var ch = this.current.charCodeAt(this.cursor);
|
|
||||||
if (ch > max || ch < min) {
|
|
||||||
this.cursor++;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
ch -= min;
|
|
||||||
if ((s[ch >>> 3] & (0X1 << (ch & 0x7))) == 0) {
|
|
||||||
this.cursor++;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.out_grouping_b = function(s, min, max) {
|
|
||||||
if (this.cursor <= this.limit_backward) return false;
|
|
||||||
var ch = this.current.charCodeAt(this.cursor - 1);
|
|
||||||
if (ch > max || ch < min) {
|
|
||||||
this.cursor--;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
ch -= min;
|
|
||||||
if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) {
|
|
||||||
this.cursor--;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.eq_s = function(s)
|
|
||||||
{
|
|
||||||
if (this.limit - this.cursor < s.length) return false;
|
|
||||||
if (this.current.slice(this.cursor, this.cursor + s.length) != s)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
this.cursor += s.length;
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.eq_s_b = function(s)
|
|
||||||
{
|
|
||||||
if (this.cursor - this.limit_backward < s.length) return false;
|
|
||||||
if (this.current.slice(this.cursor - s.length, this.cursor) != s)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
this.cursor -= s.length;
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** @return {number} */ this.find_among = function(v)
|
|
||||||
{
|
|
||||||
var i = 0;
|
|
||||||
var j = v.length;
|
|
||||||
|
|
||||||
var c = this.cursor;
|
|
||||||
var l = this.limit;
|
|
||||||
|
|
||||||
var common_i = 0;
|
|
||||||
var common_j = 0;
|
|
||||||
|
|
||||||
var first_key_inspected = false;
|
|
||||||
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
var k = i + ((j - i) >>> 1);
|
|
||||||
var diff = 0;
|
|
||||||
var common = common_i < common_j ? common_i : common_j; // smaller
|
|
||||||
// w[0]: string, w[1]: substring_i, w[2]: result, w[3]: function (optional)
|
|
||||||
var w = v[k];
|
|
||||||
var i2;
|
|
||||||
for (i2 = common; i2 < w[0].length; i2++)
|
|
||||||
{
|
|
||||||
if (c + common == l)
|
|
||||||
{
|
|
||||||
diff = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
diff = this.current.charCodeAt(c + common) - w[0].charCodeAt(i2);
|
|
||||||
if (diff != 0) break;
|
|
||||||
common++;
|
|
||||||
}
|
|
||||||
if (diff < 0)
|
|
||||||
{
|
|
||||||
j = k;
|
|
||||||
common_j = common;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
i = k;
|
|
||||||
common_i = common;
|
|
||||||
}
|
|
||||||
if (j - i <= 1)
|
|
||||||
{
|
|
||||||
if (i > 0) break; // v->s has been inspected
|
|
||||||
if (j == i) break; // only one item in v
|
|
||||||
|
|
||||||
// - but now we need to go round once more to get
|
|
||||||
// v->s inspected. This looks messy, but is actually
|
|
||||||
// the optimal approach.
|
|
||||||
|
|
||||||
if (first_key_inspected) break;
|
|
||||||
first_key_inspected = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
do {
|
|
||||||
var w = v[i];
|
|
||||||
if (common_i >= w[0].length)
|
|
||||||
{
|
|
||||||
this.cursor = c + w[0].length;
|
|
||||||
if (w.length < 4) return w[2];
|
|
||||||
var res = w[3](this);
|
|
||||||
this.cursor = c + w[0].length;
|
|
||||||
if (res) return w[2];
|
|
||||||
}
|
|
||||||
i = w[1];
|
|
||||||
} while (i >= 0);
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
// find_among_b is for backwards processing. Same comments apply
|
|
||||||
this.find_among_b = function(v)
|
|
||||||
{
|
|
||||||
var i = 0;
|
|
||||||
var j = v.length
|
|
||||||
|
|
||||||
var c = this.cursor;
|
|
||||||
var lb = this.limit_backward;
|
|
||||||
|
|
||||||
var common_i = 0;
|
|
||||||
var common_j = 0;
|
|
||||||
|
|
||||||
var first_key_inspected = false;
|
|
||||||
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
var k = i + ((j - i) >> 1);
|
|
||||||
var diff = 0;
|
|
||||||
var common = common_i < common_j ? common_i : common_j;
|
|
||||||
var w = v[k];
|
|
||||||
var i2;
|
|
||||||
for (i2 = w[0].length - 1 - common; i2 >= 0; i2--)
|
|
||||||
{
|
|
||||||
if (c - common == lb)
|
|
||||||
{
|
|
||||||
diff = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
diff = this.current.charCodeAt(c - 1 - common) - w[0].charCodeAt(i2);
|
|
||||||
if (diff != 0) break;
|
|
||||||
common++;
|
|
||||||
}
|
|
||||||
if (diff < 0)
|
|
||||||
{
|
|
||||||
j = k;
|
|
||||||
common_j = common;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
i = k;
|
|
||||||
common_i = common;
|
|
||||||
}
|
|
||||||
if (j - i <= 1)
|
|
||||||
{
|
|
||||||
if (i > 0) break;
|
|
||||||
if (j == i) break;
|
|
||||||
if (first_key_inspected) break;
|
|
||||||
first_key_inspected = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
do {
|
|
||||||
var w = v[i];
|
|
||||||
if (common_i >= w[0].length)
|
|
||||||
{
|
|
||||||
this.cursor = c - w[0].length;
|
|
||||||
if (w.length < 4) return w[2];
|
|
||||||
var res = w[3](this);
|
|
||||||
this.cursor = c - w[0].length;
|
|
||||||
if (res) return w[2];
|
|
||||||
}
|
|
||||||
i = w[1];
|
|
||||||
} while (i >= 0);
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* to replace chars between c_bra and c_ket in this.current by the
|
|
||||||
* chars in s.
|
|
||||||
*/
|
|
||||||
this.replace_s = function(c_bra, c_ket, s)
|
|
||||||
{
|
|
||||||
var adjustment = s.length - (c_ket - c_bra);
|
|
||||||
this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
|
|
||||||
this.limit += adjustment;
|
|
||||||
if (this.cursor >= c_ket) this.cursor += adjustment;
|
|
||||||
else if (this.cursor > c_bra) this.cursor = c_bra;
|
|
||||||
return adjustment;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.slice_check = function()
|
|
||||||
{
|
|
||||||
if (this.bra < 0 ||
|
|
||||||
this.bra > this.ket ||
|
|
||||||
this.ket > this.limit ||
|
|
||||||
this.limit > this.current.length)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.slice_from = function(s)
|
|
||||||
{
|
|
||||||
var result = false;
|
|
||||||
if (this.slice_check())
|
|
||||||
{
|
|
||||||
this.replace_s(this.bra, this.ket, s);
|
|
||||||
result = true;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.slice_del = function()
|
|
||||||
{
|
|
||||||
return this.slice_from("");
|
|
||||||
};
|
|
||||||
|
|
||||||
this.insert = function(c_bra, c_ket, s)
|
|
||||||
{
|
|
||||||
var adjustment = this.replace_s(c_bra, c_ket, s);
|
|
||||||
if (c_bra <= this.bra) this.bra += adjustment;
|
|
||||||
if (c_bra <= this.ket) this.ket += adjustment;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.slice_to = function()
|
|
||||||
{
|
|
||||||
var result = '';
|
|
||||||
if (this.slice_check())
|
|
||||||
{
|
|
||||||
result = this.current.slice(this.bra, this.ket);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.assign_to = function()
|
|
||||||
{
|
|
||||||
return this.current.slice(0, this.limit);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@ -1,914 +0,0 @@
|
|||||||
/*
|
|
||||||
* Sphinx stylesheet -- basic theme.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* -- main layout ----------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.clearer {
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.section::after {
|
|
||||||
display: block;
|
|
||||||
content: '';
|
|
||||||
clear: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- relbar ---------------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.related {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related h3 {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related ul {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 0 0 10px;
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related li {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related li.right {
|
|
||||||
float: right;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- sidebar --------------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.sphinxsidebarwrapper {
|
|
||||||
padding: 10px 5px 0 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar {
|
|
||||||
float: left;
|
|
||||||
width: 210px;
|
|
||||||
margin-left: -100%;
|
|
||||||
font-size: 90%;
|
|
||||||
word-wrap: break-word;
|
|
||||||
overflow-wrap : break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar ul {
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar ul ul,
|
|
||||||
div.sphinxsidebar ul.want-points {
|
|
||||||
margin-left: 20px;
|
|
||||||
list-style: square;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar ul ul {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar form {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar input {
|
|
||||||
border: 1px solid #98dbcc;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-size: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar #searchbox form.search {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar #searchbox input[type="text"] {
|
|
||||||
float: left;
|
|
||||||
width: 80%;
|
|
||||||
padding: 0.25em;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar #searchbox input[type="submit"] {
|
|
||||||
float: left;
|
|
||||||
width: 20%;
|
|
||||||
border-left: none;
|
|
||||||
padding: 0.25em;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
img {
|
|
||||||
border: 0;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- search page ----------------------------------------------------------- */
|
|
||||||
|
|
||||||
ul.search {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.search li {
|
|
||||||
padding: 5px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.search li a {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.search li p.context {
|
|
||||||
color: #888;
|
|
||||||
margin: 2px 0 0 30px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.keywordmatches li.goodmatch a {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- index page ------------------------------------------------------------ */
|
|
||||||
|
|
||||||
table.contentstable {
|
|
||||||
width: 90%;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.contentstable p.biglink {
|
|
||||||
line-height: 150%;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.biglink {
|
|
||||||
font-size: 1.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.linkdescr {
|
|
||||||
font-style: italic;
|
|
||||||
padding-top: 5px;
|
|
||||||
font-size: 90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- general index --------------------------------------------------------- */
|
|
||||||
|
|
||||||
table.indextable {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.indextable td {
|
|
||||||
text-align: left;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.indextable ul {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
list-style-type: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.indextable > tbody > tr > td > ul {
|
|
||||||
padding-left: 0em;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.indextable tr.pcap {
|
|
||||||
height: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.indextable tr.cap {
|
|
||||||
margin-top: 10px;
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.toggler {
|
|
||||||
margin-right: 3px;
|
|
||||||
margin-top: 3px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.modindex-jumpbox {
|
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
border-bottom: 1px solid #ddd;
|
|
||||||
margin: 1em 0 1em 0;
|
|
||||||
padding: 0.4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.genindex-jumpbox {
|
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
border-bottom: 1px solid #ddd;
|
|
||||||
margin: 1em 0 1em 0;
|
|
||||||
padding: 0.4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- domain module index --------------------------------------------------- */
|
|
||||||
|
|
||||||
table.modindextable td {
|
|
||||||
padding: 2px;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- general body styles --------------------------------------------------- */
|
|
||||||
|
|
||||||
div.body {
|
|
||||||
min-width: 360px;
|
|
||||||
max-width: 800px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body p, div.body dd, div.body li, div.body blockquote {
|
|
||||||
-moz-hyphens: auto;
|
|
||||||
-ms-hyphens: auto;
|
|
||||||
-webkit-hyphens: auto;
|
|
||||||
hyphens: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.headerlink {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:visited {
|
|
||||||
color: #551A8B;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1:hover > a.headerlink,
|
|
||||||
h2:hover > a.headerlink,
|
|
||||||
h3:hover > a.headerlink,
|
|
||||||
h4:hover > a.headerlink,
|
|
||||||
h5:hover > a.headerlink,
|
|
||||||
h6:hover > a.headerlink,
|
|
||||||
dt:hover > a.headerlink,
|
|
||||||
caption:hover > a.headerlink,
|
|
||||||
p.caption:hover > a.headerlink,
|
|
||||||
div.code-block-caption:hover > a.headerlink {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body p.caption {
|
|
||||||
text-align: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body td {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.first {
|
|
||||||
margin-top: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.rubric {
|
|
||||||
margin-top: 30px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.align-left, figure.align-left, .figure.align-left, object.align-left {
|
|
||||||
clear: left;
|
|
||||||
float: left;
|
|
||||||
margin-right: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.align-right, figure.align-right, .figure.align-right, object.align-right {
|
|
||||||
clear: right;
|
|
||||||
float: right;
|
|
||||||
margin-left: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.align-center, figure.align-center, .figure.align-center, object.align-center {
|
|
||||||
display: block;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.align-default, figure.align-default, .figure.align-default {
|
|
||||||
display: block;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-left {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-default {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- sidebars -------------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.sidebar,
|
|
||||||
aside.sidebar {
|
|
||||||
margin: 0 0 0.5em 1em;
|
|
||||||
border: 1px solid #ddb;
|
|
||||||
padding: 7px;
|
|
||||||
background-color: #ffe;
|
|
||||||
width: 40%;
|
|
||||||
float: right;
|
|
||||||
clear: right;
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.sidebar-title {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav.contents,
|
|
||||||
aside.topic,
|
|
||||||
div.admonition, div.topic, blockquote {
|
|
||||||
clear: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- topics ---------------------------------------------------------------- */
|
|
||||||
|
|
||||||
nav.contents,
|
|
||||||
aside.topic,
|
|
||||||
div.topic {
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
padding: 7px;
|
|
||||||
margin: 10px 0 10px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.topic-title {
|
|
||||||
font-size: 1.1em;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- admonitions ----------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.admonition {
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
padding: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.admonition dt {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.admonition-title {
|
|
||||||
margin: 0px 10px 5px 0px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body p.centered {
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- content of sidebars/topics/admonitions -------------------------------- */
|
|
||||||
|
|
||||||
div.sidebar > :last-child,
|
|
||||||
aside.sidebar > :last-child,
|
|
||||||
nav.contents > :last-child,
|
|
||||||
aside.topic > :last-child,
|
|
||||||
div.topic > :last-child,
|
|
||||||
div.admonition > :last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sidebar::after,
|
|
||||||
aside.sidebar::after,
|
|
||||||
nav.contents::after,
|
|
||||||
aside.topic::after,
|
|
||||||
div.topic::after,
|
|
||||||
div.admonition::after,
|
|
||||||
blockquote::after {
|
|
||||||
display: block;
|
|
||||||
content: '';
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- tables ---------------------------------------------------------------- */
|
|
||||||
|
|
||||||
table.docutils {
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
border: 0;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.align-center {
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.align-default {
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
table caption span.caption-number {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
table caption span.caption-text {
|
|
||||||
}
|
|
||||||
|
|
||||||
table.docutils td, table.docutils th {
|
|
||||||
padding: 1px 8px 1px 5px;
|
|
||||||
border-top: 0;
|
|
||||||
border-left: 0;
|
|
||||||
border-right: 0;
|
|
||||||
border-bottom: 1px solid #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
th {
|
|
||||||
text-align: left;
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.citation {
|
|
||||||
border-left: solid 1px gray;
|
|
||||||
margin-left: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.citation td {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
th > :first-child,
|
|
||||||
td > :first-child {
|
|
||||||
margin-top: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
th > :last-child,
|
|
||||||
td > :last-child {
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- figures --------------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.figure, figure {
|
|
||||||
margin: 0.5em;
|
|
||||||
padding: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.figure p.caption, figcaption {
|
|
||||||
padding: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.figure p.caption span.caption-number,
|
|
||||||
figcaption span.caption-number {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.figure p.caption span.caption-text,
|
|
||||||
figcaption span.caption-text {
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- field list styles ----------------------------------------------------- */
|
|
||||||
|
|
||||||
table.field-list td, table.field-list th {
|
|
||||||
border: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.field-list ul {
|
|
||||||
margin: 0;
|
|
||||||
padding-left: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.field-list p {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.field-name {
|
|
||||||
-moz-hyphens: manual;
|
|
||||||
-ms-hyphens: manual;
|
|
||||||
-webkit-hyphens: manual;
|
|
||||||
hyphens: manual;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- hlist styles ---------------------------------------------------------- */
|
|
||||||
|
|
||||||
table.hlist {
|
|
||||||
margin: 1em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.hlist td {
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- object description styles --------------------------------------------- */
|
|
||||||
|
|
||||||
.sig {
|
|
||||||
font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig-name, code.descname {
|
|
||||||
background-color: transparent;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig-name {
|
|
||||||
font-size: 1.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
code.descname {
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig-prename, code.descclassname {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.optional {
|
|
||||||
font-size: 1.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig-paren {
|
|
||||||
font-size: larger;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig-param.n {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* C++ specific styling */
|
|
||||||
|
|
||||||
.sig-inline.c-texpr,
|
|
||||||
.sig-inline.cpp-texpr {
|
|
||||||
font-family: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig.c .k, .sig.c .kt,
|
|
||||||
.sig.cpp .k, .sig.cpp .kt {
|
|
||||||
color: #0033B3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig.c .m,
|
|
||||||
.sig.cpp .m {
|
|
||||||
color: #1750EB;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig.c .s, .sig.c .sc,
|
|
||||||
.sig.cpp .s, .sig.cpp .sc {
|
|
||||||
color: #067D17;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* -- other body styles ----------------------------------------------------- */
|
|
||||||
|
|
||||||
ol.arabic {
|
|
||||||
list-style: decimal;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.loweralpha {
|
|
||||||
list-style: lower-alpha;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.upperalpha {
|
|
||||||
list-style: upper-alpha;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.lowerroman {
|
|
||||||
list-style: lower-roman;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.upperroman {
|
|
||||||
list-style: upper-roman;
|
|
||||||
}
|
|
||||||
|
|
||||||
:not(li) > ol > li:first-child > :first-child,
|
|
||||||
:not(li) > ul > li:first-child > :first-child {
|
|
||||||
margin-top: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:not(li) > ol > li:last-child > :last-child,
|
|
||||||
:not(li) > ul > li:last-child > :last-child {
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.simple ol p,
|
|
||||||
ol.simple ul p,
|
|
||||||
ul.simple ol p,
|
|
||||||
ul.simple ul p {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.simple > li:not(:first-child) > p,
|
|
||||||
ul.simple > li:not(:first-child) > p {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.simple p,
|
|
||||||
ul.simple p {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
aside.footnote > span,
|
|
||||||
div.citation > span {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
aside.footnote > span:last-of-type,
|
|
||||||
div.citation > span:last-of-type {
|
|
||||||
padding-right: 0.5em;
|
|
||||||
}
|
|
||||||
aside.footnote > p {
|
|
||||||
margin-left: 2em;
|
|
||||||
}
|
|
||||||
div.citation > p {
|
|
||||||
margin-left: 4em;
|
|
||||||
}
|
|
||||||
aside.footnote > p:last-of-type,
|
|
||||||
div.citation > p:last-of-type {
|
|
||||||
margin-bottom: 0em;
|
|
||||||
}
|
|
||||||
aside.footnote > p:last-of-type:after,
|
|
||||||
div.citation > p:last-of-type:after {
|
|
||||||
content: "";
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.field-list {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: fit-content(30%) auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.field-list > dt {
|
|
||||||
font-weight: bold;
|
|
||||||
word-break: break-word;
|
|
||||||
padding-left: 0.5em;
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.field-list > dd {
|
|
||||||
padding-left: 0.5em;
|
|
||||||
margin-top: 0em;
|
|
||||||
margin-left: 0em;
|
|
||||||
margin-bottom: 0em;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd > :first-child {
|
|
||||||
margin-top: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd ul, dd table {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd {
|
|
||||||
margin-top: 3px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
margin-left: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig dd {
|
|
||||||
margin-top: 0px;
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig dl {
|
|
||||||
margin-top: 0px;
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl > dd:last-child,
|
|
||||||
dl > dd:last-child > :last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt:target, span.highlighted {
|
|
||||||
background-color: #fbe54e;
|
|
||||||
}
|
|
||||||
|
|
||||||
rect.highlighted {
|
|
||||||
fill: #fbe54e;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.glossary dt {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.versionmodified {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
.system-message {
|
|
||||||
background-color: #fda;
|
|
||||||
padding: 5px;
|
|
||||||
border: 3px solid red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footnote:target {
|
|
||||||
background-color: #ffa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-block {
|
|
||||||
display: block;
|
|
||||||
margin-top: 1em;
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-block .line-block {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
margin-left: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guilabel, .menuselection {
|
|
||||||
font-family: sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
.accelerator {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.classifier {
|
|
||||||
font-style: oblique;
|
|
||||||
}
|
|
||||||
|
|
||||||
.classifier:before {
|
|
||||||
font-style: normal;
|
|
||||||
margin: 0 0.5em;
|
|
||||||
content: ":";
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
abbr, acronym {
|
|
||||||
border-bottom: dotted 1px;
|
|
||||||
cursor: help;
|
|
||||||
}
|
|
||||||
|
|
||||||
.translated {
|
|
||||||
background-color: rgba(207, 255, 207, 0.2)
|
|
||||||
}
|
|
||||||
|
|
||||||
.untranslated {
|
|
||||||
background-color: rgba(255, 207, 207, 0.2)
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- code displays --------------------------------------------------------- */
|
|
||||||
|
|
||||||
pre {
|
|
||||||
overflow: auto;
|
|
||||||
overflow-y: hidden; /* fixes display issues on Chrome browsers */
|
|
||||||
}
|
|
||||||
|
|
||||||
pre, div[class*="highlight-"] {
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.pre {
|
|
||||||
-moz-hyphens: none;
|
|
||||||
-ms-hyphens: none;
|
|
||||||
-webkit-hyphens: none;
|
|
||||||
hyphens: none;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
div[class*="highlight-"] {
|
|
||||||
margin: 1em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.linenos pre {
|
|
||||||
border: 0;
|
|
||||||
background-color: transparent;
|
|
||||||
color: #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.highlighttable {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.highlighttable tbody {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.highlighttable tr {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.highlighttable td {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.highlighttable td.linenos {
|
|
||||||
padding-right: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.highlighttable td.code {
|
|
||||||
flex: 1;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.highlight .hll {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.highlight pre,
|
|
||||||
table.highlighttable pre {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.code-block-caption + div {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.code-block-caption {
|
|
||||||
margin-top: 1em;
|
|
||||||
padding: 2px 5px;
|
|
||||||
font-size: small;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.code-block-caption code {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.highlighttable td.linenos,
|
|
||||||
span.linenos,
|
|
||||||
div.highlight span.gp { /* gp: Generic.Prompt */
|
|
||||||
user-select: none;
|
|
||||||
-webkit-user-select: text; /* Safari fallback only */
|
|
||||||
-webkit-user-select: none; /* Chrome/Safari */
|
|
||||||
-moz-user-select: none; /* Firefox */
|
|
||||||
-ms-user-select: none; /* IE10+ */
|
|
||||||
}
|
|
||||||
|
|
||||||
div.code-block-caption span.caption-number {
|
|
||||||
padding: 0.1em 0.3em;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.code-block-caption span.caption-text {
|
|
||||||
}
|
|
||||||
|
|
||||||
div.literal-block-wrapper {
|
|
||||||
margin: 1em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
code.xref, a code {
|
|
||||||
background-color: transparent;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.viewcode-link {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.viewcode-back {
|
|
||||||
float: right;
|
|
||||||
font-family: sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.viewcode-block:target {
|
|
||||||
margin: -1px -10px;
|
|
||||||
padding: 0 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- math display ---------------------------------------------------------- */
|
|
||||||
|
|
||||||
img.math {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body div.math p {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.eqno {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.eqno a.headerlink {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.math:hover a.headerlink {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- printout stylesheet --------------------------------------------------- */
|
|
||||||
|
|
||||||
@media print {
|
|
||||||
div.document,
|
|
||||||
div.documentwrapper,
|
|
||||||
div.bodywrapper {
|
|
||||||
margin: 0 !important;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar,
|
|
||||||
div.related,
|
|
||||||
div.footer,
|
|
||||||
#top-link {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,505 +0,0 @@
|
|||||||
/*
|
|
||||||
* Sphinx stylesheet -- business style theme.
|
|
||||||
*/
|
|
||||||
|
|
||||||
@import url("basic.css");
|
|
||||||
|
|
||||||
/* -- page layout ----------------------------------------------------------- */
|
|
||||||
|
|
||||||
body {
|
|
||||||
font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
|
|
||||||
'Verdana', sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
letter-spacing: -0.01em;
|
|
||||||
line-height: 150%;
|
|
||||||
text-align: center;
|
|
||||||
background-color: white;
|
|
||||||
background-image: url(background_b01.png);
|
|
||||||
color: black;
|
|
||||||
padding: 0;
|
|
||||||
border-right: 1px solid #336699;
|
|
||||||
border-left: 1px solid #336699;
|
|
||||||
|
|
||||||
margin: 0px 40px 0px 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.document {
|
|
||||||
background-color: white;
|
|
||||||
text-align: left;
|
|
||||||
background-repeat: repeat-x;
|
|
||||||
|
|
||||||
-moz-box-shadow: 2px 2px 5px #000;
|
|
||||||
-webkit-box-shadow: 2px 2px 5px #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.documentwrapper {
|
|
||||||
float: left;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.bodywrapper {
|
|
||||||
margin: 0 0 0 240px;
|
|
||||||
border-left: 1px solid #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0.5em 20px 20px 20px;
|
|
||||||
}
|
|
||||||
div.bodywrapper {
|
|
||||||
margin: 0 0 0 calc(210px + 30px);
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related {
|
|
||||||
font-size: 1em;
|
|
||||||
|
|
||||||
-moz-box-shadow: 2px 2px 5px #000;
|
|
||||||
-webkit-box-shadow: 2px 2px 5px #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related ul {
|
|
||||||
background-color: #336699;
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
border-bottom: 1px solid #ddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related ul li {
|
|
||||||
color: white;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
height: 2em;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related ul li.right {
|
|
||||||
float: right;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related ul li a {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 5px 0 5px;
|
|
||||||
line-height: 1.75em;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related ul li a:hover {
|
|
||||||
color: #fff;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebarwrapper {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar {
|
|
||||||
padding: 0.5em 12px 12px 12px;
|
|
||||||
width: 210px;
|
|
||||||
font-size: 1em;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar h3, div.sphinxsidebar h4 {
|
|
||||||
margin: 1em 0 0.5em 0;
|
|
||||||
font-size: 1em;
|
|
||||||
padding: 0.1em 0 0.1em 0.5em;
|
|
||||||
color: white;
|
|
||||||
border: 1px solid #336699;
|
|
||||||
background-color: #336699;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar h3 a {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar ul {
|
|
||||||
padding-left: 1.5em;
|
|
||||||
margin-top: 7px;
|
|
||||||
padding: 0;
|
|
||||||
line-height: 130%;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar ul ul {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar input {
|
|
||||||
border: 1px solid #336699;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.footer {
|
|
||||||
background-color: white;
|
|
||||||
color: #336699;
|
|
||||||
padding: 3px 8px 3px 0;
|
|
||||||
clear: both;
|
|
||||||
font-size: 0.8em;
|
|
||||||
text-align: right;
|
|
||||||
border-bottom: 1px solid #336699;
|
|
||||||
|
|
||||||
-moz-box-shadow: 2px 2px 5px #000;
|
|
||||||
-webkit-box-shadow: 2px 2px 5px #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.footer a {
|
|
||||||
color: #336699;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- body styles ----------------------------------------------------------- */
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 0.8em 0 0.5em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #336699;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
|
||||||
color: #336699;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:visited {
|
|
||||||
color: #551a8b;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body a {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1, h2, h3 {
|
|
||||||
color: #336699;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0.7em 0 0.3em 0;
|
|
||||||
font-size: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
margin: 1.3em 0 0.2em 0;
|
|
||||||
font-size: 1.35em;
|
|
||||||
padding-bottom: .5em;
|
|
||||||
border-bottom: 1px solid #336699;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
margin: 1em 0 -0.3em 0;
|
|
||||||
font-size: 1.2em;
|
|
||||||
padding-bottom: .3em;
|
|
||||||
border-bottom: 1px solid #CCCCCC;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body h1 a, div.body h2 a, div.body h3 a,
|
|
||||||
div.body h4 a, div.body h5 a, div.body h6 a {
|
|
||||||
color: black!important;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 a.anchor, h2 a.anchor, h3 a.anchor,
|
|
||||||
h4 a.anchor, h5 a.anchor, h6 a.anchor {
|
|
||||||
display: none;
|
|
||||||
margin: 0 0 0 0.3em;
|
|
||||||
padding: 0 0.2em 0 0.2em;
|
|
||||||
color: #aaa!important;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor,
|
|
||||||
h5:hover a.anchor, h6:hover a.anchor {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover,
|
|
||||||
h5 a.anchor:hover, h6 a.anchor:hover {
|
|
||||||
color: #777;
|
|
||||||
background-color: #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.headerlink {
|
|
||||||
color: #c60f0f!important;
|
|
||||||
font-size: 1em;
|
|
||||||
margin-left: 6px;
|
|
||||||
padding: 0 4px 0 4px;
|
|
||||||
text-decoration: none!important;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.headerlink:hover {
|
|
||||||
background-color: #ccc;
|
|
||||||
color: white!important;
|
|
||||||
}
|
|
||||||
|
|
||||||
cite, code, tt {
|
|
||||||
font-family: 'Consolas', 'Deja Vu Sans Mono',
|
|
||||||
'Bitstream Vera Sans Mono', monospace;
|
|
||||||
font-size: 0.95em;
|
|
||||||
letter-spacing: 0.01em;
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
background-color: #F2F2F2;
|
|
||||||
border-bottom: 1px solid #ddd;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
code.descname, code.descclassname, code.xref {
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
border: 1px solid #abc;
|
|
||||||
margin: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
a code {
|
|
||||||
border: 0;
|
|
||||||
color: #CA7900;
|
|
||||||
}
|
|
||||||
|
|
||||||
a code:hover {
|
|
||||||
color: #2491CF;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
background-color: transparent !important;
|
|
||||||
font-family: 'Consolas', 'Deja Vu Sans Mono',
|
|
||||||
'Bitstream Vera Sans Mono', monospace;
|
|
||||||
font-size: 0.95em;
|
|
||||||
letter-spacing: 0.015em;
|
|
||||||
line-height: 120%;
|
|
||||||
padding: 0.5em;
|
|
||||||
border-right: 5px solid #ccc;
|
|
||||||
border-left: 5px solid #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.linenos pre {
|
|
||||||
padding: 0.5em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.quotebar {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
max-width: 250px;
|
|
||||||
float: right;
|
|
||||||
padding: 2px 7px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav.contents,
|
|
||||||
aside.topic,
|
|
||||||
div.topic {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
margin: 0 -0.5em 0 -0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
table td, table th {
|
|
||||||
padding: 0.2em 0.5em 0.2em 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.admonition {
|
|
||||||
font-size: 0.9em;
|
|
||||||
margin: 1em 0 1em 0;
|
|
||||||
border: 3px solid #cccccc;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.admonition p {
|
|
||||||
margin: 0.5em 1em 0.5em 1em;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.admonition li p {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.admonition pre, div.warning pre {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.highlight {
|
|
||||||
margin: 0.4em 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.admonition p.admonition-title {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0.1em 0 0.1em 0.5em;
|
|
||||||
color: white;
|
|
||||||
border-bottom: 3px solid #cccccc;
|
|
||||||
font-weight: bold;
|
|
||||||
background-color: #165e83;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.danger { border: 3px solid #f0908d; background-color: #f0cfa0; }
|
|
||||||
div.error { border: 3px solid #f0908d; background-color: #ede4cd; }
|
|
||||||
div.warning { border: 3px solid #f8b862; background-color: #f0cfa0; }
|
|
||||||
div.caution { border: 3px solid #f8b862; background-color: #ede4cd; }
|
|
||||||
div.attention { border: 3px solid #f8b862; background-color: #f3f3f3; }
|
|
||||||
div.important { border: 3px solid #f0cfa0; background-color: #ede4cd; }
|
|
||||||
div.note { border: 3px solid #f0cfa0; background-color: #f3f3f3; }
|
|
||||||
div.hint { border: 3px solid #bed2c3; background-color: #f3f3f3; }
|
|
||||||
div.tip { border: 3px solid #bed2c3; background-color: #f3f3f3; }
|
|
||||||
|
|
||||||
div.danger p.admonition-title, div.error p.admonition-title {
|
|
||||||
background-color: #b7282e;
|
|
||||||
border-bottom: 3px solid #f0908d;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.caution p.admonition-title,
|
|
||||||
div.warning p.admonition-title,
|
|
||||||
div.attention p.admonition-title {
|
|
||||||
background-color: #f19072;
|
|
||||||
border-bottom: 3px solid #f8b862;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.note p.admonition-title, div.important p.admonition-title {
|
|
||||||
background-color: #f8b862;
|
|
||||||
border-bottom: 3px solid #f0cfa0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.hint p.admonition-title, div.tip p.admonition-title {
|
|
||||||
background-color: #7ebea5;
|
|
||||||
border-bottom: 3px solid #bed2c3;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.admonition ul, div.admonition ol,
|
|
||||||
div.warning ul, div.warning ol {
|
|
||||||
margin: 0.1em 0.5em 0.5em 3em;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.versioninfo {
|
|
||||||
margin: 1em 0 0 0;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
background-color: #DDEAF0;
|
|
||||||
padding: 8px;
|
|
||||||
line-height: 1.3em;
|
|
||||||
font-size: 0.9em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.viewcode-back {
|
|
||||||
font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
|
|
||||||
'Verdana', sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.viewcode-block:target {
|
|
||||||
background-color: #f4debf;
|
|
||||||
border-top: 1px solid #ac9;
|
|
||||||
border-bottom: 1px solid #ac9;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.versionchanged span.versionmodified {
|
|
||||||
font-size: 0.9em;
|
|
||||||
margin-right: 0.2em;
|
|
||||||
padding: 0.1em;
|
|
||||||
background-color: #DCE6A0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.field-list > dt {
|
|
||||||
color: white;
|
|
||||||
background-color: #82A0BE;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.field-list > dd {
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- table styles ---------------------------------------------------------- */
|
|
||||||
|
|
||||||
table.docutils {
|
|
||||||
margin: 1em 0;
|
|
||||||
padding: 0;
|
|
||||||
border: 1px solid white;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.docutils td, table.docutils th {
|
|
||||||
padding: 1px 8px 1px 5px;
|
|
||||||
border-top: 0;
|
|
||||||
border-left: 0;
|
|
||||||
border-right: 1px solid white;
|
|
||||||
border-bottom: 1px solid white;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.docutils td p {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.field-list td, table.field-list th {
|
|
||||||
border: 0 !important;
|
|
||||||
word-break: break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.footnote td, table.footnote th {
|
|
||||||
border: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
th {
|
|
||||||
color: white;
|
|
||||||
text-align: left;
|
|
||||||
padding-right: 5px;
|
|
||||||
background-color: #82A0BE;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.literal-block-wrapper div.code-block-caption {
|
|
||||||
background-color: #EEE;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: #CCC;
|
|
||||||
border-width: 1px 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* WIDE DESKTOP STYLE */
|
|
||||||
@media only screen and (min-width: 1176px) {
|
|
||||||
body {
|
|
||||||
margin: 0 40px 0 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TABLET STYLE */
|
|
||||||
@media only screen and (min-width: 768px) and (max-width: 991px) {
|
|
||||||
body {
|
|
||||||
margin: 0 40px 0 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* MOBILE LAYOUT (PORTRAIT/320px) */
|
|
||||||
@media only screen and (max-width: 767px) {
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
div.bodywrapper {
|
|
||||||
margin: 0;
|
|
||||||
width: 100%;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
div.sphinxsidebar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* MOBILE LAYOUT (LANDSCAPE/480px) */
|
|
||||||
@media only screen and (min-width: 480px) and (max-width: 767px) {
|
|
||||||
body {
|
|
||||||
margin: 0 20px 0 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* RETINA OVERRIDES */
|
|
||||||
@media
|
|
||||||
only screen and (-webkit-min-device-pixel-ratio: 2),
|
|
||||||
only screen and (min-device-pixel-ratio: 2) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- end ------------------------------------------------------------------- */
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
* Sphinx javascript -- for bizstyle theme.
|
|
||||||
*
|
|
||||||
* This theme was created by referring to 'sphinxdoc'
|
|
||||||
*/
|
|
||||||
const initialiseBizStyle = () => {
|
|
||||||
if (navigator.userAgent.indexOf("iPhone") > 0 || navigator.userAgent.indexOf("Android") > 0) {
|
|
||||||
document.querySelector("li.nav-item-0 a").innerText = "Top"
|
|
||||||
}
|
|
||||||
const truncator = item => {if (item.textContent.length > 20) {
|
|
||||||
item.title = item.innerText
|
|
||||||
item.innerText = item.innerText.substr(0, 17) + "..."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
document.querySelectorAll("div.related:first ul li:not(.right) a").slice(1).forEach(truncator);
|
|
||||||
document.querySelectorAll("div.related:last ul li:not(.right) a").slice(1).forEach(truncator);
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("resize",
|
|
||||||
() => (document.querySelector("li.nav-item-0 a").innerText = (window.innerWidth <= 776) ? "Top" : "Documentation BlackJack Gab ")
|
|
||||||
)
|
|
||||||
|
|
||||||
if (document.readyState !== "loading") initialiseBizStyle()
|
|
||||||
else document.addEventListener("DOMContentLoaded", initialiseBizStyle)
|
|
||||||
@ -1,149 +0,0 @@
|
|||||||
/*
|
|
||||||
* Base JavaScript utilities for all Sphinx HTML documentation.
|
|
||||||
*/
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
|
|
||||||
"TEXTAREA",
|
|
||||||
"INPUT",
|
|
||||||
"SELECT",
|
|
||||||
"BUTTON",
|
|
||||||
]);
|
|
||||||
|
|
||||||
const _ready = (callback) => {
|
|
||||||
if (document.readyState !== "loading") {
|
|
||||||
callback();
|
|
||||||
} else {
|
|
||||||
document.addEventListener("DOMContentLoaded", callback);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Small JavaScript module for the documentation.
|
|
||||||
*/
|
|
||||||
const Documentation = {
|
|
||||||
init: () => {
|
|
||||||
Documentation.initDomainIndexTable();
|
|
||||||
Documentation.initOnKeyListeners();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* i18n support
|
|
||||||
*/
|
|
||||||
TRANSLATIONS: {},
|
|
||||||
PLURAL_EXPR: (n) => (n === 1 ? 0 : 1),
|
|
||||||
LOCALE: "unknown",
|
|
||||||
|
|
||||||
// gettext and ngettext don't access this so that the functions
|
|
||||||
// can safely bound to a different name (_ = Documentation.gettext)
|
|
||||||
gettext: (string) => {
|
|
||||||
const translated = Documentation.TRANSLATIONS[string];
|
|
||||||
switch (typeof translated) {
|
|
||||||
case "undefined":
|
|
||||||
return string; // no translation
|
|
||||||
case "string":
|
|
||||||
return translated; // translation exists
|
|
||||||
default:
|
|
||||||
return translated[0]; // (singular, plural) translation tuple exists
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
ngettext: (singular, plural, n) => {
|
|
||||||
const translated = Documentation.TRANSLATIONS[singular];
|
|
||||||
if (typeof translated !== "undefined")
|
|
||||||
return translated[Documentation.PLURAL_EXPR(n)];
|
|
||||||
return n === 1 ? singular : plural;
|
|
||||||
},
|
|
||||||
|
|
||||||
addTranslations: (catalog) => {
|
|
||||||
Object.assign(Documentation.TRANSLATIONS, catalog.messages);
|
|
||||||
Documentation.PLURAL_EXPR = new Function(
|
|
||||||
"n",
|
|
||||||
`return (${catalog.plural_expr})`
|
|
||||||
);
|
|
||||||
Documentation.LOCALE = catalog.locale;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* helper function to focus on search bar
|
|
||||||
*/
|
|
||||||
focusSearchBar: () => {
|
|
||||||
document.querySelectorAll("input[name=q]")[0]?.focus();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialise the domain index toggle buttons
|
|
||||||
*/
|
|
||||||
initDomainIndexTable: () => {
|
|
||||||
const toggler = (el) => {
|
|
||||||
const idNumber = el.id.substr(7);
|
|
||||||
const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`);
|
|
||||||
if (el.src.substr(-9) === "minus.png") {
|
|
||||||
el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`;
|
|
||||||
toggledRows.forEach((el) => (el.style.display = "none"));
|
|
||||||
} else {
|
|
||||||
el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`;
|
|
||||||
toggledRows.forEach((el) => (el.style.display = ""));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const togglerElements = document.querySelectorAll("img.toggler");
|
|
||||||
togglerElements.forEach((el) =>
|
|
||||||
el.addEventListener("click", (event) => toggler(event.currentTarget))
|
|
||||||
);
|
|
||||||
togglerElements.forEach((el) => (el.style.display = ""));
|
|
||||||
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler);
|
|
||||||
},
|
|
||||||
|
|
||||||
initOnKeyListeners: () => {
|
|
||||||
// only install a listener if it is really needed
|
|
||||||
if (
|
|
||||||
!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS &&
|
|
||||||
!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS
|
|
||||||
)
|
|
||||||
return;
|
|
||||||
|
|
||||||
document.addEventListener("keydown", (event) => {
|
|
||||||
// bail for input elements
|
|
||||||
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
|
||||||
// bail with special keys
|
|
||||||
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
|
||||||
|
|
||||||
if (!event.shiftKey) {
|
|
||||||
switch (event.key) {
|
|
||||||
case "ArrowLeft":
|
|
||||||
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
|
|
||||||
|
|
||||||
const prevLink = document.querySelector('link[rel="prev"]');
|
|
||||||
if (prevLink && prevLink.href) {
|
|
||||||
window.location.href = prevLink.href;
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "ArrowRight":
|
|
||||||
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;
|
|
||||||
|
|
||||||
const nextLink = document.querySelector('link[rel="next"]');
|
|
||||||
if (nextLink && nextLink.href) {
|
|
||||||
window.location.href = nextLink.href;
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// some keyboard layouts may need Shift to get /
|
|
||||||
switch (event.key) {
|
|
||||||
case "/":
|
|
||||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
|
|
||||||
Documentation.focusSearchBar();
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// quick alias for translations
|
|
||||||
const _ = Documentation.gettext;
|
|
||||||
|
|
||||||
_ready(Documentation.init);
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
const DOCUMENTATION_OPTIONS = {
|
|
||||||
VERSION: '',
|
|
||||||
LANGUAGE: 'fr',
|
|
||||||
COLLAPSE_INDEX: false,
|
|
||||||
BUILDER: 'html',
|
|
||||||
FILE_SUFFIX: '.html',
|
|
||||||
LINK_SUFFIX: '.html',
|
|
||||||
HAS_SOURCE: true,
|
|
||||||
SOURCELINK_SUFFIX: '.txt',
|
|
||||||
NAVIGATION_WITH_KEYS: false,
|
|
||||||
SHOW_SEARCH_SUMMARY: true,
|
|
||||||
ENABLE_SEARCH_SHORTCUTS: true,
|
|
||||||
};
|
|
||||||
|
Before Width: | Height: | Size: 286 B |
|
Before Width: | Height: | Size: 90 B |
|
Before Width: | Height: | Size: 90 B |
@ -1,75 +0,0 @@
|
|||||||
pre { line-height: 125%; }
|
|
||||||
td.linenos .normal { color: #666666; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
|
||||||
span.linenos { color: #666666; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
|
||||||
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
|
||||||
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
|
||||||
.highlight .hll { background-color: #ffffcc }
|
|
||||||
.highlight { background: #f0f0f0; }
|
|
||||||
.highlight .c { color: #60a0b0; font-style: italic } /* Comment */
|
|
||||||
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
|
||||||
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
|
||||||
.highlight .o { color: #666666 } /* Operator */
|
|
||||||
.highlight .ch { color: #60a0b0; font-style: italic } /* Comment.Hashbang */
|
|
||||||
.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
|
|
||||||
.highlight .cp { color: #007020 } /* Comment.Preproc */
|
|
||||||
.highlight .cpf { color: #60a0b0; font-style: italic } /* Comment.PreprocFile */
|
|
||||||
.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
|
|
||||||
.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
|
|
||||||
.highlight .gd { color: #A00000 } /* Generic.Deleted */
|
|
||||||
.highlight .ge { font-style: italic } /* Generic.Emph */
|
|
||||||
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
|
|
||||||
.highlight .gr { color: #FF0000 } /* Generic.Error */
|
|
||||||
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
|
||||||
.highlight .gi { color: #00A000 } /* Generic.Inserted */
|
|
||||||
.highlight .go { color: #888888 } /* Generic.Output */
|
|
||||||
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
|
|
||||||
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
|
||||||
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
|
||||||
.highlight .gt { color: #0044DD } /* Generic.Traceback */
|
|
||||||
.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
|
|
||||||
.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
|
|
||||||
.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
|
|
||||||
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
|
|
||||||
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
|
|
||||||
.highlight .kt { color: #902000 } /* Keyword.Type */
|
|
||||||
.highlight .m { color: #40a070 } /* Literal.Number */
|
|
||||||
.highlight .s { color: #4070a0 } /* Literal.String */
|
|
||||||
.highlight .na { color: #4070a0 } /* Name.Attribute */
|
|
||||||
.highlight .nb { color: #007020 } /* Name.Builtin */
|
|
||||||
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
|
|
||||||
.highlight .no { color: #60add5 } /* Name.Constant */
|
|
||||||
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
|
|
||||||
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
|
|
||||||
.highlight .ne { color: #007020 } /* Name.Exception */
|
|
||||||
.highlight .nf { color: #06287e } /* Name.Function */
|
|
||||||
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
|
|
||||||
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
|
|
||||||
.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
|
|
||||||
.highlight .nv { color: #bb60d5 } /* Name.Variable */
|
|
||||||
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
|
|
||||||
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
|
|
||||||
.highlight .mb { color: #40a070 } /* Literal.Number.Bin */
|
|
||||||
.highlight .mf { color: #40a070 } /* Literal.Number.Float */
|
|
||||||
.highlight .mh { color: #40a070 } /* Literal.Number.Hex */
|
|
||||||
.highlight .mi { color: #40a070 } /* Literal.Number.Integer */
|
|
||||||
.highlight .mo { color: #40a070 } /* Literal.Number.Oct */
|
|
||||||
.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
|
|
||||||
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
|
|
||||||
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
|
|
||||||
.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
|
|
||||||
.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
|
|
||||||
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
|
|
||||||
.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
|
|
||||||
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
|
|
||||||
.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
|
|
||||||
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
|
|
||||||
.highlight .sr { color: #235388 } /* Literal.String.Regex */
|
|
||||||
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
|
|
||||||
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
|
|
||||||
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
|
|
||||||
.highlight .fm { color: #06287e } /* Name.Function.Magic */
|
|
||||||
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
|
|
||||||
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
|
|
||||||
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
|
|
||||||
.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
|
|
||||||
.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */
|
|
||||||
@ -1,632 +0,0 @@
|
|||||||
/*
|
|
||||||
* Sphinx JavaScript utilities for the full-text search.
|
|
||||||
*/
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Simple result scoring code.
|
|
||||||
*/
|
|
||||||
if (typeof Scorer === "undefined") {
|
|
||||||
var Scorer = {
|
|
||||||
// Implement the following function to further tweak the score for each result
|
|
||||||
// The function takes a result array [docname, title, anchor, descr, score, filename]
|
|
||||||
// and returns the new score.
|
|
||||||
/*
|
|
||||||
score: result => {
|
|
||||||
const [docname, title, anchor, descr, score, filename, kind] = result
|
|
||||||
return score
|
|
||||||
},
|
|
||||||
*/
|
|
||||||
|
|
||||||
// query matches the full name of an object
|
|
||||||
objNameMatch: 11,
|
|
||||||
// or matches in the last dotted part of the object name
|
|
||||||
objPartialMatch: 6,
|
|
||||||
// Additive scores depending on the priority of the object
|
|
||||||
objPrio: {
|
|
||||||
0: 15, // used to be importantResults
|
|
||||||
1: 5, // used to be objectResults
|
|
||||||
2: -5, // used to be unimportantResults
|
|
||||||
},
|
|
||||||
// Used when the priority is not in the mapping.
|
|
||||||
objPrioDefault: 0,
|
|
||||||
|
|
||||||
// query found in title
|
|
||||||
title: 15,
|
|
||||||
partialTitle: 7,
|
|
||||||
// query found in terms
|
|
||||||
term: 5,
|
|
||||||
partialTerm: 2,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Global search result kind enum, used by themes to style search results.
|
|
||||||
class SearchResultKind {
|
|
||||||
static get index() { return "index"; }
|
|
||||||
static get object() { return "object"; }
|
|
||||||
static get text() { return "text"; }
|
|
||||||
static get title() { return "title"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
const _removeChildren = (element) => {
|
|
||||||
while (element && element.lastChild) element.removeChild(element.lastChild);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping
|
|
||||||
*/
|
|
||||||
const _escapeRegExp = (string) =>
|
|
||||||
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
|
||||||
|
|
||||||
const _displayItem = (item, searchTerms, highlightTerms) => {
|
|
||||||
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
|
|
||||||
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
|
|
||||||
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
|
|
||||||
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
|
|
||||||
const contentRoot = document.documentElement.dataset.content_root;
|
|
||||||
|
|
||||||
const [docName, title, anchor, descr, score, _filename, kind] = item;
|
|
||||||
|
|
||||||
let listItem = document.createElement("li");
|
|
||||||
// Add a class representing the item's type:
|
|
||||||
// can be used by a theme's CSS selector for styling
|
|
||||||
// See SearchResultKind for the class names.
|
|
||||||
listItem.classList.add(`kind-${kind}`);
|
|
||||||
let requestUrl;
|
|
||||||
let linkUrl;
|
|
||||||
if (docBuilder === "dirhtml") {
|
|
||||||
// dirhtml builder
|
|
||||||
let dirname = docName + "/";
|
|
||||||
if (dirname.match(/\/index\/$/))
|
|
||||||
dirname = dirname.substring(0, dirname.length - 6);
|
|
||||||
else if (dirname === "index/") dirname = "";
|
|
||||||
requestUrl = contentRoot + dirname;
|
|
||||||
linkUrl = requestUrl;
|
|
||||||
} else {
|
|
||||||
// normal html builders
|
|
||||||
requestUrl = contentRoot + docName + docFileSuffix;
|
|
||||||
linkUrl = docName + docLinkSuffix;
|
|
||||||
}
|
|
||||||
let linkEl = listItem.appendChild(document.createElement("a"));
|
|
||||||
linkEl.href = linkUrl + anchor;
|
|
||||||
linkEl.dataset.score = score;
|
|
||||||
linkEl.innerHTML = title;
|
|
||||||
if (descr) {
|
|
||||||
listItem.appendChild(document.createElement("span")).innerHTML =
|
|
||||||
" (" + descr + ")";
|
|
||||||
// highlight search terms in the description
|
|
||||||
if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
|
|
||||||
highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
|
|
||||||
}
|
|
||||||
else if (showSearchSummary)
|
|
||||||
fetch(requestUrl)
|
|
||||||
.then((responseData) => responseData.text())
|
|
||||||
.then((data) => {
|
|
||||||
if (data)
|
|
||||||
listItem.appendChild(
|
|
||||||
Search.makeSearchSummary(data, searchTerms, anchor)
|
|
||||||
);
|
|
||||||
// highlight search terms in the summary
|
|
||||||
if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
|
|
||||||
highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
|
|
||||||
});
|
|
||||||
Search.output.appendChild(listItem);
|
|
||||||
};
|
|
||||||
const _finishSearch = (resultCount) => {
|
|
||||||
Search.stopPulse();
|
|
||||||
Search.title.innerText = _("Search Results");
|
|
||||||
if (!resultCount)
|
|
||||||
Search.status.innerText = Documentation.gettext(
|
|
||||||
"Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories."
|
|
||||||
);
|
|
||||||
else
|
|
||||||
Search.status.innerText = Documentation.ngettext(
|
|
||||||
"Search finished, found one page matching the search query.",
|
|
||||||
"Search finished, found ${resultCount} pages matching the search query.",
|
|
||||||
resultCount,
|
|
||||||
).replace('${resultCount}', resultCount);
|
|
||||||
};
|
|
||||||
const _displayNextItem = (
|
|
||||||
results,
|
|
||||||
resultCount,
|
|
||||||
searchTerms,
|
|
||||||
highlightTerms,
|
|
||||||
) => {
|
|
||||||
// results left, load the summary and display it
|
|
||||||
// this is intended to be dynamic (don't sub resultsCount)
|
|
||||||
if (results.length) {
|
|
||||||
_displayItem(results.pop(), searchTerms, highlightTerms);
|
|
||||||
setTimeout(
|
|
||||||
() => _displayNextItem(results, resultCount, searchTerms, highlightTerms),
|
|
||||||
5
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// search finished, update title and status message
|
|
||||||
else _finishSearch(resultCount);
|
|
||||||
};
|
|
||||||
// Helper function used by query() to order search results.
|
|
||||||
// Each input is an array of [docname, title, anchor, descr, score, filename, kind].
|
|
||||||
// Order the results by score (in opposite order of appearance, since the
|
|
||||||
// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically.
|
|
||||||
const _orderResultsByScoreThenName = (a, b) => {
|
|
||||||
const leftScore = a[4];
|
|
||||||
const rightScore = b[4];
|
|
||||||
if (leftScore === rightScore) {
|
|
||||||
// same score: sort alphabetically
|
|
||||||
const leftTitle = a[1].toLowerCase();
|
|
||||||
const rightTitle = b[1].toLowerCase();
|
|
||||||
if (leftTitle === rightTitle) return 0;
|
|
||||||
return leftTitle > rightTitle ? -1 : 1; // inverted is intentional
|
|
||||||
}
|
|
||||||
return leftScore > rightScore ? 1 : -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default splitQuery function. Can be overridden in ``sphinx.search`` with a
|
|
||||||
* custom function per language.
|
|
||||||
*
|
|
||||||
* The regular expression works by splitting the string on consecutive characters
|
|
||||||
* that are not Unicode letters, numbers, underscores, or emoji characters.
|
|
||||||
* This is the same as ``\W+`` in Python, preserving the surrogate pair area.
|
|
||||||
*/
|
|
||||||
if (typeof splitQuery === "undefined") {
|
|
||||||
var splitQuery = (query) => query
|
|
||||||
.split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu)
|
|
||||||
.filter(term => term) // remove remaining empty strings
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Search Module
|
|
||||||
*/
|
|
||||||
const Search = {
|
|
||||||
_index: null,
|
|
||||||
_queued_query: null,
|
|
||||||
_pulse_status: -1,
|
|
||||||
|
|
||||||
htmlToText: (htmlString, anchor) => {
|
|
||||||
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
|
|
||||||
for (const removalQuery of [".headerlink", "script", "style"]) {
|
|
||||||
htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() });
|
|
||||||
}
|
|
||||||
if (anchor) {
|
|
||||||
const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`);
|
|
||||||
if (anchorContent) return anchorContent.textContent;
|
|
||||||
|
|
||||||
console.warn(
|
|
||||||
`Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if anchor not specified or not found, fall back to main content
|
|
||||||
const docContent = htmlElement.querySelector('[role="main"]');
|
|
||||||
if (docContent) return docContent.textContent;
|
|
||||||
|
|
||||||
console.warn(
|
|
||||||
"Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template."
|
|
||||||
);
|
|
||||||
return "";
|
|
||||||
},
|
|
||||||
|
|
||||||
init: () => {
|
|
||||||
const query = new URLSearchParams(window.location.search).get("q");
|
|
||||||
document
|
|
||||||
.querySelectorAll('input[name="q"]')
|
|
||||||
.forEach((el) => (el.value = query));
|
|
||||||
if (query) Search.performSearch(query);
|
|
||||||
},
|
|
||||||
|
|
||||||
loadIndex: (url) =>
|
|
||||||
(document.body.appendChild(document.createElement("script")).src = url),
|
|
||||||
|
|
||||||
setIndex: (index) => {
|
|
||||||
Search._index = index;
|
|
||||||
if (Search._queued_query !== null) {
|
|
||||||
const query = Search._queued_query;
|
|
||||||
Search._queued_query = null;
|
|
||||||
Search.query(query);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
hasIndex: () => Search._index !== null,
|
|
||||||
|
|
||||||
deferQuery: (query) => (Search._queued_query = query),
|
|
||||||
|
|
||||||
stopPulse: () => (Search._pulse_status = -1),
|
|
||||||
|
|
||||||
startPulse: () => {
|
|
||||||
if (Search._pulse_status >= 0) return;
|
|
||||||
|
|
||||||
const pulse = () => {
|
|
||||||
Search._pulse_status = (Search._pulse_status + 1) % 4;
|
|
||||||
Search.dots.innerText = ".".repeat(Search._pulse_status);
|
|
||||||
if (Search._pulse_status >= 0) window.setTimeout(pulse, 500);
|
|
||||||
};
|
|
||||||
pulse();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* perform a search for something (or wait until index is loaded)
|
|
||||||
*/
|
|
||||||
performSearch: (query) => {
|
|
||||||
// create the required interface elements
|
|
||||||
const searchText = document.createElement("h2");
|
|
||||||
searchText.textContent = _("Searching");
|
|
||||||
const searchSummary = document.createElement("p");
|
|
||||||
searchSummary.classList.add("search-summary");
|
|
||||||
searchSummary.innerText = "";
|
|
||||||
const searchList = document.createElement("ul");
|
|
||||||
searchList.setAttribute("role", "list");
|
|
||||||
searchList.classList.add("search");
|
|
||||||
|
|
||||||
const out = document.getElementById("search-results");
|
|
||||||
Search.title = out.appendChild(searchText);
|
|
||||||
Search.dots = Search.title.appendChild(document.createElement("span"));
|
|
||||||
Search.status = out.appendChild(searchSummary);
|
|
||||||
Search.output = out.appendChild(searchList);
|
|
||||||
|
|
||||||
const searchProgress = document.getElementById("search-progress");
|
|
||||||
// Some themes don't use the search progress node
|
|
||||||
if (searchProgress) {
|
|
||||||
searchProgress.innerText = _("Preparing search...");
|
|
||||||
}
|
|
||||||
Search.startPulse();
|
|
||||||
|
|
||||||
// index already loaded, the browser was quick!
|
|
||||||
if (Search.hasIndex()) Search.query(query);
|
|
||||||
else Search.deferQuery(query);
|
|
||||||
},
|
|
||||||
|
|
||||||
_parseQuery: (query) => {
|
|
||||||
// stem the search terms and add them to the correct list
|
|
||||||
const stemmer = new Stemmer();
|
|
||||||
const searchTerms = new Set();
|
|
||||||
const excludedTerms = new Set();
|
|
||||||
const highlightTerms = new Set();
|
|
||||||
const objectTerms = new Set(splitQuery(query.toLowerCase().trim()));
|
|
||||||
splitQuery(query.trim()).forEach((queryTerm) => {
|
|
||||||
const queryTermLower = queryTerm.toLowerCase();
|
|
||||||
|
|
||||||
// maybe skip this "word"
|
|
||||||
// stopwords array is from language_data.js
|
|
||||||
if (
|
|
||||||
stopwords.indexOf(queryTermLower) !== -1 ||
|
|
||||||
queryTerm.match(/^\d+$/)
|
|
||||||
)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// stem the word
|
|
||||||
let word = stemmer.stemWord(queryTermLower);
|
|
||||||
// select the correct list
|
|
||||||
if (word[0] === "-") excludedTerms.add(word.substr(1));
|
|
||||||
else {
|
|
||||||
searchTerms.add(word);
|
|
||||||
highlightTerms.add(queryTermLower);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js
|
|
||||||
localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" "))
|
|
||||||
}
|
|
||||||
|
|
||||||
// console.debug("SEARCH: searching for:");
|
|
||||||
// console.info("required: ", [...searchTerms]);
|
|
||||||
// console.info("excluded: ", [...excludedTerms]);
|
|
||||||
|
|
||||||
return [query, searchTerms, excludedTerms, highlightTerms, objectTerms];
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* execute search (requires search index to be loaded)
|
|
||||||
*/
|
|
||||||
_performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => {
|
|
||||||
const filenames = Search._index.filenames;
|
|
||||||
const docNames = Search._index.docnames;
|
|
||||||
const titles = Search._index.titles;
|
|
||||||
const allTitles = Search._index.alltitles;
|
|
||||||
const indexEntries = Search._index.indexentries;
|
|
||||||
|
|
||||||
// Collect multiple result groups to be sorted separately and then ordered.
|
|
||||||
// Each is an array of [docname, title, anchor, descr, score, filename, kind].
|
|
||||||
const normalResults = [];
|
|
||||||
const nonMainIndexResults = [];
|
|
||||||
|
|
||||||
_removeChildren(document.getElementById("search-progress"));
|
|
||||||
|
|
||||||
const queryLower = query.toLowerCase().trim();
|
|
||||||
for (const [title, foundTitles] of Object.entries(allTitles)) {
|
|
||||||
if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) {
|
|
||||||
for (const [file, id] of foundTitles) {
|
|
||||||
const score = Math.round(Scorer.title * queryLower.length / title.length);
|
|
||||||
const boost = titles[file] === title ? 1 : 0; // add a boost for document titles
|
|
||||||
normalResults.push([
|
|
||||||
docNames[file],
|
|
||||||
titles[file] !== title ? `${titles[file]} > ${title}` : title,
|
|
||||||
id !== null ? "#" + id : "",
|
|
||||||
null,
|
|
||||||
score + boost,
|
|
||||||
filenames[file],
|
|
||||||
SearchResultKind.title,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// search for explicit entries in index directives
|
|
||||||
for (const [entry, foundEntries] of Object.entries(indexEntries)) {
|
|
||||||
if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) {
|
|
||||||
for (const [file, id, isMain] of foundEntries) {
|
|
||||||
const score = Math.round(100 * queryLower.length / entry.length);
|
|
||||||
const result = [
|
|
||||||
docNames[file],
|
|
||||||
titles[file],
|
|
||||||
id ? "#" + id : "",
|
|
||||||
null,
|
|
||||||
score,
|
|
||||||
filenames[file],
|
|
||||||
SearchResultKind.index,
|
|
||||||
];
|
|
||||||
if (isMain) {
|
|
||||||
normalResults.push(result);
|
|
||||||
} else {
|
|
||||||
nonMainIndexResults.push(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// lookup as object
|
|
||||||
objectTerms.forEach((term) =>
|
|
||||||
normalResults.push(...Search.performObjectSearch(term, objectTerms))
|
|
||||||
);
|
|
||||||
|
|
||||||
// lookup as search terms in fulltext
|
|
||||||
normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms));
|
|
||||||
|
|
||||||
// let the scorer override scores with a custom scoring function
|
|
||||||
if (Scorer.score) {
|
|
||||||
normalResults.forEach((item) => (item[4] = Scorer.score(item)));
|
|
||||||
nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item)));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sort each group of results by score and then alphabetically by name.
|
|
||||||
normalResults.sort(_orderResultsByScoreThenName);
|
|
||||||
nonMainIndexResults.sort(_orderResultsByScoreThenName);
|
|
||||||
|
|
||||||
// Combine the result groups in (reverse) order.
|
|
||||||
// Non-main index entries are typically arbitrary cross-references,
|
|
||||||
// so display them after other results.
|
|
||||||
let results = [...nonMainIndexResults, ...normalResults];
|
|
||||||
|
|
||||||
// remove duplicate search results
|
|
||||||
// note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept
|
|
||||||
let seen = new Set();
|
|
||||||
results = results.reverse().reduce((acc, result) => {
|
|
||||||
let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(',');
|
|
||||||
if (!seen.has(resultStr)) {
|
|
||||||
acc.push(result);
|
|
||||||
seen.add(resultStr);
|
|
||||||
}
|
|
||||||
return acc;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return results.reverse();
|
|
||||||
},
|
|
||||||
|
|
||||||
query: (query) => {
|
|
||||||
const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query);
|
|
||||||
const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms);
|
|
||||||
|
|
||||||
// for debugging
|
|
||||||
//Search.lastresults = results.slice(); // a copy
|
|
||||||
// console.info("search results:", Search.lastresults);
|
|
||||||
|
|
||||||
// print the results
|
|
||||||
_displayNextItem(results, results.length, searchTerms, highlightTerms);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* search for object names
|
|
||||||
*/
|
|
||||||
performObjectSearch: (object, objectTerms) => {
|
|
||||||
const filenames = Search._index.filenames;
|
|
||||||
const docNames = Search._index.docnames;
|
|
||||||
const objects = Search._index.objects;
|
|
||||||
const objNames = Search._index.objnames;
|
|
||||||
const titles = Search._index.titles;
|
|
||||||
|
|
||||||
const results = [];
|
|
||||||
|
|
||||||
const objectSearchCallback = (prefix, match) => {
|
|
||||||
const name = match[4]
|
|
||||||
const fullname = (prefix ? prefix + "." : "") + name;
|
|
||||||
const fullnameLower = fullname.toLowerCase();
|
|
||||||
if (fullnameLower.indexOf(object) < 0) return;
|
|
||||||
|
|
||||||
let score = 0;
|
|
||||||
const parts = fullnameLower.split(".");
|
|
||||||
|
|
||||||
// check for different match types: exact matches of full name or
|
|
||||||
// "last name" (i.e. last dotted part)
|
|
||||||
if (fullnameLower === object || parts.slice(-1)[0] === object)
|
|
||||||
score += Scorer.objNameMatch;
|
|
||||||
else if (parts.slice(-1)[0].indexOf(object) > -1)
|
|
||||||
score += Scorer.objPartialMatch; // matches in last name
|
|
||||||
|
|
||||||
const objName = objNames[match[1]][2];
|
|
||||||
const title = titles[match[0]];
|
|
||||||
|
|
||||||
// If more than one term searched for, we require other words to be
|
|
||||||
// found in the name/title/description
|
|
||||||
const otherTerms = new Set(objectTerms);
|
|
||||||
otherTerms.delete(object);
|
|
||||||
if (otherTerms.size > 0) {
|
|
||||||
const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase();
|
|
||||||
if (
|
|
||||||
[...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0)
|
|
||||||
)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let anchor = match[3];
|
|
||||||
if (anchor === "") anchor = fullname;
|
|
||||||
else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname;
|
|
||||||
|
|
||||||
const descr = objName + _(", in ") + title;
|
|
||||||
|
|
||||||
// add custom score for some objects according to scorer
|
|
||||||
if (Scorer.objPrio.hasOwnProperty(match[2]))
|
|
||||||
score += Scorer.objPrio[match[2]];
|
|
||||||
else score += Scorer.objPrioDefault;
|
|
||||||
|
|
||||||
results.push([
|
|
||||||
docNames[match[0]],
|
|
||||||
fullname,
|
|
||||||
"#" + anchor,
|
|
||||||
descr,
|
|
||||||
score,
|
|
||||||
filenames[match[0]],
|
|
||||||
SearchResultKind.object,
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
Object.keys(objects).forEach((prefix) =>
|
|
||||||
objects[prefix].forEach((array) =>
|
|
||||||
objectSearchCallback(prefix, array)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
return results;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* search for full-text terms in the index
|
|
||||||
*/
|
|
||||||
performTermsSearch: (searchTerms, excludedTerms) => {
|
|
||||||
// prepare search
|
|
||||||
const terms = Search._index.terms;
|
|
||||||
const titleTerms = Search._index.titleterms;
|
|
||||||
const filenames = Search._index.filenames;
|
|
||||||
const docNames = Search._index.docnames;
|
|
||||||
const titles = Search._index.titles;
|
|
||||||
|
|
||||||
const scoreMap = new Map();
|
|
||||||
const fileMap = new Map();
|
|
||||||
|
|
||||||
// perform the search on the required terms
|
|
||||||
searchTerms.forEach((word) => {
|
|
||||||
const files = [];
|
|
||||||
const arr = [
|
|
||||||
{ files: terms[word], score: Scorer.term },
|
|
||||||
{ files: titleTerms[word], score: Scorer.title },
|
|
||||||
];
|
|
||||||
// add support for partial matches
|
|
||||||
if (word.length > 2) {
|
|
||||||
const escapedWord = _escapeRegExp(word);
|
|
||||||
if (!terms.hasOwnProperty(word)) {
|
|
||||||
Object.keys(terms).forEach((term) => {
|
|
||||||
if (term.match(escapedWord))
|
|
||||||
arr.push({ files: terms[term], score: Scorer.partialTerm });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!titleTerms.hasOwnProperty(word)) {
|
|
||||||
Object.keys(titleTerms).forEach((term) => {
|
|
||||||
if (term.match(escapedWord))
|
|
||||||
arr.push({ files: titleTerms[term], score: Scorer.partialTitle });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// no match but word was a required one
|
|
||||||
if (arr.every((record) => record.files === undefined)) return;
|
|
||||||
|
|
||||||
// found search word in contents
|
|
||||||
arr.forEach((record) => {
|
|
||||||
if (record.files === undefined) return;
|
|
||||||
|
|
||||||
let recordFiles = record.files;
|
|
||||||
if (recordFiles.length === undefined) recordFiles = [recordFiles];
|
|
||||||
files.push(...recordFiles);
|
|
||||||
|
|
||||||
// set score for the word in each file
|
|
||||||
recordFiles.forEach((file) => {
|
|
||||||
if (!scoreMap.has(file)) scoreMap.set(file, {});
|
|
||||||
scoreMap.get(file)[word] = record.score;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// create the mapping
|
|
||||||
files.forEach((file) => {
|
|
||||||
if (!fileMap.has(file)) fileMap.set(file, [word]);
|
|
||||||
else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// now check if the files don't contain excluded terms
|
|
||||||
const results = [];
|
|
||||||
for (const [file, wordList] of fileMap) {
|
|
||||||
// check if all requirements are matched
|
|
||||||
|
|
||||||
// as search terms with length < 3 are discarded
|
|
||||||
const filteredTermCount = [...searchTerms].filter(
|
|
||||||
(term) => term.length > 2
|
|
||||||
).length;
|
|
||||||
if (
|
|
||||||
wordList.length !== searchTerms.size &&
|
|
||||||
wordList.length !== filteredTermCount
|
|
||||||
)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// ensure that none of the excluded terms is in the search result
|
|
||||||
if (
|
|
||||||
[...excludedTerms].some(
|
|
||||||
(term) =>
|
|
||||||
terms[term] === file ||
|
|
||||||
titleTerms[term] === file ||
|
|
||||||
(terms[term] || []).includes(file) ||
|
|
||||||
(titleTerms[term] || []).includes(file)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// select one (max) score for the file.
|
|
||||||
const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w]));
|
|
||||||
// add result to the result list
|
|
||||||
results.push([
|
|
||||||
docNames[file],
|
|
||||||
titles[file],
|
|
||||||
"",
|
|
||||||
null,
|
|
||||||
score,
|
|
||||||
filenames[file],
|
|
||||||
SearchResultKind.text,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
return results;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* helper function to return a node containing the
|
|
||||||
* search summary for a given text. keywords is a list
|
|
||||||
* of stemmed words.
|
|
||||||
*/
|
|
||||||
makeSearchSummary: (htmlText, keywords, anchor) => {
|
|
||||||
const text = Search.htmlToText(htmlText, anchor);
|
|
||||||
if (text === "") return null;
|
|
||||||
|
|
||||||
const textLower = text.toLowerCase();
|
|
||||||
const actualStartPosition = [...keywords]
|
|
||||||
.map((k) => textLower.indexOf(k.toLowerCase()))
|
|
||||||
.filter((i) => i > -1)
|
|
||||||
.slice(-1)[0];
|
|
||||||
const startWithContext = Math.max(actualStartPosition - 120, 0);
|
|
||||||
|
|
||||||
const top = startWithContext === 0 ? "" : "...";
|
|
||||||
const tail = startWithContext + 240 < text.length ? "..." : "";
|
|
||||||
|
|
||||||
let summary = document.createElement("p");
|
|
||||||
summary.classList.add("context");
|
|
||||||
summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;
|
|
||||||
|
|
||||||
return summary;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
_ready(Search.init);
|
|
||||||
@ -1,154 +0,0 @@
|
|||||||
/* Highlighting utilities for Sphinx HTML documentation. */
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
const SPHINX_HIGHLIGHT_ENABLED = true
|
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight a given string on a node by wrapping it in
|
|
||||||
* span elements with the given class name.
|
|
||||||
*/
|
|
||||||
const _highlight = (node, addItems, text, className) => {
|
|
||||||
if (node.nodeType === Node.TEXT_NODE) {
|
|
||||||
const val = node.nodeValue;
|
|
||||||
const parent = node.parentNode;
|
|
||||||
const pos = val.toLowerCase().indexOf(text);
|
|
||||||
if (
|
|
||||||
pos >= 0 &&
|
|
||||||
!parent.classList.contains(className) &&
|
|
||||||
!parent.classList.contains("nohighlight")
|
|
||||||
) {
|
|
||||||
let span;
|
|
||||||
|
|
||||||
const closestNode = parent.closest("body, svg, foreignObject");
|
|
||||||
const isInSVG = closestNode && closestNode.matches("svg");
|
|
||||||
if (isInSVG) {
|
|
||||||
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
||||||
} else {
|
|
||||||
span = document.createElement("span");
|
|
||||||
span.classList.add(className);
|
|
||||||
}
|
|
||||||
|
|
||||||
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
|
||||||
const rest = document.createTextNode(val.substr(pos + text.length));
|
|
||||||
parent.insertBefore(
|
|
||||||
span,
|
|
||||||
parent.insertBefore(
|
|
||||||
rest,
|
|
||||||
node.nextSibling
|
|
||||||
)
|
|
||||||
);
|
|
||||||
node.nodeValue = val.substr(0, pos);
|
|
||||||
/* There may be more occurrences of search term in this node. So call this
|
|
||||||
* function recursively on the remaining fragment.
|
|
||||||
*/
|
|
||||||
_highlight(rest, addItems, text, className);
|
|
||||||
|
|
||||||
if (isInSVG) {
|
|
||||||
const rect = document.createElementNS(
|
|
||||||
"http://www.w3.org/2000/svg",
|
|
||||||
"rect"
|
|
||||||
);
|
|
||||||
const bbox = parent.getBBox();
|
|
||||||
rect.x.baseVal.value = bbox.x;
|
|
||||||
rect.y.baseVal.value = bbox.y;
|
|
||||||
rect.width.baseVal.value = bbox.width;
|
|
||||||
rect.height.baseVal.value = bbox.height;
|
|
||||||
rect.setAttribute("class", className);
|
|
||||||
addItems.push({ parent: parent, target: rect });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (node.matches && !node.matches("button, select, textarea")) {
|
|
||||||
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const _highlightText = (thisNode, text, className) => {
|
|
||||||
let addItems = [];
|
|
||||||
_highlight(thisNode, addItems, text, className);
|
|
||||||
addItems.forEach((obj) =>
|
|
||||||
obj.parent.insertAdjacentElement("beforebegin", obj.target)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Small JavaScript module for the documentation.
|
|
||||||
*/
|
|
||||||
const SphinxHighlight = {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* highlight the search words provided in localstorage in the text
|
|
||||||
*/
|
|
||||||
highlightSearchWords: () => {
|
|
||||||
if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight
|
|
||||||
|
|
||||||
// get and clear terms from localstorage
|
|
||||||
const url = new URL(window.location);
|
|
||||||
const highlight =
|
|
||||||
localStorage.getItem("sphinx_highlight_terms")
|
|
||||||
|| url.searchParams.get("highlight")
|
|
||||||
|| "";
|
|
||||||
localStorage.removeItem("sphinx_highlight_terms")
|
|
||||||
url.searchParams.delete("highlight");
|
|
||||||
window.history.replaceState({}, "", url);
|
|
||||||
|
|
||||||
// get individual terms from highlight string
|
|
||||||
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
|
|
||||||
if (terms.length === 0) return; // nothing to do
|
|
||||||
|
|
||||||
// There should never be more than one element matching "div.body"
|
|
||||||
const divBody = document.querySelectorAll("div.body");
|
|
||||||
const body = divBody.length ? divBody[0] : document.querySelector("body");
|
|
||||||
window.setTimeout(() => {
|
|
||||||
terms.forEach((term) => _highlightText(body, term, "highlighted"));
|
|
||||||
}, 10);
|
|
||||||
|
|
||||||
const searchBox = document.getElementById("searchbox");
|
|
||||||
if (searchBox === null) return;
|
|
||||||
searchBox.appendChild(
|
|
||||||
document
|
|
||||||
.createRange()
|
|
||||||
.createContextualFragment(
|
|
||||||
'<p class="highlight-link">' +
|
|
||||||
'<a href="javascript:SphinxHighlight.hideSearchWords()">' +
|
|
||||||
_("Hide Search Matches") +
|
|
||||||
"</a></p>"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* helper function to hide the search marks again
|
|
||||||
*/
|
|
||||||
hideSearchWords: () => {
|
|
||||||
document
|
|
||||||
.querySelectorAll("#searchbox .highlight-link")
|
|
||||||
.forEach((el) => el.remove());
|
|
||||||
document
|
|
||||||
.querySelectorAll("span.highlighted")
|
|
||||||
.forEach((el) => el.classList.remove("highlighted"));
|
|
||||||
localStorage.removeItem("sphinx_highlight_terms")
|
|
||||||
},
|
|
||||||
|
|
||||||
initEscapeListener: () => {
|
|
||||||
// only install a listener if it is really needed
|
|
||||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return;
|
|
||||||
|
|
||||||
document.addEventListener("keydown", (event) => {
|
|
||||||
// bail for input elements
|
|
||||||
if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
|
|
||||||
// bail with special keys
|
|
||||||
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
|
|
||||||
if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) {
|
|
||||||
SphinxHighlight.hideSearchWords();
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
_ready(() => {
|
|
||||||
/* Do not call highlightSearchWords() when we are on the search page.
|
|
||||||
* It will highlight words from the *previous* search query.
|
|
||||||
*/
|
|
||||||
if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords();
|
|
||||||
SphinxHighlight.initEscapeListener();
|
|
||||||
});
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
Documentation.addTranslations({
|
|
||||||
"locale": "fr",
|
|
||||||
"messages": {
|
|
||||||
"%(filename)s — %(docstitle)s": "%(filename)s — %(docstitle)s",
|
|
||||||
"© %(copyright_prefix)s %(copyright)s.": "© %(copyright_prefix)s %(copyright)s.",
|
|
||||||
", in ": ", dans ",
|
|
||||||
"About these documents": "\u00c0 propos de ces documents",
|
|
||||||
"Automatically generated list of changes in version %(version)s": "Liste auto-g\u00e9n\u00e9r\u00e9e des modifications dans la version %(version)s",
|
|
||||||
"C API changes": "Modifications de l'API C",
|
|
||||||
"Changes in Version %(version)s — %(docstitle)s": "Changements dans la version %(version)s — %(docstitle)s",
|
|
||||||
"Collapse sidebar": "R\u00e9duire la barre lat\u00e9rale",
|
|
||||||
"Complete Table of Contents": "Table des mati\u00e8res compl\u00e8te",
|
|
||||||
"Contents": "Contenu",
|
|
||||||
"Copyright": "Copyright",
|
|
||||||
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "Cr\u00e9\u00e9 en utilisant <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.",
|
|
||||||
"Expand sidebar": "Agrandir la barre lat\u00e9rale",
|
|
||||||
"Full index on one page": "Index complet sur une seule page",
|
|
||||||
"General Index": "Index g\u00e9n\u00e9ral",
|
|
||||||
"Global Module Index": "Index g\u00e9n\u00e9ral des modules",
|
|
||||||
"Go": "Go",
|
|
||||||
"Hide Search Matches": "Cacher les r\u00e9sultats de la recherche",
|
|
||||||
"Index": "Index",
|
|
||||||
"Index – %(key)s": "Index – %(key)s",
|
|
||||||
"Index pages by letter": "Indexer les pages par lettre",
|
|
||||||
"Indices and tables:": "Index et tables :",
|
|
||||||
"Last updated on %(last_updated)s.": "Mis \u00e0 jour le %(last_updated)s.",
|
|
||||||
"Library changes": "Modifications de la biblioth\u00e8que",
|
|
||||||
"Navigation": "Navigation",
|
|
||||||
"Next topic": "Sujet suivant",
|
|
||||||
"Other changes": "Autres modifications",
|
|
||||||
"Overview": "R\u00e9sum\u00e9",
|
|
||||||
"Please activate JavaScript to enable the search\n functionality.": "Veuillez activer le JavaScript pour que la recherche fonctionne.",
|
|
||||||
"Preparing search...": "Pr\u00e9paration de la recherche...",
|
|
||||||
"Previous topic": "Sujet pr\u00e9c\u00e9dent",
|
|
||||||
"Quick search": "Recherche rapide",
|
|
||||||
"Search": "Recherche",
|
|
||||||
"Search Page": "Page de recherche",
|
|
||||||
"Search Results": "R\u00e9sultats de la recherche",
|
|
||||||
"Search finished, found one page matching the search query.": [
|
|
||||||
"La recherche est termin\u00e9e, une page correspondant \u00e0 la requ\u00eate a \u00e9t\u00e9 trouv\u00e9e.",
|
|
||||||
"Recherche termin\u00e9e, ${resultCount} pages trouv\u00e9es correspondant \u00e0 la requ\u00eate.",
|
|
||||||
"Recherche termin\u00e9e, ${resultCount} pages trouv\u00e9es correspondant \u00e0 la requ\u00eate."
|
|
||||||
],
|
|
||||||
"Search within %(docstitle)s": "Recherchez dans %(docstitle)s",
|
|
||||||
"Searching": "Recherche en cours",
|
|
||||||
"Searching for multiple words only shows matches that contain\n all words.": "Une recherche sur plusieurs mots ne retourne que les r\u00e9sultats contenant tous les mots.",
|
|
||||||
"Show Source": "Montrer le code source",
|
|
||||||
"Table of Contents": "Table des mati\u00e8res",
|
|
||||||
"This Page": "Cette page",
|
|
||||||
"Welcome! This is": "Bienvenue ! Ceci est",
|
|
||||||
"Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Votre recherche ne correspond \u00e0 aucun document. Veuillez v\u00e9rifier que les mots sont correctement orthographi\u00e9s et que vous avez s\u00e9lectionn\u00e9 assez de cat\u00e9gories.",
|
|
||||||
"all functions, classes, terms": "toutes les fonctions, classes, termes",
|
|
||||||
"can be huge": "peut \u00eatre \u00e9norme",
|
|
||||||
"last updated": "derni\u00e8re modification",
|
|
||||||
"lists all sections and subsections": "lister l'ensemble des sections et sous-sections",
|
|
||||||
"next chapter": "Chapitre suivant",
|
|
||||||
"previous chapter": "Chapitre pr\u00e9c\u00e9dent",
|
|
||||||
"quick access to all modules": "acc\u00e8s rapide \u00e0 l'ensemble des modules",
|
|
||||||
"search": "rechercher",
|
|
||||||
"search this documentation": "rechercher dans cette documentation",
|
|
||||||
"the documentation for": "la documentation pour"
|
|
||||||
},
|
|
||||||
"plural_expr": "(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2"
|
|
||||||
});
|
|
||||||
@ -1,101 +0,0 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
|
|
||||||
<html lang="fr" data-content_root="./">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>Index — Documentation BlackJack Gab </title>
|
|
||||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=649a27d8" />
|
|
||||||
<link rel="stylesheet" type="text/css" href="_static/bizstyle.css?v=5283bb3d" />
|
|
||||||
|
|
||||||
<script src="_static/documentation_options.js?v=d1a510d7"></script>
|
|
||||||
<script src="_static/doctools.js?v=9bcbadda"></script>
|
|
||||||
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
||||||
<script src="_static/translations.js?v=e6b791cb"></script>
|
|
||||||
<script src="_static/bizstyle.js"></script>
|
|
||||||
<link rel="index" title="Index" href="#" />
|
|
||||||
<link rel="search" title="Recherche" href="search.html" />
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="_static/css3-mediaqueries.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
</head><body>
|
|
||||||
<div class="related" role="navigation" aria-label="Related">
|
|
||||||
<h3>Navigation</h3>
|
|
||||||
<ul>
|
|
||||||
<li class="right" style="margin-right: 10px">
|
|
||||||
<a href="#" title="Index général"
|
|
||||||
accesskey="I">index</a></li>
|
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">Documentation BlackJack Gab </a> »</li>
|
|
||||||
<li class="nav-item nav-item-this"><a href="">Index</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="document">
|
|
||||||
<div class="documentwrapper">
|
|
||||||
<div class="bodywrapper">
|
|
||||||
<div class="body" role="main">
|
|
||||||
|
|
||||||
|
|
||||||
<h1 id="index">Index</h1>
|
|
||||||
|
|
||||||
<div class="genindex-jumpbox">
|
|
||||||
<a href="#B"><strong>B</strong></a>
|
|
||||||
| <a href="#R"><strong>R</strong></a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<h2 id="B">B</h2>
|
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
|
||||||
<li><a href="index.html#index-0">Blackjack</a>
|
|
||||||
</li>
|
|
||||||
</ul></td>
|
|
||||||
</tr></table>
|
|
||||||
|
|
||||||
<h2 id="R">R</h2>
|
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
|
||||||
<li><a href="roulette.html#index-0">roulette</a>
|
|
||||||
</li>
|
|
||||||
</ul></td>
|
|
||||||
</tr></table>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="clearer"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="sphinxsidebar" role="navigation" aria-label="Main">
|
|
||||||
<div class="sphinxsidebarwrapper">
|
|
||||||
<search id="searchbox" style="display: none" role="search">
|
|
||||||
<h3 id="searchlabel">Recherche rapide</h3>
|
|
||||||
<div class="searchformwrapper">
|
|
||||||
<form class="search" action="search.html" method="get">
|
|
||||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
|
||||||
<input type="submit" value="Go" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</search>
|
|
||||||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="clearer"></div>
|
|
||||||
</div>
|
|
||||||
<div class="related" role="navigation" aria-label="Related">
|
|
||||||
<h3>Navigation</h3>
|
|
||||||
<ul>
|
|
||||||
<li class="right" style="margin-right: 10px">
|
|
||||||
<a href="#" title="Index général"
|
|
||||||
>index</a></li>
|
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">Documentation BlackJack Gab </a> »</li>
|
|
||||||
<li class="nav-item nav-item-this"><a href="">Index</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="footer" role="contentinfo">
|
|
||||||
© Copyright 2025, Gab.
|
|
||||||
Créé en utilisant <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
|
|
||||||
<html lang="fr" data-content_root="./">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>Recherche — Documentation BlackJack Gab </title>
|
|
||||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=649a27d8" />
|
|
||||||
<link rel="stylesheet" type="text/css" href="_static/bizstyle.css?v=5283bb3d" />
|
|
||||||
|
|
||||||
|
|
||||||
<script src="_static/documentation_options.js?v=d1a510d7"></script>
|
|
||||||
<script src="_static/doctools.js?v=9bcbadda"></script>
|
|
||||||
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
||||||
<script src="_static/translations.js?v=e6b791cb"></script>
|
|
||||||
<script src="_static/bizstyle.js"></script>
|
|
||||||
<script src="_static/searchtools.js"></script>
|
|
||||||
<script src="_static/language_data.js"></script>
|
|
||||||
<link rel="index" title="Index" href="genindex.html" />
|
|
||||||
<link rel="search" title="Recherche" href="#" />
|
|
||||||
<script src="searchindex.js" defer="defer"></script>
|
|
||||||
<meta name="robots" content="noindex" />
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="_static/css3-mediaqueries.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
</head><body>
|
|
||||||
<div class="related" role="navigation" aria-label="Related">
|
|
||||||
<h3>Navigation</h3>
|
|
||||||
<ul>
|
|
||||||
<li class="right" style="margin-right: 10px">
|
|
||||||
<a href="genindex.html" title="Index général"
|
|
||||||
accesskey="I">index</a></li>
|
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">Documentation BlackJack Gab </a> »</li>
|
|
||||||
<li class="nav-item nav-item-this"><a href="">Recherche</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="document">
|
|
||||||
<div class="documentwrapper">
|
|
||||||
<div class="bodywrapper">
|
|
||||||
<div class="body" role="main">
|
|
||||||
|
|
||||||
<h1 id="search-documentation">Recherche</h1>
|
|
||||||
|
|
||||||
<noscript>
|
|
||||||
<div class="admonition warning">
|
|
||||||
<p>
|
|
||||||
Veuillez activer le JavaScript pour que la recherche fonctionne.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</noscript>
|
|
||||||
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Une recherche sur plusieurs mots ne retourne que les résultats contenant tous les mots.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
<form action="" method="get">
|
|
||||||
<input type="text" name="q" aria-labelledby="search-documentation" value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
|
||||||
<input type="submit" value="rechercher" />
|
|
||||||
<span id="search-progress" style="padding-left: 10px"></span>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="search-results"></div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="clearer"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="sphinxsidebar" role="navigation" aria-label="Main">
|
|
||||||
<div class="sphinxsidebarwrapper">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="clearer"></div>
|
|
||||||
</div>
|
|
||||||
<div class="related" role="navigation" aria-label="Related">
|
|
||||||
<h3>Navigation</h3>
|
|
||||||
<ul>
|
|
||||||
<li class="right" style="margin-right: 10px">
|
|
||||||
<a href="genindex.html" title="Index général"
|
|
||||||
>index</a></li>
|
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">Documentation BlackJack Gab </a> »</li>
|
|
||||||
<li class="nav-item nav-item-this"><a href="">Recherche</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="footer" role="contentinfo">
|
|
||||||
© Copyright 2025, Gab.
|
|
||||||
Créé en utilisant <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
Search.setIndex({"alltitles": {"Conclusion": [[0, "conclusion"]], "Contents:": [[0, null]], "Dieu Ecaflip": [[0, "dieu-ecaflip"]], "Introduction": [[0, "introduction"]], "La roulette": [[1, null]], "Le Blackjack : R\u00e8gles et Strat\u00e9gies": [[0, "le-blackjack-regles-et-strategies"]], "R\u00e8gles de base": [[0, "regles-de-base"]], "Strat\u00e9gies simples": [[0, "strategies-simples"]]}, "docnames": ["index", "roulette"], "envversion": {"sphinx": 64, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": ["index.rst", "roulette.rst"], "indexentries": {"blackjack": [[0, "index-0", false]], "roulette": [[1, "index-0", false]]}, "objects": {}, "objnames": {}, "objtypes": {}, "terms": {"1": 0, "10": 0, "11": 0, "2": 0, "21": 0, "Avec": 0, "En": 0, "Il": 0, "L": 0, "La": 0, "Les": 0, "actuel": 0, "ailleur": 0, "amateur": 0, "amour": 0, "appel": 0, "appren": 0, "arr\u00eat": 0, "automat": 0, "avantag": 0, "battr": 0, "budget": 0, "cart": 0, "casinos": 0, "cass": 0, "celui": 0, "ceux": 0, "chanc": 0, "chaqu": 0, "chiffr": 0, "chouet": 1, "ci": 0, "combin": 0, "conna\u00eetr": 0, "connu": 0, "croupi": 0, "dam": 0, "dan": 0, "dem": 0, "demand": 0, "dep": 0, "deux": 0, "dieux": 0, "discipl": 0, "dont": 0, "douz": 0, "d\u00e9": 0, "d\u00e9pass": 0, "d\u00e9velopp": 0, "enti": 0, "fair": 0, "fait": 0, "favor": 0, "figur": 0, "fix": 0, "fonction": 0, "fortun": 0, "gain": 0, "ger": 0, "hasard": 0, "h\u00e9sitent": 0, "initial": 0, "jam": 0, "jeu": 0, "jeux": 0, "jou": 0, "joueur": 0, "kk": 0, "lanc": 0, "limit": 0, "main": 0, "majeur": 0, "mani": 0, "mesur": 0, "mond": 0, "m\u00eam": 0, "nom": 0, "nominal": 0, "non": 0, "num\u00e9rot": 0, "object": 0, "pari": 0, "part": 0, "pass": 0, "passion": 0, "perd": 0, "pert": 0, "peut": 0, "peuvent": 0, "plus": 0, "populair": 0, "possibl": 0, "prendr": 0, "principal": 0, "probabl": 0, "proch": 0, "pr\u00e9fer": 0, "quand": 0, "rend": 0, "respons": 0, "rest": 0, "re\u00e7oit": 0, "risqu": 0, "roi": 0, "roulet": 0, "san": 0, "saut": 0, "savoir": 0, "selon": 0, "ser": 0, "si": 0, "somm": 0, "sous": 0, "souvent": 0, "sup": 1, "suppl\u00e9mentair": 0, "surtout": 0, "tir": 0, "total": 0, "valent": 0, "valet": 0, "valeur": 0, "valoir": 0, "vi": 0, "visibl": 0, "votr": 0, "\u00e7a": 0, "\u00e9gal": 0, "\u00e9valu": 0, "\u00eate": 0}, "titles": ["Le Blackjack : R\u00e8gles et Strat\u00e9gies", "La roulette"], "titleterms": {"La": 1, "Le": 0, "bas": 0, "blackjack": 0, "conclus": 0, "content": 0, "dieu": 0, "ecaflip": 0, "introduct": 0, "regl": 0, "roulet": 1, "simpl": 0, "strateg": 0}})
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
# Configuration file for the Sphinx documentation builder.
|
|
||||||
#
|
|
||||||
# For the full list of built-in configuration values, see the documentation:
|
|
||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
|
||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
||||||
|
|
||||||
project = 'BlackJack Gab'
|
|
||||||
copyright = '2025, Gab'
|
|
||||||
author = 'Gab'
|
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
|
||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
||||||
|
|
||||||
extensions = []
|
|
||||||
|
|
||||||
templates_path = ['_templates']
|
|
||||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
|
||||||
|
|
||||||
language = 'fr'
|
|
||||||
|
|
||||||
# -- Options for HTML output -------------------------------------------------
|
|
||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
||||||
|
|
||||||
html_theme = 'bizstyle'
|
|
||||||
html_static_path = ['_static']
|
|
||||||
|
Before Width: | Height: | Size: 733 KiB |
|
Before Width: | Height: | Size: 159 KiB |
@ -1,35 +0,0 @@
|
|||||||
@ECHO OFF
|
|
||||||
|
|
||||||
pushd %~dp0
|
|
||||||
|
|
||||||
REM Command file for Sphinx documentation
|
|
||||||
|
|
||||||
if "%SPHINXBUILD%" == "" (
|
|
||||||
set SPHINXBUILD=sphinx-build
|
|
||||||
)
|
|
||||||
set SOURCEDIR=.
|
|
||||||
set BUILDDIR=_build
|
|
||||||
|
|
||||||
%SPHINXBUILD% >NUL 2>NUL
|
|
||||||
if errorlevel 9009 (
|
|
||||||
echo.
|
|
||||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
||||||
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
||||||
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
||||||
echo.may add the Sphinx directory to PATH.
|
|
||||||
echo.
|
|
||||||
echo.If you don't have Sphinx installed, grab it from
|
|
||||||
echo.https://www.sphinx-doc.org/
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
|
|
||||||
if "%1" == "" goto help
|
|
||||||
|
|
||||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:help
|
|
||||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
||||||
|
|
||||||
:end
|
|
||||||
popd
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
La roulette
|
|
||||||
=====================
|
|
||||||
|
|
||||||
.. index:: roulette
|
|
||||||
|
|
||||||
La roulette c'est **super** chouette
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
FAISS (Facebook AI Similarity Search) est une bibliothèque développée par Facebook AI Research pour la recherche de similarité efficace et le clustering de vecteurs denses. Elle est souvent utilisée pour créer des bases de données vectorielles, qui permettent de stocker et de rechercher des embeddings de manière efficace. Voici comment vous pouvez installer et utiliser FAISS :
|
|
||||||
|
|
||||||
### Installation de FAISS
|
|
||||||
|
|
||||||
1. **Installer FAISS** : Vous pouvez installer FAISS via pip. Il est recommandé d'installer la version avec support GPU si vous avez une carte graphique compatible.
|
|
||||||
|
|
||||||
Pour une installation CPU :
|
|
||||||
```bash
|
|
||||||
pip install faiss-cpu
|
|
||||||
```
|
|
||||||
|
|
||||||
Pour une installation GPU (nécessite CUDA) :
|
|
||||||
```bash
|
|
||||||
pip install faiss-gpu
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Vérifier l'installation** : Vous pouvez vérifier que FAISS est correctement installé en important la bibliothèque dans un script Python :
|
|
||||||
|
|
||||||
```python
|
|
||||||
import faiss
|
|
||||||
print(faiss.__version__)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Utilisation de FAISS
|
|
||||||
|
|
||||||
Voici un exemple simple de l'utilisation de FAISS pour créer une base de données vectorielle et effectuer une recherche :
|
|
||||||
|
|
||||||
```python
|
|
||||||
import faiss
|
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
# Exemple de données : des vecteurs aléatoires
|
|
||||||
data = np.random.random((100, 128)).astype('float32')
|
|
||||||
|
|
||||||
# Créer un index FAISS
|
|
||||||
index = faiss.IndexFlatL2(128) # 128 est la dimension des vecteurs
|
|
||||||
|
|
||||||
# Ajouter des vecteurs à l'index
|
|
||||||
index.add(data)
|
|
||||||
|
|
||||||
# Effectuer une recherche : trouver les 5 vecteurs les plus similaires à une requête
|
|
||||||
query = np.random.random((1, 128)).astype('float32')
|
|
||||||
k = 5 # Nombre de voisins les plus proches à rechercher
|
|
||||||
distances, indices = index.search(query, k)
|
|
||||||
|
|
||||||
print("Indices des vecteurs les plus similaires :", indices)
|
|
||||||
print("Distances correspondantes :", distances)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Points Clés
|
|
||||||
|
|
||||||
- **Indexation** : FAISS permet de créer des index pour des vecteurs de haute dimension, ce qui permet de faire des recherches rapides.
|
|
||||||
- **Recherche de similarité** : Vous pouvez rechercher des vecteurs similaires en utilisant différentes métriques de distance (par exemple, L2).
|
|
||||||
- **Efficacité** : FAISS est optimisé pour gérer de grandes quantités de données et peut tirer parti des GPU pour accélérer les calculs.
|
|
||||||
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
Hello, World!
|
|
||||||
|
|
||||||
Cette phrase est souvent utilisée comme un premier programme dans de nombreux langages de programmation. Elle est simple et permet de vérifier que l'environnement de développement est correctement configuré.
|
|
||||||
|
|
||||||
L'origine de "Hello, World!" remonte aux années 1970. Elle a été popularisée par le livre "The C Programming Language" de Brian Kernighan et Dennis Ritchie. Depuis, elle est devenue une tradition dans l'apprentissage de la programmation.
|
|
||||||
|
|
||||||
Le programme "Hello, World!" est un excellent point de départ pour les débutants. Il permet de comprendre les bases de la syntaxe d'un langage de programmation et de voir comment compiler et exécuter un programme.
|
|
||||||
|
|
||||||
Dans certains langages, comme Python, afficher "Hello, World!" est très simple. Il suffit d'une seule ligne de code : print("Hello, World!"). D'autres langages peuvent nécessiter plus de lignes de code pour accomplir la même tâche.
|
|
||||||
|
|
||||||
Aujourd'hui, "Hello, World!" est plus qu'un simple programme. C'est un symbole de l'apprentissage de la programmation et une porte d'entrée vers le monde du développement logiciel.
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
import faiss
|
|
||||||
import numpy as np
|
|
||||||
from sentence_transformers import SentenceTransformer
|
|
||||||
|
|
||||||
# Étape 1 : Lire le fichier texte
|
|
||||||
def lire_fichier(fichier):
|
|
||||||
with open(fichier, 'r', encoding='utf-8') as file:
|
|
||||||
return file.read()
|
|
||||||
|
|
||||||
# Étape 2 : Découper le texte en chunks
|
|
||||||
def decouper_texte(texte, taille_chunk=100):
|
|
||||||
mots = texte.split()
|
|
||||||
chunks = [' '.join(mots[i:i + taille_chunk]) for i in range(0, len(mots), taille_chunk)]
|
|
||||||
return chunks
|
|
||||||
|
|
||||||
# Étape 3 : Vectoriser les chunks avec SentenceTransformer
|
|
||||||
model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
|
|
||||||
|
|
||||||
def vectoriser_chunks(chunks):
|
|
||||||
vecteurs = model.encode(chunks)
|
|
||||||
return vecteurs
|
|
||||||
|
|
||||||
# Étape 4 : Stocker les vecteurs dans FAISS
|
|
||||||
def creer_index_faiss(vecteurs):
|
|
||||||
dimension = vecteurs.shape[1]
|
|
||||||
index = faiss.IndexFlatL2(dimension)
|
|
||||||
index.add(vecteurs)
|
|
||||||
return index
|
|
||||||
|
|
||||||
# Étape 5 : Interroger la base de données
|
|
||||||
def interroger_base(question, index, chunks, top_k=1):
|
|
||||||
question_vector = model.encode([question])
|
|
||||||
distances, indices = index.search(question_vector, top_k)
|
|
||||||
return [chunks[i] for i in indices[0]]
|
|
||||||
|
|
||||||
# Exemple d'utilisation
|
|
||||||
texte = lire_fichier('hello-world.txt')
|
|
||||||
chunks = decouper_texte(texte)
|
|
||||||
vecteurs = vectoriser_chunks(chunks)
|
|
||||||
index_faiss = creer_index_faiss(vecteurs)
|
|
||||||
|
|
||||||
question = "Quelle est la signification de 'hello world'?"
|
|
||||||
chunks_similaires = interroger_base(question, index_faiss, chunks)
|
|
||||||
|
|
||||||
print("Chunks les plus similaires question 1 :")
|
|
||||||
for chunk in chunks_similaires:
|
|
||||||
print(chunk)
|
|
||||||
|
|
||||||
|
|
||||||
question = "Comment afficher 'Hello, World!' en Python ?"
|
|
||||||
chunks_similaires = interroger_base(question, index_faiss, chunks)
|
|
||||||
|
|
||||||
print("Chunks les plus similaires question 2 :")
|
|
||||||
for chunk in chunks_similaires:
|
|
||||||
print(chunk)
|
|
||||||
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
# README.md
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
Ce programme permet de lire un fichier texte, de le découper en morceaux (chunks), de vectoriser ces morceaux à l'aide de SentenceTransformer, de stocker les vecteurs dans une base de données FAISS, et enfin d'interroger cette base de données pour trouver les morceaux les plus similaires à une question donnée.
|
|
||||||
|
|
||||||
## Prérequis
|
|
||||||
|
|
||||||
Avant d'exécuter ce programme, assurez-vous d'avoir installé les bibliothèques suivantes :
|
|
||||||
|
|
||||||
- `faiss`
|
|
||||||
- `numpy`
|
|
||||||
- `sentence-transformers`
|
|
||||||
|
|
||||||
Vous pouvez les installer via pip :
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pip install faiss-cpu numpy sentence-transformers
|
|
||||||
```
|
|
||||||
|
|
||||||
## Utilisation
|
|
||||||
|
|
||||||
### Étape 1 : Lire le fichier texte
|
|
||||||
|
|
||||||
La fonction `lire_fichier` lit le contenu d'un fichier texte donné.
|
|
||||||
|
|
||||||
```python
|
|
||||||
def lire_fichier(fichier):
|
|
||||||
with open(fichier, 'r', encoding='utf-8') as file:
|
|
||||||
return file.read()
|
|
||||||
```
|
|
||||||
|
|
||||||
### Étape 2 : Découper le texte en chunks
|
|
||||||
|
|
||||||
La fonction `decouper_texte` découpe le texte en morceaux de taille définie (par défaut 100 mots).
|
|
||||||
|
|
||||||
```python
|
|
||||||
def decouper_texte(texte, taille_chunk=100):
|
|
||||||
mots = texte.split()
|
|
||||||
chunks = [' '.join(mots[i:i + taille_chunk]) for i in range(0, len(mots), taille_chunk)]
|
|
||||||
return chunks
|
|
||||||
```
|
|
||||||
|
|
||||||
### Étape 3 : Vectoriser les chunks avec SentenceTransformer
|
|
||||||
|
|
||||||
La fonction `vectoriser_chunks` utilise le modèle `SentenceTransformer` pour vectoriser les morceaux de texte.
|
|
||||||
|
|
||||||
```python
|
|
||||||
model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
|
|
||||||
|
|
||||||
def vectoriser_chunks(chunks):
|
|
||||||
vecteurs = model.encode(chunks)
|
|
||||||
return vecteurs
|
|
||||||
```
|
|
||||||
|
|
||||||
### Étape 4 : Stocker les vecteurs dans FAISS
|
|
||||||
|
|
||||||
La fonction `creer_index_faiss` crée un index FAISS et y ajoute les vecteurs.
|
|
||||||
|
|
||||||
```python
|
|
||||||
def creer_index_faiss(vecteurs):
|
|
||||||
dimension = vecteurs.shape[1]
|
|
||||||
index = faiss.IndexFlatL2(dimension)
|
|
||||||
index.add(vecteurs)
|
|
||||||
return index
|
|
||||||
```
|
|
||||||
|
|
||||||
### Étape 5 : Interroger la base de données
|
|
||||||
|
|
||||||
La fonction `interroger_base` permet de rechercher les morceaux les plus similaires à une question donnée.
|
|
||||||
|
|
||||||
```python
|
|
||||||
def interroger_base(question, index, chunks, top_k=1):
|
|
||||||
question_vector = model.encode([question])
|
|
||||||
distances, indices = index.search(question_vector, top_k)
|
|
||||||
return [chunks[i] for i in indices[0]]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Exemple d'utilisation
|
|
||||||
|
|
||||||
Voici un exemple d'utilisation du programme :
|
|
||||||
|
|
||||||
```python
|
|
||||||
texte = lire_fichier('hello-world.txt')
|
|
||||||
chunks = decouper_texte(texte)
|
|
||||||
vecteurs = vectoriser_chunks(chunks)
|
|
||||||
index_faiss = creer_index_faiss(vecteurs)
|
|
||||||
|
|
||||||
question = "Quelle est la signification de 'hello world'?"
|
|
||||||
chunks_similaires = interroger_base(question, index_faiss, chunks)
|
|
||||||
print("Chunks les plus similaires à la question 1 :")
|
|
||||||
for chunk in chunks_similaires:
|
|
||||||
print(chunk)
|
|
||||||
|
|
||||||
question = "Comment afficher 'Hello, World!' en Python ?"
|
|
||||||
chunks_similaires = interroger_base(question, index_faiss, chunks)
|
|
||||||
print("Chunks les plus similaires à la question 2 :")
|
|
||||||
for chunk in chunks_similaires:
|
|
||||||
print(chunk)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Remarques
|
|
||||||
|
|
||||||
- Assurez-vous que le fichier `hello-world.txt` existe dans le même répertoire que le script.
|
|
||||||
- Vous pouvez ajuster la taille des chunks en modifiant le paramètre `taille_chunk` dans la fonction `decouper_texte`.
|
|
||||||
- Le modèle `SentenceTransformer` utilisé est `paraphrase-MiniLM-L6-v2`, mais vous pouvez en utiliser un autre si nécessaire.
|
|
||||||
|
|
||||||
## Licence
|
|
||||||
|
|
||||||
Ce projet est sous licence MIT. Voir le fichier `LICENSE` pour plus de détails.
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
faiss-cpu
|
|
||||||
sentence-transformers
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
# le modèle `paraphrase-MiniLM-L6-v2`
|
|
||||||
|
|
||||||
Le modèle `SentenceTransformer` est une bibliothèque Python conçue pour générer des représentations vectorielles (embeddings) de phrases ou de textes. Ces embeddings peuvent être utilisées pour diverses tâches de traitement du langage naturel (NLP), telles que la recherche sémantique, le regroupement de textes, la classification de texte, etc.
|
|
||||||
|
|
||||||
Le modèle `paraphrase-MiniLM-L6-v2` est une version spécifique de SentenceTransformer qui a été entraînée pour générer des embeddings de phrases de manière à ce que des phrases sémantiquement similaires aient des embeddings proches dans l'espace vectoriel. Voici quelques points clés concernant ce modèle :
|
|
||||||
|
|
||||||
1. **Objectif** : Il est principalement utilisé pour la détection de paraphrases, c'est-à-dire pour identifier si deux phrases ont le même sens.
|
|
||||||
|
|
||||||
2. **Architecture** : Il est basé sur l'architecture MiniLM, qui est une version plus légère et plus rapide de BERT, tout en conservant une bonne performance.
|
|
||||||
|
|
||||||
3. **Utilisation** : Vous pouvez l'utiliser pour calculer la similarité entre des phrases, regrouper des textes similaires, ou effectuer des recherches sémantiques dans une base de données de textes.
|
|
||||||
|
|
||||||
4. **Avantages** : Étant une version plus légère, il est plus rapide et nécessite moins de ressources pour l'inférence, ce qui le rend adapté pour des applications nécessitant une réponse rapide ou des ressources limitées.
|
|
||||||
|
|
||||||
Si vous souhaitez voir un exemple de code ou une démonstration de son utilisation, n'hésitez pas à me le faire savoir !
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
Pour utiliser le modèle `paraphrase-MiniLM-L6-v2` avec la bibliothèque `SentenceTransformer`, vous devez suivre les étapes suivantes :
|
|
||||||
|
|
||||||
1. **Installer les dépendances nécessaires** : Assurez-vous d'avoir installé la bibliothèque `sentence-transformers`. Vous pouvez l'installer via pip si ce n'est pas déjà fait :
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pip install sentence-transformers
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Charger le modèle** : Une fois la bibliothèque installée, vous pouvez charger le modèle `paraphrase-MiniLM-L6-v2` dans votre script Python. Voici un exemple de code pour le faire :
|
|
||||||
|
|
||||||
```python
|
|
||||||
from sentence_transformers import SentenceTransformer
|
|
||||||
|
|
||||||
# Charger le modèle
|
|
||||||
model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
|
|
||||||
|
|
||||||
# Exemple d'utilisation pour obtenir les embeddings de phrases
|
|
||||||
sentences = ["Ceci est une phrase.", "C'est une autre phrase."]
|
|
||||||
embeddings = model.encode(sentences)
|
|
||||||
|
|
||||||
# Afficher les embeddings
|
|
||||||
for sentence, embedding in zip(sentences, embeddings):
|
|
||||||
print(f"Phrase: {sentence}")
|
|
||||||
print(f"Embedding: {embedding}\n")
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Utiliser le modèle** : Une fois le modèle chargé, vous pouvez l'utiliser pour générer des embeddings de phrases, calculer des similarités, etc.
|
|
||||||
|
|
||||||
Si vous rencontrez des problèmes ou avez besoin d'aide supplémentaire, n'hésitez pas à demander !
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
ansible-playbook -i inventory.yml deploy.yml
|
||||||
@ -0,0 +1,107 @@
|
|||||||
|
---
|
||||||
|
- name: Configure Nginx with htpasswd authentication and HTTPS via Certbot
|
||||||
|
hosts: all
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Update package list
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Upgrade all packages
|
||||||
|
apt:
|
||||||
|
upgrade: dist
|
||||||
|
|
||||||
|
- name: Install Nginx
|
||||||
|
apt:
|
||||||
|
name: nginx
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Start and enable Nginx
|
||||||
|
service:
|
||||||
|
name: nginx
|
||||||
|
state: started
|
||||||
|
enabled: yes
|
||||||
|
|
||||||
|
- name: Create directory for website
|
||||||
|
file:
|
||||||
|
path: "/var/www/{{ domain_name }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "{{ ansible_user }}"
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
# - name: Create a simple homepage
|
||||||
|
# copy:
|
||||||
|
# content: |
|
||||||
|
# <html>
|
||||||
|
# <head><title>Welcome to {{ domain_name }}</title></head>
|
||||||
|
# <body><h1>Welcome to {{ domain_name }}</h1></body>
|
||||||
|
# </html>
|
||||||
|
# dest: "/var/www/{{ domain_name }}/index.html"
|
||||||
|
# owner: www-data
|
||||||
|
# group: www-data
|
||||||
|
# mode: '0644'
|
||||||
|
|
||||||
|
- name: Install apache2-utils package for htpasswd
|
||||||
|
apt:
|
||||||
|
name: apache2-utils
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Create htpasswd file with first user
|
||||||
|
command: >
|
||||||
|
htpasswd -bc {{ htpasswd_file }} {{ users[0].username }} {{ users[0].password }}
|
||||||
|
args:
|
||||||
|
creates: "{{ htpasswd_file }}" # Don't recreate file if it already exists
|
||||||
|
|
||||||
|
- name: Add subsequent users to htpasswd file
|
||||||
|
command: >
|
||||||
|
htpasswd -b {{ htpasswd_file }} {{ item.username }} {{ item.password }}
|
||||||
|
loop: "{{ users[1:] }}" # Skip first user already added
|
||||||
|
when: users | length > 1 # Execute only if there is more than one user
|
||||||
|
|
||||||
|
- name: Configure Nginx site with authentication (HTTP)
|
||||||
|
template:
|
||||||
|
src: nginx_site_http.conf.j2
|
||||||
|
dest: "/etc/nginx/sites-available/{{ domain_name }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
- name: Enable Nginx site
|
||||||
|
file:
|
||||||
|
src: "/etc/nginx/sites-available/{{ domain_name }}"
|
||||||
|
dest: "/etc/nginx/sites-enabled/{{ domain_name }}"
|
||||||
|
state: link
|
||||||
|
|
||||||
|
- name: Test Nginx configuration
|
||||||
|
command: nginx -t
|
||||||
|
register: nginx_test
|
||||||
|
changed_when: false
|
||||||
|
notify: Restart Nginx
|
||||||
|
|
||||||
|
- name: Restart Nginx to apply changes
|
||||||
|
service:
|
||||||
|
name: nginx
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
- name: Install Certbot and Nginx plugin
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- certbot
|
||||||
|
- python3-certbot-nginx
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Obtain SSL certificate with Certbot
|
||||||
|
command: >
|
||||||
|
certbot --nginx -d {{ domain_name }} --non-interactive --agree-tos --email {{ email }} --redirect
|
||||||
|
notify: Restart Nginx
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: Restart Nginx
|
||||||
|
service:
|
||||||
|
name: nginx
|
||||||
|
state: restarted
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
domain_name: "mistergwen.site"
|
||||||
|
htpasswd_file: "/etc/nginx/.htpasswd"
|
||||||
|
email: "gwenael.remond@free.fr"
|
||||||
|
users: # FIXME: we should use ansible vault here
|
||||||
|
- username: "student"
|
||||||
|
password: "HiB%lk34st"
|
||||||
|
- username: "admin"
|
||||||
|
password: "VrgS%Picmyz"
|
||||||
|
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
all:
|
||||||
|
hosts:
|
||||||
|
mistergwen.site:
|
||||||
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
vars:
|
||||||
|
ansible_user: root
|
||||||
|
ansible_ssh_private_key_file: ./keys/mistergwen.site.key
|
||||||
|
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name {{ domain_name }};
|
||||||
|
|
||||||
|
root /var/www/{{ domain_name }};
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
auth_basic "Restricted Access";
|
||||||
|
auth_basic_user_file {{ htpasswd_file }};
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
# Nginx Server installer
|
||||||
|
|
||||||
|
This is a complete Ansible playbook to configure Nginx with basic authentication using htpasswd.
|
||||||
|
This playbook installs Nginx, configures a static website, and secures access with basic authentication.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
- have a look at the hosts_vars:
|
||||||
|
|
||||||
|
cat host_vars/mistergwen.site.yml
|
||||||
|
domain_name: "mistergwen.site"
|
||||||
|
htpasswd_file: "/etc/nginx/.htpasswd"
|
||||||
|
...
|
||||||
|
|
||||||
|
- then launch the deployment script:
|
||||||
|
|
||||||
|
./deploy.sh
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
- Installation of Nginx: The playbook installs Nginx and ensures it is started and enabled.
|
||||||
|
- Creation of the website directory: A directory is created to host the website files.
|
||||||
|
- Creation of a simple homepage: A simple HTML page is created for the website.
|
||||||
|
- Installation of apache2-utils: This package is necessary to use the htpasswd command.
|
||||||
|
- Creation of the htpasswd file: A .htpasswd file is created with a username and password.
|
||||||
|
- Configuration of the Nginx site: The nginx_site.conf.j2 template is used to configure Nginx with basic authentication.
|
||||||
|
- Activation of the Nginx site: The site is enabled by creating a symbolic link in the sites-enabled directory.
|
||||||
|
- Testing the Nginx configuration: The Nginx configuration is tested before restarting the service.
|
||||||
|
- Restarting Nginx: Nginx is restarted to apply the changes.
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
|
||||||
|
- use ansible vault for the user's credentials
|
||||||
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
tasks:
|
|
||||||
hello:
|
|
||||||
cmds:
|
|
||||||
- echo "I am going to write a file named 'output.txt' now."
|
|
||||||
- echo "hello" > output.txt
|
|
||||||
generates:
|
|
||||||
- output.txt
|
|
||||||
|
|
||||||
@ -1 +0,0 @@
|
|||||||
hello
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
main-task:
|
|
||||||
cmds:
|
|
||||||
- task: task-to-be-called
|
|
||||||
- task: another-task
|
|
||||||
- echo "Both done"
|
|
||||||
|
|
||||||
task-to-be-called:
|
|
||||||
cmds:
|
|
||||||
- echo "Task to be called"
|
|
||||||
|
|
||||||
another-task:
|
|
||||||
cmds:
|
|
||||||
- echo "Another task"
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
build:
|
|
||||||
deps: [assets]
|
|
||||||
cmds:
|
|
||||||
- echo "hello" > test2.txt
|
|
||||||
|
|
||||||
assets:
|
|
||||||
cmds:
|
|
||||||
- echo "hello" > test1.txt
|
|
||||||
@ -1 +0,0 @@
|
|||||||
hello
|
|
||||||
@ -1 +0,0 @@
|
|||||||
hello
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
apt install taskfile
|
|
||||||
ou bien
|
|
||||||
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
|
|
||||||
pour l'installer "facilement"
|
|
||||||
|
|
||||||
- créer des task dépendantes les unes des autres
|
|
||||||
|
|
||||||
exemple :
|
|
||||||
|
|
||||||
la tâche "build" dépend de la tâche "assets"
|
|
||||||
|
|
||||||
|
|
||||||
(des tâches bidon)
|
|
||||||
echo "hello" > test1.txt
|
|
||||||
|
|
||||||
|
|
||||||
- autre demande
|
|
||||||
|
|
||||||
faire une taĉhe qui en appelle une autre
|
|
||||||
une tâche qui dépend d'une autre tâche (c'est-à-dire que si on lance cette tâche, le builder va lancer la tâche dépendante avant)
|
|
||||||
|
|
||||||
une tâche qui appelle une autre tâche (c'est-à-dire que la tâche lance une autre tâche après)
|
|
||||||