mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
feat(index.html): added back-link to crates.io
* url is created per-API and features a nice crates image coming from githubusercontent. Closes #105 [skip ci]
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<%
|
||||
import os
|
||||
import yaml
|
||||
from util import (gen_crate_dir, api_index)
|
||||
from util import (gen_crate_dir, api_index, crates_io_url)
|
||||
|
||||
title = 'Google Service Documentation for Rust'
|
||||
|
||||
@@ -68,6 +68,9 @@ DO NOT EDIT !
|
||||
% for api_name in type_names:
|
||||
<% ad = tc[api_name] %>
|
||||
<a class="mod" href="${api_index(DOC_ROOT, an, v, ad.make)}" title="${ad.make.id.upper()} docs for the ${an} ${v}">${ad.make.id.upper()}</a>
|
||||
% if api_name == 'api':
|
||||
<a href="${crates_io_url(an, v)}"><img src="${html_index.asset_urls.crates_img}" title="This API on crates.io" height="16" width="16"/></a>
|
||||
% endif
|
||||
% if not loop.last:
|
||||
,
|
||||
% endif
|
||||
|
||||
@@ -832,6 +832,9 @@ def to_extern_crate_name(crate_name):
|
||||
def gen_crate_dir(name, version, ti):
|
||||
return to_extern_crate_name(library_to_crate_name(library_name(name, version), ti.target_suffix))
|
||||
|
||||
def crates_io_url(name, version):
|
||||
return "https://crates.io/crates/%s" % library_to_crate_name(library_name(name, version))
|
||||
|
||||
def api_index(DOC_ROOT, name, version, ti, check_exists=True):
|
||||
crate_dir = gen_crate_dir(name, version, ti)
|
||||
if ti.documentation_engine == 'rustdoc':
|
||||
|
||||
Reference in New Issue
Block a user