diff options
author | Rich Trott <rtrott@gmail.com> | 2018-07-07 15:33:06 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-07-13 20:37:05 -0700 |
commit | 61cd101e128238ba52b333e99fc5b0e948e13de5 (patch) | |
tree | 65778a42a7975c11990f33aa03e61e9f52ab8123 /tools/doc/allhtml.js | |
parent | 6d60c930565710d6cbc77521a2cd94d272986646 (diff) | |
download | android-node-v8-61cd101e128238ba52b333e99fc5b0e948e13de5.tar.gz android-node-v8-61cd101e128238ba52b333e99fc5b0e948e13de5.tar.bz2 android-node-v8-61cd101e128238ba52b333e99fc5b0e948e13de5.zip |
doc: add "Edit on GitHub" link
Proof of concept for an "Edit on GitHub" link, inspired by the
Serverless docs.
One issue is that the link is to the version of the docs on the master
branch even if the person was reading a different version of the doc. I
don't consider that a big problem, although we can always remove the
link if it turns out to be a big problem. I don't think there is a good
solution. PRs need to be opened against the master branch generally.
Having a bunch of PRs against staging branches is probably not what we
want. If there's an update to one version of the doc, there will usually
be an update to other versions.
PR-URL: https://github.com/nodejs/node/pull/21703
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'tools/doc/allhtml.js')
-rw-r--r-- | tools/doc/allhtml.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/doc/allhtml.js b/tools/doc/allhtml.js index 1c84e13d0a..d185538ab6 100644 --- a/tools/doc/allhtml.js +++ b/tools/doc/allhtml.js @@ -52,7 +52,8 @@ let all = toc.replace(/index\.html/g, 'all.html') .replace('<a href="all.html" name="toc">', '<a href="index.html" name="toc">') .replace('index.json', 'all.json') .replace('api-section-index', 'api-section-all') - .replace('data-id="index"', 'data-id="all"'); + .replace('data-id="index"', 'data-id="all"') + .replace(/<li class="edit_on_github">.*?<\/li>/, ''); // Clean up the title. all = all.replace(/<title>.*?\| /, '<title>'); |