diff --git a/swh/web/ui/static/css/style.css b/swh/web/ui/static/css/style.css index 826cebb6..4a405f1f 100644 --- a/swh/web/ui/static/css/style.css +++ b/swh/web/ui/static/css/style.css @@ -1,215 +1,249 @@ /* version: 0.1 date: 21/09/15 author: swh email: swh website: softwareheritage.org version history: /style.css */ @import url(https://fonts.googleapis.com/css?family=Alegreya:400,400italic,700,700italic); @import url(https://fonts.googleapis.com/css?family=Alegreya+Sans:400,400italic,500,500italic,700,700italic,100,300,100italic,300italic); body { font-family: 'Alegreya Sans', sans-serif; font-size: 1.6rem; line-height: 1.5; color: rgba(0, 0, 0, 0.55); padding-top: 65px; /* avoid fixed bootstrap navbar covers content */ } .heading { font-family: 'Alegreya', serif; } .shell, .text { font-size: 0.7em; } img.swh-logo { max-height: 40px; } .jumbotron { padding: 0; background-color: rgba(0, 0, 0, 0); position: fixed; top: 0; width: 100%; } #swh-navbar-collapse { border-top-style: none; border-left-style: none; border-right-style: none; border-bottom: 5px solid; border-image: linear-gradient(to right, rgb(226, 0, 38) 0%, rgb(254, 205, 27) 100%) 1 1 1 1; width: 100%; } .nav-horizontal { float: right; } h3[id], h4[id] { /* avoid in-page links covered by navbar */ padding-top: 65px; margin-top: -65px; display: inline-block; /* webkit compatibility */ } a { color: #377ba8; } h1, h2, h3, h4 { margin: 0; color: #e20026; } h1 { font-size: 1.8em; } h2 { font-size: 1.2em; } a { color: rgba(0, 0, 0, 0.75); border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: rgb(91, 94, 111); } a:hover { color: black; } ul.dropdown-menu > li > a, ul.dropdown-menu > li > ul > li > a, .navbar-header > a, ul.navbar-nav > li > a { /* No decoration on links in dropdown menu */ border-bottom-style: none; } .navbar-header > a, ul.navbar-nav > li > a { color: #323232; font-weight: 700; } .navbar-header > a:hover, ul.navbar-nav > li > a:hover { color: #8f8f8f; } .sitename .first-word, .sitename .second-word { font-weight: normal; font-size: 1.8rem; } .sitename .first-word { font-family: 'Alegreya Sans', sans-serif; } .sitename .second-word { font-family: 'Alegreya', serif; } ul.dropdown-menu > li, ul.dropdown-menu > li > ul > li { /* No decoration on bullet points in dropdown menu */ list-style-type: none; } .page { margin: 2em auto; width: 35em; border: 5px solid #ccc; padding: 0.8em; background: white; } .entries { list-style: none; margin: 0; padding: 0; } .entries li { margin: 0.8em 1.2em; } .entries li h2 { margin-left: -1em; } .add-entry { font-size: 0.9em; border-bottom: 1px solid #ccc; } .add-entry dl { font-weight: bold; } .metanav { text-align: right; font-size: 0.8em; padding: 0.3em; margin-bottom: 1em; background: #fafafa; } .flash { background: #cee5F5; padding: 0.5em; border: 1px solid #aacbe2; } .error { background: #f0d6d6; padding: 0.5em; } .file-found { color: #23BA49; } .file-notfound { color: #FF4747; } /* Bootstrap custom styling to correctly render multiple * form-controls in an input-group: * github.com/twbs/bootstrap/issues/12732 */ .input-group-field { display: table-cell; vertical-align: middle; border-radius:4px; min-width:1%; white-space: nowrap; } .input-group-field .form-control { border-radius: inherit !important; } .input-group-field:not(:first-child):not(:last-child) { border-radius:0; } .input-group-field:not(:first-child):not(:last-child) .form-control { border-left-width: 0; border-right-width: 0; } .input-group-field:last-child { border-top-left-radius:0; border-bottom-left-radius:0; } .input-group > span:not(:last-child) > button { border-radius: 0; } .multi-input-group > .input-group-btn { vertical-align: bottom; padding: 0; } .dataTables_filter input { width: 70%; float: right; } tr.api-doc-route-upcoming > td, tr.api-doc-route-upcoming > td > a { color: orange; } tr.api-doc-route-deprecated > td, tr.api-doc-route-deprecated > td > a { color: red; } #back-to-top { display: initial; position: fixed; bottom: 30px; right: 30px; z-index: 10; } #back-to-top a img { display: block; width: 32px; height: 32px; background-size: 32px 32px; text-indent: -999px; overflow: hidden; } .table > thead > tr > th { border-bottom: 1px solid #e20026; } .table > tbody > tr > td { border-style: none; } pre { border: 1px dashed black; border-radius: 10px; background-color: hsl(47, 99%, 75%); } .dataTables_wrapper { position: static; } + +/* breadcrumbs */ + +.bread-crumbs{ + display: inline-block; + margin: 0 0 15px; + overflow: hidden; + color: rgba(0, 0, 0, 0.55); + font-size: 1.2rem; +} + +bread-crumbs ul { + list-style-type: none; +} + +.bread-crumbs li { + float: left; + margin-right: 10px; + list-style-type: none; +} + +.bread-crumbs a { + color: rgba(0, 0, 0, 0.75); + border-bottom-style: none; +} + +.bread-crumbs a:hover { + color: rgba(0, 0, 0, 0.85); + text-decoration: underline; +} + +.title-small .bread-crumbs{ + margin: -30px 0 25px; +} diff --git a/swh/web/ui/templates/api-endpoints.html b/swh/web/ui/templates/api-endpoints.html index 0de9f808..f3c98952 100644 --- a/swh/web/ui/templates/api-endpoints.html +++ b/swh/web/ui/templates/api-endpoints.html @@ -1,53 +1,60 @@ {% extends "layout.html" %} {% block title %}API Overview{% endblock %} {% block content %} +
Route | Status | Description | {% for route, doc in doc_routes %}|
---|---|---|---|
{{ route }} | {% if 'tags' in doc and doc['tags'] is not none %}{{ ', '.join(doc['tags']) }} | {% else %}opened | {% endif %}{{ doc['docstring'] | safe_docstring_display | safe }} |
{{ request.method }} {{ request.url }}{% if headers_data and headers_data is not none %}
{{ header_name }} {{ header_value | urlize_header_links | safe }}{% endfor %} {% endif %}
{{ response_data | escape_author_fields | urlize_api_links | safe }}
URL | Allowed Methods |
---|---|
{{ url['rule'] }} | {{ url['methods'] | sort | join(', ') }} |
Welcome to Software Heritage project's API documentation.
Table of Contents
Current version is 1.
Api access is over https and accessed through https://archive.softwareheritage.org/api/1/.
Data is sent and received in json by default.
Examples:
From the command line:
curl -i https://archive.softwareheritage.org/api/1/stat/counters/
The response output can be sent as yaml provided the client specifies it using the header field.
Examples:
From your favorite REST client API, execute the same request as before with the request header 'Accept' set to the 'application/yaml'.
From the command line:
curl -i -H 'Accept: application/yaml' https://archive.softwareheritage.org/api/1/stat/counters/
Some API endpoints can be used with local parameters. The url then needs to be adapted accordingly.
For example:
https://archive.softwareheritage.org/api/1/<endpoint-name>?<field0>=<value0>&<field1>=<value1>
where:
One parameter is defined for all api endpoints fields
. It permits to filter the output fields per key.
For example, to only list the number of contents, revisions, directories on the statistical endpoints, one uses:
Examples:
From the command line:
curl https://archive.softwareheritage.org/api/1/stat/counters/\?fields\=content,directory,revision
Note: If the keys provided to filter on do not exist, they are ignored.
There are 2 kinds of error.
In that case, the http error code will reflect. Furthermore, the response is a dictionary with one key 'error' detailing the problem.
This means that the input is incorrect.
Example:
From the command line:
curl -i https://archive.softwareheritage.org/api/1/content/1/
The api content expects an hash identifier so the error will mention that an hash identifier is expected.
This means that the request is ok but we do not found the information the user requests.
Examples:
From the command line:
curl -i https://archive.softwareheritage.org/api/1/content/04740277a81c5be6c16f6c9da488ca073b770d7f/
The hash identifier is ok but nothing is found for that identifier.
You will find below the terminology the project SWH uses. More details can be found on swh's wiki glossary page.
A (specific version of a) file stored in the archive, identified by its cryptographic hashes (SHA1, "git-like" SHA1, SHA256) and its size.
Also known as: Blob Note.
A fixed-size "summary" of a stream of bytes that is easy to compute, and hard to reverse.
Also known as: Checksum, Digest.
A set of named pointers to contents (file entries), directories (directory entries) and revisions (revision entries).
A location from which a coherent set of sources has been obtained.
Also known as: Data source.
Examples:
An organized effort to develop a software product.
Projects might be nested following organizational structures (sub-project, sub-sub-project), are associated to a number of human-meaningful metadata, and release software products via Origins.
A revision that has been marked by a project as noteworthy with a specific, usually mnemonic, name (for instance, a version number).
Also known as: Tag (Git-specific terminology).
Examples:
A "point in time" snapshot in the development history of a project.
Also known as: Commit
Examples:
Accessible through https://archive.softwareheritage.org/api/1/.