function getDoc(docPath) {
  const val = docCache[docPath];
  if (val) {
    return lib.isPromise(val) ? val : Promise.resolve(val);
  }

  // NOTE: we need to use `mod.fetchJSON` in order to be able to overwrite it.
  // Any tips on how to make this cleaner, please ping!
  docCache[docPath] = mod.fetchJSON(docPath).then((doc) => {
    docCache[docPath] = doc;
    return doc;
  });
  return docCache[docPath];
}
Fetches and caches a document.
@param  {String} docPath the absolute URL of the document.
@return {Promise}        a promise of the document content.
@api public