From 1180314275b62979376ba5ebacf34763ef6ca610 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 21 Jun 2015 14:52:34 +0200 Subject: [PATCH] chore(make-docs): adjust to build.target-dir Thanks to the latest cargo 0.3.0, it's possible to keep everything in the stanard doc output directory, which essentially collects everything for us. This creatly reduces the space required to hold all documentation, and is in fact quite beatiful. --- .gitignore | 2 +- src/mako/deps.mako | 6 ++---- src/mako/index.html.mako | 16 +--------------- src/mako/lib/util.py | 2 +- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 97f07e2530..d5f0715d1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .timestamp .pyenv-* .virtualenv -gen/doc/ +gen/doc *.go *.pyc **target/ diff --git a/src/mako/deps.mako b/src/mako/deps.mako index 9596689d5b..c7495d2ea2 100644 --- a/src/mako/deps.mako +++ b/src/mako/deps.mako @@ -120,10 +120,8 @@ ${api_doc_index}: ${api_common} ${api_doc}: ${api_doc_index} ${central_api_index(crate_name)}: ${api_doc_index} - @mkdir -p ${doc_root} - % if make.documentation_engine == 'rustdoc': - cp -Rf ${os.path.dirname(api_doc_root)} $(dir $@) - % else: + @[[ ! -d ${doc_root} ]] && mkdir -p target/doc && ln -s `pwd`/target/doc ${doc_root} || : + % if make.documentation_engine == 'mkdocs': cp -Rf ${api_doc_root} $(dir $@) % endif diff --git a/src/mako/index.html.mako b/src/mako/index.html.mako index cf681fec44..4d86b94199 100644 --- a/src/mako/index.html.mako +++ b/src/mako/index.html.mako @@ -11,20 +11,6 @@ data = yaml.load_all(open(os.path.join(directories.api_base, 'type-%s.yaml' % api_type))) tc[api_type] = type(directories)(data.next()) # end for each type to load cache for - - first_api_prefix = None - for ad in tc.values(): - if ad.make.documentation_engine != 'rustdoc': - continue - for an in sorted(api.list.keys()): - for v in api.list[an]: - if api_index(DOC_ROOT, an, v, ad.make): - first_api_prefix = gen_crate_dir(an, v, ad.make) - break - # for each version - # for each api name - # end for each type - assert first_api_prefix %>\ - +