doc(lib): use docs.rs for library documentation

We will still need to host the CLI docs though.
This commit is contained in:
Sebastian Thiel
2016-12-24 10:35:48 +01:00
parent 684233ccee
commit fc34337ee4
8 changed files with 17 additions and 8 deletions

View File

@@ -75,7 +75,6 @@ cargo:
# anymore
<<: *cargo_api
repo_base_url: https://github.com/Byron/google-apis-rs
doc_base_url: http://byron.github.io/google-apis-rs
authors:
# don't forget to possibly add them to copyright authors
- Sebastian Thiel <byronimo@gmail.com>

View File

@@ -27,5 +27,6 @@ make:
cargo:
build_script: src/build.rs
keywords: [protocol, web, api]
doc_base_url: https://docs.rs
dependencies:
- url = "= 0.5"

View File

@@ -26,6 +26,7 @@ cargo:
build_version: "1.0.0"
keywords: [cli]
is_executable: YES
doc_base_url: http://byron.github.io/google-apis-rs
dependencies:
- strsim = "^0.5"
- yup-hyper-mock = "^1.0"

View File

@@ -13,7 +13,7 @@ repository = "${util.github_source_root_url()}"
% if documentationLink is not UNDEFINED and documentationLink:
homepage = "${documentationLink}"
% endif
documentation = "${cargo.doc_base_url}/${to_extern_crate_name(util.crate_name())}"
documentation = "${util.doc_base_url()}"
license = "${copyright.license_abbrev}"
keywords = ["${name[:20]}", ${", ".join(estr(cargo.keywords))}]
% if cargo.get('build_script'):

View File

@@ -6,7 +6,7 @@
find_fattest_resource, build_all_params, pass_through, parts_from_params,
REQUEST_MARKER_TRAIT, RESPONSE_MARKER_TRAIT, supports_scopes, to_api_version,
to_fqan, METHODS_RESOURCE, ADD_PARAM_MEDIA_EXAMPLE, PROTOCOL_TYPE_INFO, enclose_in,
upload_action_fn, unique_type_name, schema_doc_format, METHODS_BUILDER_MARKER_TRAIT,
upload_action_fn, unique_type_name, schema_doc_format, METHODS_BUILDER_MARKER_TRAIT,
to_extern_crate_name)
def pretty_name(name):
@@ -30,7 +30,7 @@
response_trait_url = 'trait.' + RESPONSE_MARKER_TRAIT + '.html'
part_trait_url = 'trait.' + PART_MARKER_TRAIT + '.html'
doc_base_url = cargo.doc_base_url + '/' + to_extern_crate_name(util.crate_name()) + '/'
doc_base_url = util.doc_base_url() + '/' + to_extern_crate_name(util.crate_name()) + '/'
def link(name, url):
lf = '[%s](%s)'

View File

@@ -83,9 +83,9 @@ Configuration:
<%def name="new(c)" buffered="True">\
<%
doc_url_base = cargo.doc_base_url + '/' + os.path.dirname(api_index(cargo.doc_base_url, name,
doc_base_url = cargo.doc_base_url + '/' + os.path.dirname(api_index(cargo.doc_base_url, name,
version, make, check_exists=False))
url_info = "All documentation details can be found at " + doc_url_base
url_info = "All documentation details can be found at " + doc_base_url
# list of tuples
# (0) = long name
@@ -215,7 +215,7 @@ let arg_data = [
%>\
("${mangle_subcommand(method)}",
${rust_optional(mc.m.get('description'))},
"Details at ${doc_url_base}/${os.path.splitext(subcommand_md_filename(resource, method))[0]}",
"Details at ${doc_base_url}/${os.path.splitext(subcommand_md_filename(resource, method))[0]}",
vec![
% for flag, desc, arg_name, required, multi in args:
(${rust_optional(arg_name)},

View File

@@ -7,7 +7,7 @@
<%namespace name="util" file="../lib/util.mako"/>\
site_name: ${util.canonical_name()} v${util.crate_version()}
site_url: ${cargo.doc_base_url}/${util.crate_name()}
site_description: Write integrating applications with bcore
site_description: A complete library to interact with ${util.canonical_name()} (protocol ${version})
repo_url: ${util.github_source_root_url()}

View File

@@ -27,6 +27,14 @@ ${util.library_name(name, version)}\
${util.library_to_crate_name(util.library_name(name, version), make.target_suffix)}\
</%def>
<%def name="doc_base_url()" buffered="True">\
% if make.id == 'cli':
${cargo.doc_base_url + '/' + util.to_extern_crate_name(self.crate_name())}\
% else:
${cargo.doc_base_url + '/' + self.crate_name() + '/' + self.crate_version()}\
% endif
</%def>
<%def name="crate_version()" buffered="True">\
${util.crate_version(cargo.build_version, revision is UNDEFINED and '00000000' or revision)}\
</%def>