diff --git a/package.json b/package.json index 37c1603b..d45f99ee 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "vue-content-loader": "^0.2.1", "vue-router": "^3.0.1", "vue-router-prefetch": "^1.1.1", + "vue-slim-tabs": "^0.3.0", "vue-template-compiler": "^2.6.10", "vuex": "^3.0.1", "vuex-router-sync": "^5.0.0" diff --git a/src/components/Tabs.vue b/src/components/Tabs.vue new file mode 100644 index 00000000..b2d50895 --- /dev/null +++ b/src/components/Tabs.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/src/index.js b/src/index.js index 8d58e0d9..389be4a9 100644 --- a/src/index.js +++ b/src/index.js @@ -11,6 +11,7 @@ import Badge from './components/Badge.vue' import DocuteSelect from './components/DocuteSelect.vue' import Note from './components/Note.vue' import Gist from './components/Gist.vue' +import Tabs from './components/Tabs.vue' import Loading from './components/Loading.vue' import ExternalLinkIcon from './components/icons/ExternalLinkIcon.vue' import {INITIAL_STATE_NAME} from './utils/constants' @@ -23,6 +24,7 @@ import bannerFooter from './plugins/banner-footer' import darkThemeToggler from './plugins/dark-theme-toggler' import searchPlugin from './plugins/search' +Vue.component(Tabs.name, Tabs) Vue.component(ImageZoom.name, ImageZoom) Vue.component(Badge.name, Badge) Vue.component(DocuteSelect.name, DocuteSelect) diff --git a/src/utils/inlineRender.js b/src/utils/inlineRender.js new file mode 100644 index 00000000..e82920c1 --- /dev/null +++ b/src/utils/inlineRender.js @@ -0,0 +1,22 @@ +import hooks from '../hooks' +import markedRenderer from './markedRenderer' +import marked from './marked' +import highlight from './highlight' + +async function inlineRender(iContent) { + let content = await hooks.processPromise('processMarkdown', iContent) + const env = { + headings: [], + mixins: [], + config: {} + } + content = marked(content, { + renderer: markedRenderer(hooks), + highlight, + env + }) + content = await hooks.processPromise('processHTML', content) + return content +} + +export default inlineRender diff --git a/website/docs/builtin-components.md b/website/docs/builtin-components.md index c9bec423..a89cbebc 100644 --- a/website/docs/builtin-components.md +++ b/website/docs/builtin-components.md @@ -204,3 +204,87 @@ Your favorite fruit: {{ favoriteFruit }} A hack for using `