Compare commits

..

No commits in common. "6d75bc433e35a1803ccf03fcd924ca0befc8cd36" and "c1b7fca8d5db15f734a183e0d671100def243b55" have entirely different histories.

392 changed files with 12208 additions and 11037 deletions

4
.gitignore vendored
View File

@ -106,7 +106,6 @@ celerybeat.pid
.venv .venv
env/ env/
venv/ venv/
venv_*/
ENV/ ENV/
env.bak/ env.bak/
venv.bak/ venv.bak/
@ -135,6 +134,3 @@ dmypy.json
# IDE # IDE
.idea/ .idea/
PythonImportHelper-v2-Completion.json PythonImportHelper-v2-Completion.json
# cpl unittest stuff
unittests/test_*_playground

View File

@ -1,4 +1,4 @@
MIT License Copyright (c) 2020 - 2022 sh-edraft.de MIT License Copyright (c) 2020 - 2021 sh-edraft.de
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -13,7 +13,6 @@
## Table of Contents ## Table of Contents
<!-- TABLE OF CONTENTS --> <!-- TABLE OF CONTENTS -->
<ol> <ol>
<li><a href="#Features">Features</a></li>
<li> <li>
<a href="#getting-started">Getting Started</a> <a href="#getting-started">Getting Started</a>
<ul> <ul>
@ -27,52 +26,6 @@
<li><a href="#contact">Contact</a></li> <li><a href="#contact">Contact</a></li>
</ol> </ol>
## Features
<!-- FEATURE OVERVIEW -->
- Expandle
- Application base
- Standardized application classes
- Application object builder
- Application extension classes
- Startup classes
- Startup extension classes
- Configuration
- Configure via object mapped JSON
- Console argument handling
- Console class for in and output
- Banner
- Spinner
- Options (menu)
- Table
- Write
- Write_at
- Write_line
- Write_line_at
- Dependency injection
- Service lifetimes: singleton, scoped and transient
- Providing of application environment
- Environment (development, staging, testing, production)
- Appname
- Customer
- Hostname
- Runtime directory
- Working directory
- Logging
- Standardized logger
- Log-level (FATAL, ERROR, WARN, INFO, DEBUG & TRACE)
- Mail handling
- Send mails
- Pipe classes
- Convert input
- Utils
- Credential manager
- Encryption via BASE64
- PIP wrapper class based on subprocess
- Run pip commands
- String converter to different variants
- to_lower_case
- to_camel_case
- ...
<!-- GETTING STARTED --> <!-- GETTING STARTED -->
## Getting Started ## Getting Started

View File

