-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from cloudblue/LITE-26311-add-mkdocs-remove-sp…
…hinx LITE-26311: added mkdocs and removed sphinx
- Loading branch information
Showing
16 changed files
with
760 additions
and
594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Required | ||
version: 2 | ||
|
||
build: | ||
os: ubuntu-20.04 | ||
tools: | ||
python: "3.9" | ||
|
||
mkdocs: | ||
configuration: mkdocs.yml | ||
|
||
python: | ||
install: | ||
- requirements: requirements/docs.txt | ||
- method: pip | ||
path: . |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
:root>* { | ||
--md-primary-fg-color: #1565c0; | ||
--md-primary-fg-color--light: #1565c0; | ||
--md-primary-fg-color--dark: #1565c0; | ||
} | ||
|
||
div.autodoc-docstring { | ||
padding-left: 20px; | ||
margin-bottom: 30px; | ||
border-left: 5px solid rgba(230, 230, 230); | ||
} | ||
|
||
div.autodoc-members { | ||
padding-left: 20px; | ||
margin-bottom: 15px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Getting started | ||
|
||
## Install | ||
|
||
*Python RQL* is a small python package that can be installed from the | ||
[pypi.org](https://pypi.org/project/lib-rql/) repository. | ||
|
||
``` sh | ||
$ pip install lib-rql | ||
``` | ||
|
||
# First steps with Python RQL | ||
|
||
Python RQL allows you to filter a list of python dictionary using RQL. | ||
|
||
First of all you have define your filters. To do so you have to create a | ||
class that inherits from `FilterClass` and declare your filters like in the following example: | ||
|
||
``` py3 | ||
from py_rql.constants import FilterTypes | ||
from py_rql.filter_cls import FilterClass | ||
|
||
|
||
class BookFilter(FilterClass): | ||
FILTERS = [ | ||
{ | ||
'filter': 'title', | ||
}, | ||
{ | ||
'filter': 'author.name', | ||
}, | ||
{ | ||
'filter': 'status', | ||
}, | ||
{ | ||
'filter': 'pages', | ||
'type': FilterTypes.INT, | ||
}, | ||
{ | ||
'filter': 'featured', | ||
'type': FilterTypes.BOOLEAN, | ||
}, | ||
{ | ||
'filter': 'publish_date', | ||
'type': FilterTypes.DATETIME, | ||
}, | ||
] | ||
``` | ||
|
||
Then you can use your BookFilter like in the following example: | ||
|
||
``` py3 | ||
filters = BookFilter() | ||
|
||
query = 'eq(title,Practical Modern JavaScript)' | ||
results = list(filters.filter(query, DATA)) | ||
|
||
print(results) | ||
|
||
query = 'or(eq(pages,472),lt(pages,400))' | ||
results = list(filters.filter(query, DATA)) | ||
|
||
print(results) | ||
``` | ||
|
||
See the examples folder in the project root for a demo program. | ||
|
||
# Customize filter lookups | ||
|
||
You can explicitly declare the lookups you want to support for a | ||
specific filter. For example if you want to just support the | ||
`eq` and `ne` lookup for a string filter you can | ||
do that like in the following example: | ||
|
||
``` py3 | ||
from py_rql.constants import FilterLookups, FilterTypes | ||
from py_rql.filter_cls import FilterClass | ||
|
||
|
||
class BookFilter(FilterClass): | ||
FILTERS = [ | ||
{ | ||
'filter': 'title', | ||
'lookups': {FilterLookups.EQ, FilterLookups.NE} | ||
}, | ||
] | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html><html lang="en-US"><head><meta name="referrer" content="same-origin"><meta charset="UTF-8"><meta name="viewport" content="width=1280"><link rel="preload" href="/26.0.671-g1a7b2b5/applicationinsights-sdk.min.js" as="script"><link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Mono:400,500|Material+Icons" rel="stylesheet"><link id="mock-favicon" rel="shortcut icon" href="#"><script defer="defer" src="/26.0.671-g1a7b2b5/ec1e7ead0cc1757c2a0b.apsconnect.js"></script><link href="/26.0.671-g1a7b2b5/main.45c89579cb91e8827577.css" rel="stylesheet"></head><body><div id="app"></div><div id="updateBrowserWarning"><div class="message"><div class="message__icon"></div><h1 class="message__title">Unsupported browser</h1><p class="message__subtitle">This portal is not supported by the web browser you're currently using</p><p class="message__suggested-browsers">Please use one of the following browsers:<br>Chrome 58+, Firefox 55+, Safari 10+,<br>Opera 47+ or Microsoft Edge 16+</p></div></div><script src="/26.0.671-g1a7b2b5/bowser.min.js"/><script>var minVersions = { | ||
"chrome": "58", | ||
"msedge": "16", | ||
"firefox": "55", | ||
"opera": "47", | ||
"safari": "10" | ||
}; | ||
|
||
if (bowser.isUnsupportedBrowser(minVersions, window.navigator.userAgent)) { | ||
document.getElementById('app').style.display = 'none'; | ||
document.getElementById('updateBrowserWarning').style.display = 'block'; | ||
}</script></body></html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Welcome to Python RQL's documentation! | ||
======================================= | ||
|
||
RQL (Resource query language) is designed for modern application | ||
development. It is built for the web, ready for NoSQL, and highly | ||
extensible with simple syntax. This is a query language fast and | ||
convenient database interaction. RQL was designed for use in URLs to | ||
request object-style data structures. | ||
|
||
[RQL Reference](https://connect.cloudblue.com/community/api/rql/). |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.