diff options
Diffstat (limited to 'nixos/modules/services/web-apps/pict-rs.xml')
-rw-r--r-- | nixos/modules/services/web-apps/pict-rs.xml | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/nixos/modules/services/web-apps/pict-rs.xml b/nixos/modules/services/web-apps/pict-rs.xml index bf129f5cc2ac..3f5900c55f15 100644 --- a/nixos/modules/services/web-apps/pict-rs.xml +++ b/nixos/modules/services/web-apps/pict-rs.xml @@ -1,3 +1,5 @@ +<!-- Do not edit this file directly, edit its companion .md instead + and regenerate this file using nixos/doc/manual/md-to-db.sh --> <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="module-services-pict-rs"> <title>Pict-rs</title> <para> @@ -8,7 +10,7 @@ <para> the minimum to start pict-rs is </para> - <programlisting language="bash"> + <programlisting language="nix"> services.pict-rs.enable = true; </programlisting> <para> @@ -18,14 +20,20 @@ services.pict-rs.enable = true; <section xml:id="module-services-pict-rs-usage"> <title>Usage</title> <para> - pict-rs offers the following endpoints: - - <literal>POST /image</literal> for uploading an image. Uploaded - content must be valid multipart/form-data with an image array - located within the <literal>images[]</literal> key + pict-rs offers the following endpoints: </para> - <programlisting> -This endpoint returns the following JSON structure on success with a 201 Created status -```json + <itemizedlist> + <listitem> + <para> + <literal>POST /image</literal> for uploading an image. + Uploaded content must be valid multipart/form-data with an + image array located within the <literal>images[]</literal> key + </para> + <para> + This endpoint returns the following JSON structure on success + with a 201 Created status + </para> + <programlisting language="json"> { "files": [ { @@ -43,9 +51,8 @@ This endpoint returns the following JSON structure on success with a 201 Created ], "msg": "ok" } -``` </programlisting> - <itemizedlist> + </listitem> <listitem> <para> <literal>GET /image/download?url=...</literal> Download an @@ -66,8 +73,20 @@ This endpoint returns the following JSON structure on success with a 201 Created <literal>GET /image/details/original/{file}</literal> for getting the details of a full-resolution image. The returned JSON is structured like so: - <literal>json { "width": 800, "height": 537, "content_type": "image/webp", "created_at": [ 2020, 345, 67376, 394363487 ] }</literal> </para> + <programlisting language="json"> +{ + "width": 800, + "height": 537, + "content_type": "image/webp", + "created_at": [ + 2020, + 345, + 67376, + 394363487 + ] +} +</programlisting> </listitem> <listitem> <para> @@ -124,7 +143,11 @@ This endpoint returns the following JSON structure on success with a 201 Created </para> <para> An example of usage could be - <literal>GET /image/process.jpg?src=asdf.png&thumbnail=256&blur=3.0</literal> + </para> + <programlisting> +GET /image/process.jpg?src=asdf.png&thumbnail=256&blur=3.0 +</programlisting> + <para> which would create a 256x256px JPEG thumbnail and blur it </para> </listitem> |