mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-31 03:29:43 -06:00
docs: WIP docLink tag
This commit is contained in:
@@ -3,15 +3,6 @@
|
||||
/* global hexo */
|
||||
|
||||
hexo.extend.tag.register('note', function (args, content) {
|
||||
// WHAT IT IS YO
|
||||
// [block:callout]
|
||||
// {
|
||||
// "type": "info",
|
||||
// "body": "Explore talks, blogs, and podcasts about testing in Cypress.",
|
||||
// "title": "Want to see Cypress in action?"
|
||||
// }
|
||||
// [/block]
|
||||
|
||||
// {% note info Want to see Cypress in action? %}
|
||||
// Explore talks, blogs, and podcasts about testing in Cypress.
|
||||
// {% endnote %}
|
||||
@@ -52,9 +43,6 @@ hexo.extend.tag.register('note', function (args, content) {
|
||||
}, true)
|
||||
|
||||
hexo.extend.tag.register('fa', function (args, content) {
|
||||
// WHAT IT IS YO
|
||||
// :fa-angle-right:
|
||||
|
||||
// {% fa fa-angle-right green fa-fw %}
|
||||
//
|
||||
// <<< Transforms into >>>
|
||||
@@ -65,3 +53,25 @@ hexo.extend.tag.register('fa', function (args, content) {
|
||||
|
||||
return '<i class="fa ' + classNames + '"></i>'
|
||||
})
|
||||
|
||||
hexo.extend.tag.register('docLink', function (args, content) {
|
||||
var result = ''
|
||||
// {% docLink api `.and()` and %}
|
||||
// {% docLink guides 'Read about why' why-cypress %}
|
||||
//
|
||||
// <<< Transforms into >>>
|
||||
//
|
||||
// <a href="/api/commands/and.html"><code>.and()</code></a>
|
||||
// <a href="/guides/getting-started/why-cypress.html">Read about why</a>
|
||||
|
||||
var attrs = {
|
||||
text: args[0],
|
||||
url: args[1]
|
||||
}
|
||||
|
||||
result += `<a href="${attrs.url}.html">`
|
||||
result += hexo.render.renderSync({text: attrs.text, engine: 'markdown'})
|
||||
result += `</a>`
|
||||
|
||||
return result
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user