docsify-online-api-test v1.0.0
docsify-online-api-test
A docsify plugin that adds a button go to other website for online api test .
Installation
Add following script tag to your index.html
after docsify.
<script src="https://unpkg.com/docsify-online-api-test"></script>
Options
buttonText
Button text can be customized as follows:
window.$docsify = {
// docsify-copy-code (defaults)
onlineApiTest: {
buttonText: '跳转在线测试网站'
}
}
Localization (l10n)
Button text can also be customized based on the current URL. Object key/value pairs are processed in the order provided.
window.$docsify = {
onlineApiTest: {
buttonText: {
'/zh-cn/': '跳转在线测试网站',
'/ru/': 'Перейти на онлайн тестовый сайт',
'/de-de/': 'Zum Online Testing Website',
'/es/': 'Prueba en línea',
'/': 'Jump to the online test site'
},
}
}
Note: Docsify's alias option makes it easy to manage local content using separate directories. See the /demo/
content in this repo for an example.
buttonStyle
Button Style, easy to adjust the style, co-exist with other plugins(just like docsify-copy-code)
window.$docsify = {
onlineApiTest: {
onlineApiTest: {
buttonStyle: 'color: red;top: 20px;',
}
}
}
spanStyle
Button's span Style.
window.$docsify = {
onlineApiTest: {
onlineApiTest: {
url: 'color: red;',
}
}
}
url
The target address of the jump.
window.$docsify = {
onlineApiTest: {
onlineApiTest: {
url: 'https://www.baidu.com',
}
}
}
License
This project is licensed under the MIT License. See the LICENSE for details.
P.S
There are many references to code form docsify-copy-code. Thanks for docsify-copy-code.
3 years ago