
committed by
Misko Hevery

parent
b89a7dd4a2
commit
d539122466
@ -1,4 +1,4 @@
|
|||||||
{% import "../githubLinks.html" as github -%}
|
{% import "../lib/githubLinks.html" as github -%}
|
||||||
{% set comma = joiner(',') %}
|
{% set comma = joiner(',') %}
|
||||||
{% set breadcrumbDelimiter = joiner('>') %}
|
{% set breadcrumbDelimiter = joiner('>') %}
|
||||||
<article>
|
<article>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% import "../../githubLinks.html" as github -%}
|
{% import "../../lib/githubLinks.html" as github -%}
|
||||||
|
|
||||||
<!-- INFO BAR -->
|
<!-- INFO BAR -->
|
||||||
<section class="info-bar">
|
<section class="info-bar">
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{% import "githubLinks.html" as github -%}
|
{% import "lib/githubLinks.html" as github -%}
|
||||||
|
|
||||||
{% set relativePath = doc.fileInfo.relativePath %}
|
{% set relativePath = doc.fileInfo.relativePath %}
|
||||||
{% if doc.title %}{$ ('# ' + doc.title.trim()) | marked $}{% endif %}
|
{% if doc.title %}{$ ('# ' + doc.title.trim()) | marked $}{% endif %}
|
||||||
{% if 'guide/' in relativePath or 'tutorial/' in relativePath or 'docs.md' in relativePath %}
|
{% if 'guide/' in relativePath or 'tutorial/' in relativePath or 'docs.md' in relativePath %}
|
||||||
<div class="page-actions">
|
<div class="github-links">
|
||||||
<a href="{$ github.githubEditHref(doc, versionInfo) $}" aria-label="Suggest Edits" title="Suggest Edits"><i class="material-icons" aria-hidden="true" role="img">mode_edit</i></a>
|
{$ github.githubEditLink(doc, versionInfo) $}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{$ doc.description | marked $}
|
{$ doc.description | marked $}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
{% macro projectRelativePath(fileInfo) -%}
|
|
||||||
{$ fileInfo.realProjectRelativePath if fileInfo.realProjectRelativePath else fileInfo.projectRelativePath $}
|
|
||||||
{%- endmacro %}
|
|
||||||
|
|
||||||
{% macro githubViewHref(doc, versionInfo) -%}
|
|
||||||
https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/tree/{$ versionInfo.currentVersion.isSnapshot and versionInfo.currentVersion.SHA or versionInfo.currentVersion.raw $}/packages/{$ doc.fileInfo.realProjectRelativePath or doc.fileInfo.relativePath $}#L{$ doc.startingLine + 1 $}-L{$ doc.endingLine + 1 $}
|
|
||||||
{%- endmacro -%}
|
|
||||||
|
|
||||||
{% macro githubEditHref(doc, versionInfo) -%}
|
|
||||||
https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/edit/master{$ '/packages' if doc.docType !== 'content' $}/{$ projectRelativePath(doc.fileInfo) $}?message=docs(
|
|
||||||
{%- if doc.moduleDoc %}{$ doc.moduleDoc.id.split('/')[0] $}
|
|
||||||
{%- elseif doc.docType === 'package' %}{$ doc.id.split('/')[0] $}
|
|
||||||
{%- elseif doc.docType === 'content' %}aio
|
|
||||||
{%- else %}...{%- endif -%}
|
|
||||||
)%3A%20describe%20your%20change...{% if doc.docType !== 'content' %}#L{$ doc.startingLine + 1 $}-L{$ doc.endingLine + 1 $}{% endif %}
|
|
||||||
{%- endmacro -%}
|
|
||||||
|
|
||||||
{% macro githubLinks(doc, versionInfo) -%}
|
|
||||||
<div class="github-links">
|
|
||||||
<a href="{$ githubEditHref(doc, versionInfo) $}" aria-label="Suggest Edits" title="Suggest Edits"><i class="material-icons" aria-hidden="true" role="img">mode_edit</i></a>
|
|
||||||
<a href="{$ githubViewHref(doc, versionInfo) $}" aria-label="View Source" title="View Source"><i class="material-icons" aria-hidden="true" role="img">code</i></a>
|
|
||||||
</div>
|
|
||||||
{%- endmacro -%}
|
|
31
aio/tools/transforms/templates/lib/githubLinks.html
Normal file
31
aio/tools/transforms/templates/lib/githubLinks.html
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{% macro projectRelativePath(fileInfo) -%}
|
||||||
|
{$ fileInfo.realProjectRelativePath if fileInfo.realProjectRelativePath else fileInfo.projectRelativePath $}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{% macro githubViewHref(doc, versionInfo) -%}
|
||||||
|
https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/tree/{$ versionInfo.currentVersion.isSnapshot and versionInfo.currentVersion.SHA or versionInfo.currentVersion.raw $}/packages/{$ doc.fileInfo.realProjectRelativePath $}#L{$ doc.startingLine + 1 $}-L{$ doc.endingLine + 1 $}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{% macro githubEditHref(doc, versionInfo) -%}
|
||||||
|
https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/edit/master{$ '/packages' if doc.docType !== 'content' $}/{$ projectRelativePath(doc.fileInfo) $}?message=docs
|
||||||
|
{%- if doc.moduleDoc %}({$ doc.moduleDoc.id.split('/')[0] $})
|
||||||
|
{%- elseif doc.docType === 'module' %}({$ doc.id.split('/')[0] $})
|
||||||
|
{%- elseif doc.docType === 'content' %}
|
||||||
|
{%- else %}(...){%- endif -%}
|
||||||
|
%3A%20describe%20your%20change...{% if doc.docType !== 'content' %}#L{$ doc.startingLine + 1 $}-L{$ doc.endingLine + 1 $}{% endif %}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{% macro githubEditLink(doc, versionInfo) -%}
|
||||||
|
<a href="{$ githubEditHref(doc, versionInfo) $}" aria-label="Suggest Edits" title="Suggest Edits"><i class="material-icons" aria-hidden="true" role="img">mode_edit</i></a>
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{% macro githubViewLink(doc, versionInfo) -%}
|
||||||
|
<a href="{$ githubViewHref(doc, versionInfo) $}" aria-label="View Source" title="View Source"><i class="material-icons" aria-hidden="true" role="img">code</i></a>
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{% macro githubLinks(doc, versionInfo) -%}
|
||||||
|
<div class="github-links">
|
||||||
|
{$ githubEditLink(doc, versionInfo) $}
|
||||||
|
{$ githubViewLink(doc, versionInfo) $}
|
||||||
|
</div>
|
||||||
|
{%- endmacro -%}
|
@ -1,4 +1,4 @@
|
|||||||
{% import "githubLinks.html" as github -%}
|
{% import "lib/githubLinks.html" as github -%}
|
||||||
{% import "api/lib/memberHelpers.html" as members -%}
|
{% import "api/lib/memberHelpers.html" as members -%}
|
||||||
{% macro goToCode(doc) %}<a href="{$ github.githubViewHref(doc, versionInfo) $}" class="go-to-code" title="Go to source code"><i class="material-icons" aria-hidden="true" role="img">code</i></a>{% endmacro %}
|
{% macro goToCode(doc) %}<a href="{$ github.githubViewHref(doc, versionInfo) $}" class="go-to-code" title="Go to source code"><i class="material-icons" aria-hidden="true" role="img">code</i></a>{% endmacro %}
|
||||||
{% macro label(test, class, text) %}{% if test %}<label class="{$ class $}">{$ text $}</label>{% endif %}{% endmacro %}
|
{% macro label(test, class, text) %}{% if test %}<label class="{$ class $}">{$ text $}</label>{% endif %}{% endmacro %}
|
||||||
|
Reference in New Issue
Block a user