X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/60b06883b6d5a336ef47c01103ec1ce25aafae69..c26ab6ee15974c1133a6d08c459b51199185f25f:/apps/api/templates/api/main.html diff --git a/apps/api/templates/api/main.html b/apps/api/templates/api/main.html index ada509342..8b6805945 100755 --- a/apps/api/templates/api/main.html +++ b/apps/api/templates/api/main.html @@ -1,5 +1,7 @@ {% extends "base.html" %} +{% load url from future %} {% load i18n %} +{% load common_tags %} {% block title %}{% trans "WolneLektury.pl API" %}{% endblock %} @@ -9,9 +11,11 @@

API

+

-{% blocktrans %} -WolneLektury.pl API resides under http://www.wolnelektury.pl/api/. +{% url "api" as u %} +{% blocktrans with u=u|build_absolute_uri:request %} +WolneLektury.pl API resides under {{ u }}. You can use it to access information about books, their fragments and their metadata. {% endblocktrans %} @@ -20,7 +24,7 @@ their metadata.

{% blocktrans %} Default data serialization format is -JSON, +JSON, but you can also use XML by appending ?format=xml query parameter to each URL. {% endblocktrans %} @@ -44,8 +48,8 @@ The URLs in WolneLektury.pl API are:

-{% url api_book "studnia-i-wahadlo" as e1 %} -{% url api_tag "authors" "edgar-allan-poe" as e2 %} +{% url "api_book" "studnia-i-wahadlo" as e1 %} +{% url "api_tag" "authors" "edgar-allan-poe" as e2 %} {% blocktrans %} Each element of those lists contains a link (in a "href") attibute which points to individual resource's details, i.e.: @@ -70,7 +74,7 @@ If you only want top-level books and not all the children, you can use /parent_b

-{% url api_fragment "sen-nocy-letniej" "1290526312912-3814598192" as f %} +{% url "api_fragment" "sen-nocy-letniej" "1290526312912-3814598192" as f %} {% blocktrans with "/api/authors/william-shakespeare/themes/zabawa/fragments/" as e %} The same way, using also books and themes, you can search for a list of fragments: {{e}}. @@ -78,5 +82,5 @@ Again, each entry has a "href" attribute which links to the fragment's details, {{f}}. {% endblocktrans %}

- +
{% endblock %}