From 39af314e2946a25fe887f62b68a0150a2b566c48 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 23 May 2018 22:56:05 +0100 Subject: [PATCH] build(aio): add github links to API doc members (#24000) This change adds Github edit and view links to methods and decorator options. It is possible to add these to properties also but the UI is rather tight as these are displayed in a table. PR Close #24000 --- aio/src/styles/2-modules/_api-pages.scss | 20 +++++++++++++++-- .../templates/api/base.template.html | 5 +---- .../templates/api/class.template.html | 6 ++--- .../templates/api/decorator.template.html | 6 ++++- .../api/includes/decorator-overview.html | 2 +- .../templates/api/interface.template.html | 2 +- .../templates/api/lib/githubLinks.html | 11 ++++++++-- .../templates/api/lib/memberHelpers.html | 22 +++++++++++-------- 8 files changed, 51 insertions(+), 23 deletions(-) diff --git a/aio/src/styles/2-modules/_api-pages.scss b/aio/src/styles/2-modules/_api-pages.scss index f368289ada..dcd25bab04 100644 --- a/aio/src/styles/2-modules/_api-pages.scss +++ b/aio/src/styles/2-modules/_api-pages.scss @@ -1,4 +1,4 @@ -.page-actions { +.github-links { float: right; .material-icons { border-radius: 4px; @@ -32,12 +32,28 @@ .method-table, .option-table { th { - padding: 8px 16px; + display: flex; + align-items: center; + + h3 { + flex: 1; + } + + .github-links { + a { + color: $mediumgray; + .material-icons:hover { + background: none; + color: $blue; + } + } + } } h3 { margin: 6px 0; font-weight: bold; + clear: left; } h4 { diff --git a/aio/tools/transforms/templates/api/base.template.html b/aio/tools/transforms/templates/api/base.template.html index 7d93b9e861..72b6fe9a7a 100644 --- a/aio/tools/transforms/templates/api/base.template.html +++ b/aio/tools/transforms/templates/api/base.template.html @@ -2,10 +2,7 @@ {% set comma = joiner(',') %} {% set slash = joiner('/') %}
-
- - -
+ {$ github.githubLinks(doc, versionInfo) $}