Skip to content

Commit

Permalink
Merge pull request #11 from cloudblue/LITE-26311-add-mkdocs-remove-sp…
Browse files Browse the repository at this point in the history
…hinx

LITE-26311: added mkdocs and removed sphinx
  • Loading branch information
ffaraone authored Jan 16, 2023
2 parents c0737dc + 9ca2fe6 commit 7833b32
Show file tree
Hide file tree
Showing 16 changed files with 760 additions and 594 deletions.
16 changes: 16 additions & 0 deletions .readthedocs.yaml
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: .
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

57 changes: 0 additions & 57 deletions docs/conf.py

This file was deleted.

16 changes: 16 additions & 0 deletions docs/css/custom.css
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;
}
87 changes: 87 additions & 0 deletions docs/guide.md
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}
},
]
```
104 changes: 0 additions & 104 deletions docs/guide.rst

This file was deleted.

12 changes: 12 additions & 0 deletions docs/images/favicon.ico
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>
Binary file added docs/images/logo_full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/index.md
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/).
29 changes: 0 additions & 29 deletions docs/index.rst

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

Loading

0 comments on commit 7833b32

Please sign in to comment.