mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-01 12:33:37 +08:00
feat(ngdocs): external links to github, plunkr and jsfiddle available for code examples
This commit is contained in:
committed by
Misko Hevery
parent
b6e5972eb3
commit
c8197b44eb
@@ -105,7 +105,7 @@ Doc.prototype = {
|
||||
IS_URL = /^(https?:\/\/|ftps?:\/\/|mailto:|\.|\/)/,
|
||||
IS_ANGULAR = /^(api\/)?(angular|ng|AUTO)\./,
|
||||
IS_HASH = /^#/,
|
||||
parts = trim(text).split(/(<pre>[\s\S]*?<\/pre>|<doc:example(\S*).*?>[\s\S]*?<\/doc:example>|<example[^>]*>[\s\S]*?<\/example>)/),
|
||||
parts = trim(text).split(/(<pre.*?>[\s\S]*?<\/pre>|<doc:example(\S*).*?>[\s\S]*?<\/doc:example>|<example[^>]*>[\s\S]*?<\/example>)/),
|
||||
seq = 0,
|
||||
placeholderMap = {};
|
||||
|
||||
@@ -191,9 +191,9 @@ Doc.prototype = {
|
||||
|
||||
return placeholder(example.toHtml());
|
||||
}).
|
||||
replace(/^<pre>([\s\S]*?)<\/pre>/mi, function(_, content){
|
||||
replace(/^<pre(.*?)>([\s\S]*?)<\/pre>/mi, function(_, attrs, content){
|
||||
return placeholder(
|
||||
'<pre class="prettyprint linenums">' +
|
||||
'<pre'+attrs+' class="prettyprint linenums">' +
|
||||
content.replace(/</g, '<').replace(/>/g, '>') +
|
||||
'</pre>');
|
||||
}).
|
||||
|
||||
@@ -241,3 +241,22 @@ ul.events > li > h3 {
|
||||
.type-hint-number {
|
||||
background:rgb(189, 63, 66);
|
||||
}
|
||||
|
||||
.syntax-links {
|
||||
background:#eee;
|
||||
border:1px solid #ddd;
|
||||
text-align:right;
|
||||
padding:1em;
|
||||
border-bottom:0;
|
||||
border-top-left-radius:4px;
|
||||
border-top-right-radius:4px;
|
||||
}
|
||||
|
||||
.syntax-links a {
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
.syntax-links + pre {
|
||||
border-top-left-radius:0;
|
||||
border-top-right-radius:0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user