From ffed0c57c7c686dfaa2afa276fda68cefa64425a Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Mon, 21 Jun 2021 13:59:29 +0200 Subject: [PATCH] WIP: Change RecordType docu from md to rst --- .gitignore | 1 + src/doc/_static/css/server_docu.css | 9 ++ src/doc/conf.py | 8 +- .../{RecordType.md => RecordType.rst} | 117 +++++++++++++----- 4 files changed, 101 insertions(+), 34 deletions(-) create mode 100644 src/doc/_static/css/server_docu.css rename src/doc/specification/{RecordType.md => RecordType.rst} (74%) diff --git a/.gitignore b/.gitignore index c30895c4..6ebd032b 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ authtoken/ # python __pycache__ +*~ diff --git a/src/doc/_static/css/server_docu.css b/src/doc/_static/css/server_docu.css new file mode 100644 index 00000000..b3eeaace --- /dev/null +++ b/src/doc/_static/css/server_docu.css @@ -0,0 +1,9 @@ +table, .wy-table-responsive table { + border-collapse: collapse; + table-layout: fixed; +} + +table td, .wy-table-responsive table td { + word-wrap: break-word; + white-space: unset; +} diff --git a/src/doc/conf.py b/src/doc/conf.py index 46580733..0f95b525 100644 --- a/src/doc/conf.py +++ b/src/doc/conf.py @@ -94,7 +94,13 @@ html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ['_static'] +html_static_path = ['_static'] + +# These paths are either relative to html_static_path +# or fully qualified paths (eg. https://...) +html_css_files = [ + 'css/server_docu.css', +] # Custom sidebar templates, must be a dictionary that maps document names # to template names. diff --git a/src/doc/specification/RecordType.md b/src/doc/specification/RecordType.rst similarity index 74% rename from src/doc/specification/RecordType.md rename to src/doc/specification/RecordType.rst index a7830b86..cff3d0f9 100644 --- a/src/doc/specification/RecordType.md +++ b/src/doc/specification/RecordType.rst @@ -1,36 +1,77 @@ -# RecordType +RecordType +========== + +Overview +-------- + +RecordTypes function as templates for [Records](Record), they provide +a description for a type of Record and define which +[Properties](Property) should be present. Properties come with an +_importance_ attribute which tells the user or client program how +strongly necessary the Property is. (As all other entities,) +RecordTypes can be inherited from other RecordTypes (or any +Entities). When RecordTypes inherit from other RecordTypes, the +_inheritance_ flag tells which properties shall be + +Importance +~~~~~~~~~~ + +Importances are more of a recommendation, Records with omitted +Properties can technically still be committed. + +.. list-table:: + :widths: 25 25 50 + :width: 100% + :header-rows: 1 + + * - Importance + - Meaning + - Consequence when omitted + * - `OBLIGATORY` + - Property must be present + - *FIXME* Can be forced to be committed the server, but usually an error will be returned. + * - `RECOMMENDED` + - Property should be present (makes sense for most users) + - *FIXME* Usually an error will be returned? + * - `SUGGESTED` (*FIXME* the default?) + - Property may be present (may make sense for some users) + - *FIXME* No negative consequence? -## Overview -RecordTypes function as templates for [[Record|Records]], they provide a description for a type of Record and define which [[Property|Properties]] should be present. Properties come with an _importance_ attribute which tells the user or client program how strongly necessary the Property is. (As all other entities,) RecordTypes can be inherited from other RecordTypes (or any Entities). When RecordTypes inherit from other RecordTypes, the _inheritance_ flag tells which properties shall be inherited. -### Importance +*FIXME* Did I get recommended and suggested right? -Importances are more of a recommendation, Records with omitted Properties can technically still be committed. +Inheritance +~~~~~~~~~~~ -| *Importance* | *Meaning* | *Consequence when omitted* | -|--------------|----------------------|----------------------------| -| `OBLIGATORY` | Property must be present | *FIXME* Can be forced to be committed the server, but usually an error will be returned. | -| `RECOMMENDED` | Property should be present (makes sense for most users) | *FIXME* Usually an error will be returned? | -| `SUGGESTED` (*FIXME* the default?) | Property may be present (may make sense for some users) | *FIXME* No negative consequence? | +The _inheritance_ flag decides which [[Property|Properties]] are inherited from parents. -*FIXME* Did I get recommended and suggested right? -### Inheritance +.. list-table:: + :widths: 40 60 + :header-rows: 1 -The _inheritance_ flag decides which [[Property|Properties]] are inherited from parents. + * - Inheritance + - Meaning + * - _None_ (default) + - Nothing is being inherited + * - `OBLIGATORY` + - *FIXME* Properteis of importance `OBLIGATORY` and above? + * - `SUGGESTED` + - *FIXME* Properteis of importance `SIGGESTED` and above, so the same effect as `ALL`? + * - `ALL` + - Copy everything from the parent. + * - `FIX` + - *FIXME* in `tests/test_inheritance.py` of pyint_test this is used, what does it mean??? -| *Inheritance* | *Meaning* | -|----------------|-----------| -| _None_ (default) | Nothing is being inherited | -| `OBLIGATORY` | *FIXME* Properteis of importance `OBLIGATORY` and above? | -| `SUGGESTED` | *FIXME* Properteis of importance `SIGGESTED` and above, so the same effect as `ALL`? | -| `ALL` | Copy everything from the parent. | -| `FIX` | *FIXME* in `tests/test_inheritance.py` of pyint_test this is used, what does it mean???| +Examples +-------- +GET Requests +~~~~~~~~~~~~ + +Single-Get +^^^^^^^^^^ -## Examples -### GET Requests -#### Single-Get *Request:* GET http://localhost:8122/mpidsserver/RecordType/1 @@ -47,8 +88,10 @@ The _inheritance_ flag decides which [[Property|Properties]] are inherited from <Property id="12" name="file" type="file" description="file" importance="suggested" /> </RecordType> </Response> ----- -#### Multi-Get + +Multi-Get +^^^^^^^^^ + *Request:* GET http://localhost:8122/mpidsserver/RecordType/1&2&3 @@ -78,8 +121,11 @@ The _inheritance_ flag decides which [[Property|Properties]] are inherited from <Property id="12" name="file" type="file" description="file" importance="obligatory" /> </RecordType> </Response> ----- -#### Get all + + +Get all +^^^^^^^ + *Request:* GET http://localhost:8122/mpidsserver/RecordType/ @@ -91,15 +137,18 @@ The _inheritance_ flag decides which [[Property|Properties]] are inherited from <Response /> [View Ticket #2](http://dev.bmp.ds.mpg.de/heartdb/ticket/2) ----- -### POST Requests + +POST Requests +~~~~~~~~~~~~~ *Request is to be send to:* POST http://localhost:8122/mpidsserver/RecordType/ POST http://localhost:8122/mpidsserver/RecordType/ ----- -#### Single-Post + +Single-Post +^^^^^^^^^^^ + *HTTP Body:* <Post> @@ -119,8 +168,10 @@ The _inheritance_ flag decides which [[Property|Properties]] are inherited from <Property id="4" name="id" type="integer" description="identifier" importance="suggested" /> </RecordType> </Response> ----- -#### Multi-Post + +Multi-Post +^^^^^^^^^^ + *HTTP Body:* <Post> -- GitLab