@ -1,95 +1,13 @@
{ {
"WorkspaceSettings": { "WorkspaceSettings": {
"DefaultProject": "cpl-cli", "DefaultProject": "cpl_cli",
"Projects": { "Projects": {
"cpl-core": "src/cpl_core/cpl-core.json", "cpl_core": "src/cpl_core/cpl_core.json",
"cpl-cli": "src/cpl_cli/cpl-cli.json", "cpl_cli": "src/cpl_cli/cpl_cli.json",
"cpl-query": "src/cpl_query/cpl-query.json", "cpl_query": "src/cpl_query/cpl_query.json"
"set-version": "tools/set_version/set-version.json",
"set-pip-urls": "tools/set_pip_urls/set-pip-urls.json",
"unittests": "unittests/unittests/unittests.json",
"unittests_cli": "unittests/unittests_cli/unittests_cli.json",
"unittests_core": "unittests/unittests_core/unittests_core.json",
"unittests_query": "unittests/unittests_query/unittests_query.json",
"unittests_shared": "unittests/unittests_shared/unittests_shared.json"
}, },
"Scripts": { "Scripts": {
"hello-world": "echo 'Hello World'", "hello-world": "echo 'Hello World'"
"sv": "cpl set-version",
"set-version": "cpl run set-version $ARGS; echo '';",
"spu": "cpl set-pip-urls",
"set-pip-urls": "cpl run set-pip-urls $ARGS; echo '';",
"docs-build": "echo 'Build Documentation'; cd docs/; sphinx-apidoc -o source/ ../src/cpl_core; sphinx-apidoc -o source/ ../src/cpl_query; make clean; make html; rm source/cpl_query.tests.rst;",
"db": "cpl docs-build",
"docs-open": "xdg-open $PWD/docs/build/html/index.html &",
"do": "cpl docs-open",
"test": "cpl run unittests",
"pre-build-all": "cpl sv $ARGS; cpl spu $ARGS;",
"build-all": "cpl build-cli; cpl build-core; cpl build-query; cpl build-set-pip-urls; cpl build-set-version",
"ba": "cpl build-all $ARGS",
"build-cli": "echo 'Build cpl-cli'; cd ./src/cpl_cli; cpl build; cd ../../;",
"build-core": "echo 'Build cpl-core'; cd ./src/cpl_core; cpl build; cd ../../;",
"build-query": "echo 'Build cpl-query'; cd ./src/cpl_query; cpl build; cd ../../;",
"build-set-pip-urls": "echo 'Build set-pip-urls'; cd ./tools/set_pip_urls; cpl build; cd ../../;",
"build-set-version": "echo 'Build set-version'; cd ./tools/set_version; cpl build; cd ../../;",
"pre-publish-all": "cpl sv $ARGS; cpl spu $ARGS;",
"publish-all": "cpl publish-cli; cpl publish-core; cpl publish-query;",
"pa": "cpl build-all $ARGS",
"publish-cli": "echo 'Publish cpl-cli'; cd ./src/cpl_cli; cpl publish; cd ../../;",
"publish-core": "echo 'Publish cpl-core'; cd ./src/cpl_core; cpl publish; cd ../../;",
"publish-query": "echo 'Publish cpl_query'; cd ./src/cpl_query; cpl publish; cd ../../;",
"upload-prod-cli": "echo 'PROD Upload cpl-cli'; cpl upl-prod-cli;",
"upl-prod-cli": "twine upload -r pip.sh-edraft.de dist/cpl-cli/publish/setup/*",
"upload-prod-core": "echo 'PROD Upload cpl-core'; cpl upl-prod-core;",
"upl-prod-core": "twine upload -r pip.sh-edraft.de dist/cpl-core/publish/setup/*",
"upload-prod-query": "echo 'PROD Upload cpl_query'; cpl upl-prod-query;",
"upl-prod-query": "twine upload -r pip.sh-edraft.de dist/cpl-query/publish/setup/*",
"upload-exp-cli": "echo 'EXP Upload cpl-cli'; cpl upl-exp-cli;",
"upl-exp-cli": "twine upload -r pip-exp.sh-edraft.de dist/cpl-cli/publish/setup/*",
"upload-exp-core": "echo 'EXP Upload cpl-core'; cpl upl-exp-core;",
"upl-exp-core": "twine upload -r pip-exp.sh-edraft.de dist/cpl-core/publish/setup/*",
"upload-exp-query": "echo 'EXP Upload cpl_query'; cpl upl-exp-query;",
"upl-exp-query": "twine upload -r pip-exp.sh-edraft.de dist/cpl-query/publish/setup/*",
"upload-dev-cli": "echo 'DEV Upload cpl-cli'; cpl upl-dev-cli;",
"upl-dev-cli": "twine upload -r pip-dev.sh-edraft.de dist/cpl-cli/publish/setup/*",
"upload-dev-core": "echo 'DEV Upload cpl-core'; cpl upl-dev-core;",
"upl-dev-core": "twine upload -r pip-dev.sh-edraft.de dist/cpl-core/publish/setup/*",
"upload-dev-query": "echo 'DEV Upload cpl_query'; cpl upl-dev-query;",
"upl-dev-query": "twine upload -r pip-dev.sh-edraft.de dist/cpl-query/publish/setup/*",
"pre-deploy-prod": "cpl sv $ARGS; cpl spu --environment=production;",
"deploy-prod": "cpl deploy-prod-cli; cpl deploy-prod-core; cpl deploy-prod-query;",
"dp": "cpl deploy-prod $ARGS",
"deploy-prod-cli": "cpl publish-cli; cpl upload-prod-cli",
"deploy-prod-core": "cpl publish-core; cpl upload-prod-core",
"deploy-prod-query": "cpl publish-query; cpl upload-prod-query",
"pre-deploy-exp": "cpl sv $ARGS; cpl spu --environment=staging;",
"deploy-exp": "cpl deploy-exp-cli; cpl deploy-exp-core; cpl deploy-exp-query;",
"de": "cpl deploy-exp $ARGS",
"deploy-exp-cli": "cpl publish-cli; cpl upload-exp-cli",
"deploy-exp-core": "cpl publish-core; cpl upload-exp-core",
"deploy-exp-query": "cpl publish-query; cpl upload-exp-query",
"pre-deploy-dev": "cpl sv $ARGS; cpl spu --environment=development;",
"deploy-dev": "cpl deploy-dev-cli; cpl deploy-dev-core; cpl deploy-dev-query;",
"dd": "cpl deploy-dev $ARGS",
"deploy-dev-cli": "cpl publish-cli; cpl upload-dev-cli",
"deploy-dev-core": "cpl publish-core; cpl upload-dev-core",
"deploy-dev-query": "cpl publish-query; cpl upload-dev-query",
"dev-install": "cpl di-core; cpl di-cli; cpl di-query;",
"di": "cpl dev-install",
"di-core": "pip install cpl-core --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
"di-cli": "pip install cpl-cli --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de",
"di-query": "pip install cpl-query --pre --upgrade --extra-index-url https://pip-dev.sh-edraft.de"
} }
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
# Sphinx build info version 1 # Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 9ea51a00cf3559575c97b7efd7a002e5 config: 8170277cf12e5442e6180427108a8adf
tags: 645f666f9bcd5a90fca523b33c5a78b7 tags: 645f666f9bcd5a90fca523b33c5a78b7

View File

@ -20,12 +20,6 @@ If you call the command in a CPL workspace, you can use the project names. Other
## Arguments ## Arguments
| Argument | Description | Value type | | Argument | Description | Value type |
|------------------------|:----------------------------------------------------------:|:----------:| | ------------------------- |:---------------------------------------------------------------:|:----------------:|
| ```<source-project>``` | Name of the project to which the reference has to be added | ```str``` | | ```<source-project>``` | Name of the project to which the reference has to be added | ```str```
| ```<target-project>``` | Name of the project to be referenced | ```str``` | | ```<target-project>``` | Name of the project to be referenced | ```str```
## Flags
| Argument | Description |
|------------------|:------------------------------------------:|
| ```--simulate``` | Specifies whether the command is simulated |

View File

@ -26,13 +26,10 @@ Generates files based on a schematic.
## Schematics ## Schematics
| Schematic | Description | Arguments | | Schematic | Description | Arguments |
|-----------------|:-------------------------------------:|:------------:| | ----------------- |:-------------------:|:----------------:|
| ```abc``` | Abstract base class | ```<name>``` | | ```abc``` | Abstract base class | ```<name>```
| ```class``` | Class | ```<name>``` | | ```class``` | Class | ```<name>```
| ```enum``` | Enum class | ```<name>``` | | ```enum``` | Enum class | ```<name>```
| ```pipe``` | Pipe class | ```<name>``` | | ```service``` | Service class | ```<name>```
| ```service``` | Service class | ```<name>``` | | ```settings``` | [Configmodel](cpl_core.configuration) | ```<name>```
| ```settings``` | [Configmodel](cpl_core.configuration) | ```<name>``` | | ```thread``` | Thread class | ```<name>```
| ```test``` | Test class | ```<name>``` |
| ```thread``` | Thread class | ```<name>``` |
| ```validator``` | Validator class | ```<name>``` |

View File

@ -19,13 +19,5 @@ Without given package it will install the depedencies of the CPL project your in
## Arguments ## Arguments
| Argument | Description | Value type | | Argument | Description | Value type |
|-----------------|:----------------------:|:----------:| | ----------------- |:-----------------------------:|:-------------:|
| ```<package>``` | The package to install | ```str``` | | ```<package>``` | The package to install | ```str``` |
## Flags
| Argument | Description |
|------------------|:----------------------------------------------------:|
| ```--dev``` | Specifies whether the command is in development mode |
| ```--virtual``` | Specifies whether the command is virtual mode |
| ```--simulate``` | Specifies whether the command is simulated |

View File

@ -19,24 +19,13 @@ Generates a workspace and initial project or add a project to workspace.
If the command is running in a CPL workspace, it will add the new project to the workspace. If the command is running in a CPL workspace, it will add the new project to the workspace.
| Argument | Description | Value type | | Argument | Description | Value type |
|--------------|:----------------------------------------------------:|:----------:| | ----------------- |:-----------------------------------------------------:|:-------------:|
| ```<type>``` | The type of the project, see [types](#project-types) | ```str``` | | ```<type>``` | The type of the project, see [types](#project-types) | ```str``` |
| ```<name>``` | The name of the project | ```str``` | | ```<name>``` | The name of the project | ```str``` |
## Project types ## Project types
| Project type | Description | | Project type | Description |
|---------------|:----------------------------:| | ----------------- |:-----------------------------:|
| ```console``` | A simple console application | | ```console``` | A simple console application |
| ```library``` | A package | | ```library``` | A package |
## Flags
| Argument | Description |
|---------------------------|:-------------------------------------------:|
| ```--async``` | Specifies whether async is used |
| ```--application-base``` | Specifies whether application base is used |
| ```--startup``` | Specifies whether startup is used |
| ```--service-providing``` | Specifies whether service-providing is used |
| ```--nothing``` | Specifies whether nothing is used |
| ```--venv``` | Specifies whether venv is used |

View File

@ -20,11 +20,5 @@ If you call the command in a CPL workspace, you can use the project names. Other
## Arguments ## Arguments
| Argument | Description | Value type | | Argument | Description | Value type |
|-----------------|:---------------------------------:|:----------:| | ------------------------- |:-------------------------------------:|:----------------:|
| ```<project>``` | The name of the project to delete | ```str``` | | ```<project>``` | The name of the project to delete | ```str```
## Flags
| Argument | Description |
|------------------|:----------------------------------------------------:|
| ```--simulate``` | Specifies whether the command is simulated |

View File

@ -18,13 +18,5 @@ Uninstall given package from project via pip.
## Arguments ## Arguments
| Argument | Description | Value type | | Argument | Description | Value type |
|-----------------|:------------------------:|:----------:| | ----------------- |:-----------------------------:|:-------------:|
| ```<package>``` | The package to uninstall | ```str``` | | ```<package>``` | The package to uninstall | ```str``` |
## Flags
| Argument | Description |
|------------------|:----------------------------------------------------:|
| ```--dev``` | Specifies whether the command is in development mode |
| ```--virtual``` | Specifies whether the command is virtual mode |
| ```--simulate``` | Specifies whether the command is simulated |

View File

@ -5,9 +5,3 @@ Updates the CPL and project dependencies.
cpl **update** <br> cpl **update** <br>
cpl **u** <br> cpl **u** <br>
cpl **U** cpl **U**
## Flags
| Argument | Description |
|------------------|:----------------------------------------------------:|
| ```--simulate``` | Specifies whether the command is simulated |

View File

@ -1,77 +0,0 @@
cpl\_core.pipes
=======================
Submodules
----------
cpl\_core.pipes.bool\_pipe module
---------------------------------
.. automodule:: cpl_core.pipes.bool_pipe
:members:
:undoc-members:
:show-inheritance:
cpl\_core.pipes.first\_char\_to\_lower\_pipe module
---------------------------------------------------
.. automodule:: cpl_core.pipes.first_char_to_lower_pipe
:members:
:undoc-members:
:show-inheritance:
cpl\_core.pipes.first\_to\_upper\_pipe module
---------------------------------------------
.. automodule:: cpl_core.pipes.first_to_upper_pipe
:members:
:undoc-members:
:show-inheritance:
cpl\_core.pipes.ip\_address\_pipe module
----------------------------------------
.. automodule:: cpl_core.pipes.ip_address_pipe
:members:
:undoc-members:
:show-inheritance:
cpl\_core.pipes.pipe\_abc module
--------------------------------
.. automodule:: cpl_core.pipes.pipe_abc
:members:
:undoc-members:
:show-inheritance:
cpl\_core.pipes.to\_camel\_case\_pipe module
--------------------------------------------
.. automodule:: cpl_core.pipes.to_camel_case_pipe
:members:
:undoc-members:
:show-inheritance:
cpl\_core.pipes.to\_snake\_case\_pipe module
--------------------------------------------
.. automodule:: cpl_core.pipes.to_snake_case_pipe
:members:
:undoc-members:
:show-inheritance:
cpl\_core.pipes.version\_pipe module
------------------------------------
.. automodule:: cpl_core.pipes.version_pipe
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: cpl_core.pipes
:members:
:undoc-members:
:show-inheritance:

View File

@ -12,6 +12,5 @@ API Reference
cpl_core.environment cpl_core.environment
cpl_core.logging cpl_core.logging
cpl_core.mailing cpl_core.mailing
cpl_core.pipes
cpl_core.time cpl_core.time
cpl_core.utils cpl_core.utils

View File

@ -0,0 +1,45 @@
cpl\_query.tests package
========================
Submodules
----------
cpl\_query.tests.iterable\_test module
--------------------------------------
.. automodule:: cpl_query.tests.iterable_test
:members:
:undoc-members:
:show-inheritance:
cpl\_query.tests.models module
------------------------------
.. automodule:: cpl_query.tests.models
:members:
:undoc-members:
:show-inheritance:
cpl\_query.tests.query\_test module
-----------------------------------
.. automodule:: cpl_query.tests.query_test
:members:
:undoc-members:
:show-inheritance:
cpl\_query.tests.tester module
------------------------------
.. automodule:: cpl_query.tests.tester
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: cpl_query.tests
:members:
:undoc-members:
:show-inheritance:

View File

@ -6,5 +6,4 @@ Getting started
quickstart quickstart
setup setup
tutorials

View File

@ -4,53 +4,6 @@ The Common Python Library (CPL) is a package for python and a development platfo
This CPL docs help you learn, understand and use the package. From your first application to complex apps for enterprises. This CPL docs help you learn, understand and use the package. From your first application to complex apps for enterprises.
## Feature overview
- Expandle
- Application base
- Standardized application classes
- Application object builder
- Application extension classes
- Startup classes
- Startup extension classes
- Configuration
- Configure via object mapped JSON
- Console argument handling
- Console class for in and output
- Banner
- Spinner
- Options (menu)
- Table
- Write
- Write_at
- Write_line
- Write_line_at
- Dependency injection
- Service lifetimes: singleton, scoped and transient
- Providing of application environment
- Environment (development, staging, testing, production)
- Appname
- Customer
- Hostname
- Runtime directory
- Working directory
- Logging
- Standardized logger
- Log-level (FATAL, ERROR, WARN, INFO, DEBUG & TRACE)
- Mail handling
- Send mails
- Pipe classes
- Convert input
- Utils
- Credential manager
- Encryption via BASE64
- PIP wrapper class based on subprocess
- Run pip commands
- String converter to different variants
- to_lower_case
- to_camel_case
- ...
## Explore ## Explore
- [Getting started](quickstart) - [Getting started](quickstart)

View File

@ -1,3 +0,0 @@
# Using appsettings.json
## Comming soon

View File

@ -1,3 +0,0 @@
# Handle console arguments
## Comming soon

View File

@ -1,3 +0,0 @@
# Use cpl_core.console.Console
## Comming soon

View File

@ -1,3 +0,0 @@
# Create startup class
## Comming soon

View File

@ -1,3 +0,0 @@
# Extend application
## Comming soon

View File

@ -1,3 +0,0 @@
# Extend startup
## Comming soon

View File

@ -1,3 +0,0 @@
# Use builtin logger
## Comming soon

View File

@ -1,3 +0,0 @@
# Send mails
## Comming soon

View File

@ -1,14 +0,0 @@
Tutorials
=============
.. toctree::
:maxdepth: 4
tutorials.extend-application
tutorials.create-startup
tutorials.extend-startup
tutorials.appsettings
tutorials.console-arguments
tutorials.console
tutorials.logging
tutorials.mail

View File

@ -1,134 +0,0 @@
/*
* _sphinx_javascript_frameworks_compat.js
* ~~~~~~~~~~
*
* Compatability shim for jQuery and underscores.js.
*
* WILL BE REMOVED IN Sphinx 6.0
* xref RemovedInSphinx60Warning
*
*/
/**
* select a different prefix for underscore
*/
$u = _.noConflict();
/**
* small helper function to urldecode strings
*
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
*/
jQuery.urldecode = function(x) {
if (!x) {
return x
}
return decodeURIComponent(x.replace(/\+/g, ' '));
};
/**
* small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;
/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s === 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
*/
jQuery.fn.highlightText = function(text, className) {
function highlight(node, addItems) {
if (node.nodeType === 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 &&
!jQuery(node.parentNode).hasClass(className) &&
!jQuery(node.parentNode).hasClass("nohighlight")) {
var span;
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
if (isInSVG) {
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
} else {
span = document.createElement("span");
span.className = className;
}
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling));
node.nodeValue = val.substr(0, pos);
if (isInSVG) {
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
var bbox = node.parentElement.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": node.parentNode,
"target": rect});
}
}
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this, addItems);
});
}
}
var addItems = [];
var result = this.each(function() {
highlight(this, addItems);
});
for (var i = 0; i < addItems.length; ++i) {
jQuery(addItems[i].parent).before(addItems[i].target);
}
return result;
};
/*
* backward compatibility for jQuery.browser
* This will be supported until firefox bug is fixed.
*/
if (!jQuery.browser) {
jQuery.uaMatch = function(ua) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
jQuery.browser = {};
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
}

