Skip to content

Commit

Permalink
docs: 📚 adds initial customization
Browse files Browse the repository at this point in the history
  • Loading branch information
davidroyer committed Jun 8, 2019
1 parent d48dece commit 0695594
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 29 deletions.
20 changes: 20 additions & 0 deletions docs/.vuepress/components/BasicExample.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<template>
<div class="example clearfix">
<VueEditor v-model="content" use-markdown-shortcuts />
</div>
</template>

<script>
if (typeof process === undefined) {
console.log("GOT WINDOW");
}
const VueEditor = Vue2Editor.VueEditor;
export default {
components: { VueEditor },
data() {
return {
content: "null"
};
}
};
</script>
61 changes: 40 additions & 21 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
module.exports = {
plugins: [
require('./plugin.js')
head: [
// [
// "link",
// {
// rel: "stylesheet",
// type: "text/css",
// href: "https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.css"
// }
// ],
[
"script",
{
src: "https://unpkg.com/quill"
}
],
[
"script",
{
src: "https://unpkg.com/vue2-editor@alpha"
}
]
],
plugins: [require("./plugin.js")],
locales: {
'/': {
lang: 'en-US',
title: 'Vue2Editor',
description: 'Vue2Editor for Vue.js'
"/": {
lang: "en-US",
title: "Vue2Editor",
description: "Vue2Editor for Vue.js"
}
},
themeConfig: {
repo: 'David Royer/vue2-editor',
docsDir: 'docs',
repo: "David Royer/vue2-editor",
docsDir: "docs",
locales: {
'/': {
label: 'English',
selectText: 'Languages',
editLinkText: 'Edit this page on GitHub',
nav: [{
text: 'Release Notes',
link: 'https://github.com/David Royer/vue2-editor/releases'
}],
sidebar: [
'/installation.md',
'/started.md',
]
"/": {
label: "English",
selectText: "Languages",
editLinkText: "Edit this page on GitHub",
nav: [
{
text: "Release Notes",
link: "https://github.com/David Royer/vue2-editor/releases"
}
],
sidebar: ["/installation.md", "/started.md", "/usage.md"]
}
}
}
}
};
13 changes: 13 additions & 0 deletions docs/.vuepress/enhanceApp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default ({
Vue, // the version of Vue being used in the VuePress app
options, // the options for the root Vue instance
router, // the router instance for the app
siteData // site metadata
}) => {
// if (window !== undefined) {
// console.log("FROM ENHANCE: ", Vue2Editor);
// Vue.use(Vue2Editor);
// Vue.prototype.$Editor = Vue2Editor;
// }
// ...apply enhancements to the app
};
18 changes: 10 additions & 8 deletions docs/.vuepress/plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { version } = require('../../package.json')
const { version } = require("../../package.json");

module.exports = (/*options, ctx*/) => ({
async enhanceAppFiles () {
async enhanceAppFiles() {
const code = `export default ({ Vue }) => {
Vue.mixin({
computed: {
Expand All @@ -10,10 +10,12 @@ module.exports = (/*options, ctx*/) => ({
}
}
})
}`
return [{
name: 'vuepress-plugin-vue-cli-plugin-p11n',
content: code
}]
}`;
return [
{
name: "vuepress-plugin-vue-cli-plugin-p11n",
content: code
}
];
}
})
});
11 changes: 11 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Usage

## Basic Example

<ClientOnly>
<basic-example />
</ClientOnly>

<!-- ## Customized Example
<customized /> -->

0 comments on commit 0695594

Please sign in to comment.