-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed sphinx and added mkdocs (#685)
- Loading branch information
1 parent
1af07aa
commit cea4c7c
Showing
23 changed files
with
165 additions
and
165 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
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
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,54 @@ | ||
# ID-Mapping introduction | ||
|
||
## What is an ID-type? | ||
|
||
## Adding a mapping between two ID-types | ||
|
||
In your `__init__.py` of your plugin, you can add a new mapping via the `mapping_provider` extension point: | ||
|
||
```python | ||
registry.append('mapping_provider', '<my_mapping_provider_id>', '<my_plugin>.my_mapping_provider') | ||
``` | ||
|
||
The new file `<my_plugin>.my_mapping_provider.py` containing the mapping provider, i.e. a create | ||
function returning mapping tuples (these can be dynamically generated, coming from a db, request, ...): | ||
|
||
```python | ||
def create(): | ||
return [ | ||
('from', 'to', lambda ids: [[f'converted_{id}'] for id in ids]), | ||
('to', 'from', lambda ids: [[id[10:]] for id in ids]), | ||
] | ||
``` | ||
|
||
Each tuple is basically `(from_idtype, to_idtype, mapping_function receiving multiple ids returning multiple ids for each id)`. Generally, the first id returned by the mapping function is preferred, however all are returned by default. | ||
|
||
!!! note | ||
|
||
By simply defining tuples between id-types, powerful transitive mappings can be resolved by traversing the resulting graph. Visyn Core utilizing such a graph to allow for transitive mappings. | ||
|
||
Example: | ||
Imagine registering the tuples `IDTypeA -> IDTypeB` and `IDTypeB -> IDTypeC`. With that, the transitive connection between `ÌDTypeA -> IDTypeC` is possible by first executing `IDTypeA -> IDTypeB`, followed by `IDTypeB -> IDTypeC`. | ||
|
||
## Mapping between two ID-types | ||
|
||
* You can test it by showing all possible idtypes: | ||
|
||
[http://localhost:9000/api/idtype](http://localhost:9000/api/idtype) | ||
|
||
* Or where 'from' can be mapped to: | ||
|
||
[http://localhost:9000/api/idtype/from](http://localhost:9000/api/idtype/from) | ||
|
||
* Or mapping 'from' to 'to' for some ids: | ||
|
||
[http://localhost:9000/api/idtype/from/to?q=1,2,3](http://localhost:9000/api/idtype/from/to?q=1,2,3) | ||
|
||
* Or mapping 'to' to 'from' for some ids: | ||
|
||
[http://localhost:9000/api/idtype/to/from?q=converted_1,converted_2,converted_3](http://localhost:9000/api/idtype/to/from?q=converted_1,converted_2,converted_3) | ||
|
||
* Or mapping 'from' to 'to' for some ids and only wanting the first mapped id each: | ||
|
||
[http://localhost:9000/api/idtype/from/to?q=1,2,3&mode=first](http://localhost:9000/api/idtype/from/to?q=1,2,3&mode=first | ||
) |
Empty file.
Empty file.
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,29 @@ | ||
# `command` Extension Point | ||
|
||
The `command` extension point supports adding custom commands which are executed within the server context, i.e. with loaded plugin registry, migrations, etc. These command override the default server startup and execute the command only. | ||
|
||
## Register a custom command | ||
|
||
Registering custom commands is considered legacy and will not be discussed thoroughly. | ||
|
||
## Running a custom command | ||
|
||
The python module `tdp_core.cmd` can be used as executable module to run any registered command. The corresponding call (executed in the same bash where the server is usually executed, i.e. docker if in dockerized environment) looks like this: | ||
|
||
```bash | ||
python -m tdp_core.cmd <cmd-id> <cmd-arg1> <cmd-arg2> <...> | ||
``` | ||
|
||
More concretely, one can trigger a database upgrade using the following command: | ||
|
||
```bash | ||
python -m tdp_core.cmd db-migration <migration-id> upgrade head | ||
``` | ||
|
||
And a complete downgrade using following command: | ||
|
||
```bash | ||
python -m tdp_core.cmd db-migration <migration-id> downgrade base | ||
``` | ||
|
||
Please see the official alembic documentation regarding database migrations: [https://alembic.sqlalchemy.org/en/latest/api/commands.html](https://alembic.sqlalchemy.org/en/latest/api/commands.html). |
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,2 @@ | ||
# TODO: Commands introduction | ||
|
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,2 @@ | ||
# TODO: Databases introduction | ||
|
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,33 @@ | ||
# TODO: Development Introduction | ||
|
||
All important scripts are exposed via the Makefile. Use `make help` to show all available commands. | ||
|
||
## Formatting | ||
|
||
Use `make format` to reformat all corresponding files. | ||
|
||
## Linting | ||
|
||
Use `make lint` to check for linting issues. | ||
|
||
## Testing | ||
|
||
Use `make test` to run the available test-suites using pytest. | ||
|
||
## Writing documentation | ||
|
||
[mkdocs-material](https://squidfunk.github.io/mkdocs-material/) is used to write this documentation. | ||
|
||
### Commands | ||
|
||
* `make mkdocs new [dir-name]` - Create a new project. | ||
* `make mkdocs serve` - Start the live-reloading docs server. | ||
* `make mkdocs build` - Build the documentation site. | ||
* `make mkdocs -h` - Print help message and exit. | ||
|
||
### Project layout | ||
|
||
mkdocs.yml # The configuration file. | ||
docs/ | ||
index.md # The documentation homepage. | ||
... # Other markdown pages, images and other files. |
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 @@ | ||
# TODO: Developer Workspace |
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,3 @@ | ||
# Welcome to Visyn Core | ||
|
||
Visyn Core is the core of the Visyn Platform, an open-source platform for developing scalable web-based visual ananlytics platforms. |
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,2 @@ | ||
# TODO: Middleware | ||
|
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,2 @@ | ||
# TODO: Plugins and Extensions | ||
|
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 @@ | ||
# TODO: Write your own plugin |
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 @@ | ||
# TODO: Security |
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 @@ | ||
# TODO: Settings |
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,26 @@ | ||
site_name: Visyn Core | ||
theme: | ||
name: material | ||
features: | ||
- navigation.expand | ||
palette: | ||
- media: "(prefers-color-scheme: light)" | ||
scheme: default | ||
primary: blue | ||
toggle: | ||
icon: material/toggle-switch-off-outline | ||
name: Switch to dark mode | ||
- media: "(prefers-color-scheme: dark)" | ||
scheme: slate | ||
primary: blue | ||
toggle: | ||
icon: material/toggle-switch | ||
name: Switch to light mode | ||
markdown_extensions: | ||
- admonition | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
- pymdownx.inlinehilite | ||
- pymdownx.snippets | ||
- pymdownx.superfences | ||
- pymdownx.details |
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
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
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