View File

@ -4,7 +4,7 @@
* *
* Sphinx stylesheet -- basic theme. * Sphinx stylesheet -- basic theme.
* *
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details. * :license: BSD, see LICENSE for details.
* *
*/ */
@ -130,7 +130,7 @@ ul.search li a {
font-weight: bold; font-weight: bold;
} }
ul.search li p.context { ul.search li div.context {
color: #888; color: #888;
margin: 2px 0 0 30px; margin: 2px 0 0 30px;
text-align: left; text-align: left;
@ -222,7 +222,7 @@ table.modindextable td {
/* -- general body styles --------------------------------------------------- */ /* -- general body styles --------------------------------------------------- */
div.body { div.body {
min-width: 360px; min-width: 450px;
max-width: 800px; max-width: 800px;
} }
@ -236,6 +236,7 @@ div.body p, div.body dd, div.body li, div.body blockquote {
a.headerlink { a.headerlink {
visibility: hidden; visibility: hidden;
} }
a.brackets:before, a.brackets:before,
span.brackets > a:before{ span.brackets > a:before{
content: "["; content: "[";
@ -246,7 +247,6 @@ span.brackets > a:after {
content: "]"; content: "]";
} }
h1:hover > a.headerlink, h1:hover > a.headerlink,
h2:hover > a.headerlink, h2:hover > a.headerlink,
h3:hover > a.headerlink, h3:hover > a.headerlink,
@ -277,25 +277,25 @@ p.rubric {
font-weight: bold; font-weight: bold;
} }
img.align-left, figure.align-left, .figure.align-left, object.align-left { img.align-left, .figure.align-left, object.align-left {
clear: left; clear: left;
float: left; float: left;
margin-right: 1em; margin-right: 1em;
} }
img.align-right, figure.align-right, .figure.align-right, object.align-right { img.align-right, .figure.align-right, object.align-right {
clear: right; clear: right;
float: right; float: right;
margin-left: 1em; margin-left: 1em;
} }
img.align-center, figure.align-center, .figure.align-center, object.align-center { img.align-center, .figure.align-center, object.align-center {
display: block; display: block;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
img.align-default, figure.align-default, .figure.align-default { img.align-default, .figure.align-default {
display: block; display: block;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
@ -319,8 +319,7 @@ img.align-default, figure.align-default, .figure.align-default {
/* -- sidebars -------------------------------------------------------------- */ /* -- sidebars -------------------------------------------------------------- */
div.sidebar, div.sidebar {
aside.sidebar {
margin: 0 0 0.5em 1em; margin: 0 0 0.5em 1em;
border: 1px solid #ddb; border: 1px solid #ddb;
padding: 7px; padding: 7px;
@ -334,11 +333,13 @@ aside.sidebar {
p.sidebar-title { p.sidebar-title {
font-weight: bold; font-weight: bold;
} }
div.admonition, div.topic, blockquote { div.admonition, div.topic, blockquote {
clear: left; clear: left;
} }
/* -- topics ---------------------------------------------------------------- */ /* -- topics ---------------------------------------------------------------- */
div.topic { div.topic {
border: 1px solid #ccc; border: 1px solid #ccc;
padding: 7px; padding: 7px;
@ -376,14 +377,12 @@ div.body p.centered {
/* -- content of sidebars/topics/admonitions -------------------------------- */ /* -- content of sidebars/topics/admonitions -------------------------------- */
div.sidebar > :last-child, div.sidebar > :last-child,
aside.sidebar > :last-child,
div.topic > :last-child, div.topic > :last-child,
div.admonition > :last-child { div.admonition > :last-child {
margin-bottom: 0; margin-bottom: 0;
} }
div.sidebar::after, div.sidebar::after,
aside.sidebar::after,
div.topic::after, div.topic::after,
div.admonition::after, div.admonition::after,
blockquote::after { blockquote::after {
@ -426,6 +425,10 @@ table.docutils td, table.docutils th {
border-bottom: 1px solid #aaa; border-bottom: 1px solid #aaa;
} }
table.footnote td, table.footnote th {
border: 0 !important;
}
th { th {
text-align: left; text-align: left;
padding-right: 5px; padding-right: 5px;
@ -452,22 +455,20 @@ td > :last-child {
/* -- figures --------------------------------------------------------------- */ /* -- figures --------------------------------------------------------------- */
div.figure, figure { div.figure {
margin: 0.5em; margin: 0.5em;
padding: 0.5em; padding: 0.5em;
} }
div.figure p.caption, figcaption { div.figure p.caption {
padding: 0.3em; padding: 0.3em;
} }
div.figure p.caption span.caption-number, div.figure p.caption span.caption-number {
figcaption span.caption-number {
font-style: italic; font-style: italic;
} }
div.figure p.caption span.caption-text, div.figure p.caption span.caption-text {
figcaption span.caption-text {
} }
/* -- field list styles ----------------------------------------------------- */ /* -- field list styles ----------------------------------------------------- */
@ -502,63 +503,6 @@ table.hlist td {
vertical-align: top; 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 ----------------------------------------------------- */ /* -- other body styles ----------------------------------------------------- */
@ -609,7 +553,6 @@ ul.simple p {
margin-bottom: 0; margin-bottom: 0;
} }
/* Docutils 0.17 and older (footnotes & citations) */
dl.footnote > dt, dl.footnote > dt,
dl.citation > dt { dl.citation > dt {
float: left; float: left;
@ -627,33 +570,6 @@ dl.citation > dd:after {
clear: both; clear: both;
} }
/* Docutils 0.18+ (footnotes & citations) */
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;
}
/* Footnotes & citations ends */
dl.field-list { dl.field-list {
display: grid; display: grid;
grid-template-columns: fit-content(30%) auto; grid-template-columns: fit-content(30%) auto;
@ -713,6 +629,14 @@ dl.glossary dt {
font-size: 1.1em; font-size: 1.1em;
} }
.optional {
font-size: 1.3em;
}
.sig-paren {
font-size: larger;
}
.versionmodified { .versionmodified {
font-style: italic; font-style: italic;
} }
@ -753,9 +677,8 @@ dl.glossary dt {
.classifier:before { .classifier:before {
font-style: normal; font-style: normal;
margin: 0 0.5em; margin: 0.5em;
content: ":"; content: ":";
display: inline-block;
} }
abbr, acronym { abbr, acronym {
@ -779,7 +702,6 @@ span.pre {
-ms-hyphens: none; -ms-hyphens: none;
-webkit-hyphens: none; -webkit-hyphens: none;
hyphens: none; hyphens: none;
white-space: nowrap;
} }
div[class*="highlight-"] { div[class*="highlight-"] {
@ -843,12 +765,8 @@ div.code-block-caption code {
table.highlighttable td.linenos, table.highlighttable td.linenos,
span.linenos, span.linenos,
div.highlight span.gp { /* gp: Generic.Prompt */ div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
user-select: none; 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 { div.code-block-caption span.caption-number {
@ -863,6 +781,16 @@ div.literal-block-wrapper {
margin: 1em 0; margin: 1em 0;
} }
code.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
code.descclassname {
background-color: transparent;
}
code.xref, a code { code.xref, a code {
background-color: transparent; background-color: transparent;
font-weight: bold; font-weight: bold;

File diff suppressed because one or more lines are too long

View File

@ -2,263 +2,320 @@
* doctools.js * doctools.js
* ~~~~~~~~~~~ * ~~~~~~~~~~~
* *
* Base JavaScript utilities for all Sphinx HTML documentation. * Sphinx JavaScript utilities for all documentation.
* *
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details. * :license: BSD, see LICENSE for details.
* *
*/ */
"use strict";
const _ready = (callback) => { /**
if (document.readyState !== "loading") { * select a different prefix for underscore
callback(); */
} else { $u = _.noConflict();
document.addEventListener("DOMContentLoaded", callback);
/**
* make the code below compatible with browsers without
* an installed firebug like debugger
if (!window.console || !console.firebug) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
"dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
"profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {};
} }
*/
/**
* small helper function to urldecode strings
*
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
*/
jQuery.urldecode = function(x) {
if (!x) {
return x
}
return decodeURIComponent(x.replace(/\+/g, ' '));
}; };
/** /**
* highlight a given string on a node by wrapping it in * small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;
/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s === 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name. * span elements with the given class name.
*/ */
const _highlight = (node, addItems, text, className) => { jQuery.fn.highlightText = function(text, className) {
if (node.nodeType === Node.TEXT_NODE) { function highlight(node, addItems) {
const val = node.nodeValue; if (node.nodeType === 3) {
const parent = node.parentNode; var val = node.nodeValue;
const pos = val.toLowerCase().indexOf(text); var pos = val.toLowerCase().indexOf(text);
if ( if (pos >= 0 &&
pos >= 0 && !jQuery(node.parentNode).hasClass(className) &&
!parent.classList.contains(className) && !jQuery(node.parentNode).hasClass("nohighlight")) {
!parent.classList.contains("nohighlight") var span;
) { var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
let span;
const closestNode = parent.closest("body, svg, foreignObject");
const isInSVG = closestNode && closestNode.matches("svg");
if (isInSVG) { if (isInSVG) {
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
} else { } else {
span = document.createElement("span"); span = document.createElement("span");
span.classList.add(className); span.className = className;
} }
span.appendChild(document.createTextNode(val.substr(pos, text.length))); span.appendChild(document.createTextNode(val.substr(pos, text.length)));
parent.insertBefore( node.parentNode.insertBefore(span, node.parentNode.insertBefore(
span,
parent.insertBefore(
document.createTextNode(val.substr(pos + text.length)), document.createTextNode(val.substr(pos + text.length)),
node.nextSibling node.nextSibling));
)
);
node.nodeValue = val.substr(0, pos); node.nodeValue = val.substr(0, pos);
if (isInSVG) { if (isInSVG) {
const rect = document.createElementNS( var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
"http://www.w3.org/2000/svg", var bbox = node.parentElement.getBBox();
"rect"
);
const bbox = parent.getBBox();
rect.x.baseVal.value = bbox.x; rect.x.baseVal.value = bbox.x;
rect.y.baseVal.value = bbox.y; rect.y.baseVal.value = bbox.y;
rect.width.baseVal.value = bbox.width; rect.width.baseVal.value = bbox.width;
rect.height.baseVal.value = bbox.height; rect.height.baseVal.value = bbox.height;
rect.setAttribute("class", className); rect.setAttribute('class', className);
addItems.push({ parent: parent, target: rect }); addItems.push({
"parent": node.parentNode,
"target": rect});
} }
} }
} else if (node.matches && !node.matches("button, select, textarea")) {
node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
} }
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this, addItems);
});
}
}
var addItems = [];
var result = this.each(function() {
highlight(this, addItems);
});
for (var i = 0; i < addItems.length; ++i) {
jQuery(addItems[i].parent).before(addItems[i].target);
}
return result;
}; };
const _highlightText = (thisNode, text, className) => {
let addItems = []; /*
_highlight(thisNode, addItems, text, className); * backward compatibility for jQuery.browser
addItems.forEach((obj) => * This will be supported until firefox bug is fixed.
obj.parent.insertAdjacentElement("beforebegin", obj.target) */
); if (!jQuery.browser) {
jQuery.uaMatch = function(ua) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
}; };
};
jQuery.browser = {};
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
}
/** /**
* Small JavaScript module for the documentation. * Small JavaScript module for the documentation.
*/ */
const Documentation = { var Documentation = {
init: () => {
Documentation.highlightSearchWords(); init : function() {
Documentation.initDomainIndexTable(); this.fixFirefoxAnchorBug();
Documentation.initOnKeyListeners(); this.highlightSearchWords();
this.initIndexTable();
if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) {
this.initOnKeyListeners();
}
}, },
/** /**
* i18n support * i18n support
*/ */
TRANSLATIONS : {}, TRANSLATIONS : {},
PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; },
LOCALE: "unknown", LOCALE : 'unknown',
// gettext and ngettext don't access this so that the functions // gettext and ngettext don't access this so that the functions
// can safely bound to a different name (_ = Documentation.gettext) // can safely bound to a different name (_ = Documentation.gettext)
gettext: (string) => { gettext : function(string) {
const translated = Documentation.TRANSLATIONS[string]; var translated = Documentation.TRANSLATIONS[string];
switch (typeof translated) { if (typeof translated === 'undefined')
case "undefined": return string;
return string; // no translation return (typeof translated === 'string') ? translated : translated[0];
case "string":
return translated; // translation exists
default:
return translated[0]; // (singular, plural) translation tuple exists
}
}, },
ngettext: (singular, plural, n) => { ngettext : function(singular, plural, n) {
const translated = Documentation.TRANSLATIONS[singular]; var translated = Documentation.TRANSLATIONS[singular];
if (typeof translated !== "undefined") if (typeof translated === 'undefined')
return translated[Documentation.PLURAL_EXPR(n)]; return (n == 1) ? singular : plural;
return n === 1 ? singular : plural; return translated[Documentation.PLURALEXPR(n)];
}, },
addTranslations: (catalog) => { addTranslations : function(catalog) {
Object.assign(Documentation.TRANSLATIONS, catalog.messages); for (var key in catalog.messages)
Documentation.PLURAL_EXPR = new Function( this.TRANSLATIONS[key] = catalog.messages[key];
"n", this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
`return (${catalog.plural_expr})` this.LOCALE = catalog.locale;
); },
Documentation.LOCALE = catalog.locale;
/**
* add context elements like header anchor links
*/
addContextElements : function() {
$('div[id] > :header:first').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this headline')).
appendTo(this);
});
$('dt[id]').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this definition')).
appendTo(this);
});
},
/**
* workaround a firefox stupidity
* see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
*/
fixFirefoxAnchorBug : function() {
if (document.location.hash && $.browser.mozilla)
window.setTimeout(function() {
document.location.href += '';
}, 10);
}, },
/** /**
* highlight the search words provided in the url in the text * highlight the search words provided in the url in the text
*/ */
highlightSearchWords: () => { highlightSearchWords : function() {
const highlight = var params = $.getQueryParameters();
new URLSearchParams(window.location.search).get("highlight") || ""; var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); if (terms.length) {
if (terms.length === 0) return; // nothing to do var body = $('div.body');
if (!body.length) {
// There should never be more than one element matching "div.body" body = $('body');
const divBody = document.querySelectorAll("div.body"); }
const body = divBody.length ? divBody[0] : document.querySelector("body"); window.setTimeout(function() {
window.setTimeout(() => { $.each(terms, function() {
terms.forEach((term) => _highlightText(body, term, "highlighted")); body.highlightText(this.toLowerCase(), 'highlighted');
});
}, 10); }, 10);
$('<p class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
.appendTo($('#searchbox'));
}
},
const searchBox = document.getElementById("searchbox"); /**
if (searchBox === null) return; * init the domain index toggle buttons
searchBox.appendChild( */
document initIndexTable : function() {
.createRange() var togglers = $('img.toggler').click(function() {
.createContextualFragment( var src = $(this).attr('src');
'<p class="highlight-link">' + var idnum = $(this).attr('id').substr(7);
'<a href="javascript:Documentation.hideSearchWords()">' + $('tr.cg-' + idnum).toggle();
Documentation.gettext("Hide Search Matches") + if (src.substr(-9) === 'minus.png')
"</a></p>" $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
) else
); $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
}).css('display', '');
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
togglers.click();
}
}, },
/** /**
* helper function to hide the search marks again * helper function to hide the search marks again
*/ */
hideSearchWords: () => { hideSearchWords : function() {
document $('#searchbox .highlight-link').fadeOut(300);
.querySelectorAll("#searchbox .highlight-link") $('span.highlighted').removeClass('highlighted');
.forEach((el) => el.remove());
document
.querySelectorAll("span.highlighted")
.forEach((el) => el.classList.remove("highlighted"));
const url = new URL(window.location);
url.searchParams.delete("highlight");
window.history.replaceState({}, "", url);
}, },
/** /**
* helper function to focus on search bar * make the url absolute
*/ */
focusSearchBar: () => { makeURL : function(relativeURL) {
document.querySelectorAll("input[name=q]")[0]?.focus(); return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
}, },
/** /**
* Initialise the domain index toggle buttons * get the current relative url
*/ */
initDomainIndexTable: () => { getCurrentURL : function() {
const toggler = (el) => { var path = document.location.pathname;
const idNumber = el.id.substr(7); var parts = path.split(/\//);
const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
if (el.src.substr(-9) === "minus.png") { if (this === '..')
el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; parts.pop();
toggledRows.forEach((el) => (el.style.display = "none")); });
} else { var url = parts.join('/');
el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
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: () => { initOnKeyListeners: function() {
// only install a listener if it is really needed $(document).keydown(function(event) {
if ( var activeElementType = document.activeElement.tagName;
!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && // don't navigate when in search box, textarea, dropdown or button
!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
) && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey
return; && !event.shiftKey) {
switch (event.keyCode) {
const blacklistedElements = new Set([ case 37: // left
"TEXTAREA", var prevHref = $('link[rel="prev"]').prop('href');
"INPUT", if (prevHref) {
"SELECT", window.location.href = prevHref;
"BUTTON", return false;
]);
document.addEventListener("keydown", (event) => {
if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements
if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys
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 39: // right
case "ArrowRight": var nextHref = $('link[rel="next"]').prop('href');
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; if (nextHref) {
window.location.href = nextHref;
const nextLink = document.querySelector('link[rel="next"]'); return false;
if (nextLink && nextLink.href) {
window.location.href = nextLink.href;
event.preventDefault();
}
break;
case "Escape":
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
Documentation.hideSearchWords();
event.preventDefault();
} }
} }
// 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 // quick alias for translations
const _ = Documentation.gettext; _ = Documentation.gettext;
_ready(Documentation.init); $(document).ready(function() {
Documentation.init();
});

View File

@ -1,14 +1,12 @@
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '', VERSION: '',
LANGUAGE: 'en', LANGUAGE: 'None',
COLLAPSE_INDEX: false, COLLAPSE_INDEX: false,
BUILDER: 'html', BUILDER: 'html',
FILE_SUFFIX: '.html', FILE_SUFFIX: '.html',
LINK_SUFFIX: '.html', LINK_SUFFIX: '.html',
HAS_SOURCE: true, HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt', SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false, NAVIGATION_WITH_KEYS: false
SHOW_SEARCH_SUMMARY: true,
ENABLE_SEARCH_SHORTCUTS: false,
}; };

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More