Merge pull request #1969 from clarkdo/md_example

feat: add markdown example
This commit is contained in:
Sébastien Chopin 2017-10-28 10:26:35 +02:00 committed by GitHub
commit 557fb79d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# Markdown Example
> Convert Markdown file to HTML using markdown-it.
**See [Markdownit Module](https://github.com/nuxt-community/modules/tree/master/packages/markdownit) for easy integration with [Nuxt.js](https://nuxtjs.org).**

View File

@ -0,0 +1,16 @@
module.exports = {
modules: [
'@nuxtjs/markdownit'
]
// [optional] markdownit options
// See https://github.com/markdown-it/markdown-it
// markdownit: {
// preset: 'default',
// linkify: true,
// breaks: true,
// use: [
// 'markdown-it-container',
// 'markdown-it-attrs'
// ]
// }
}

View File

@ -0,0 +1,14 @@
{
"name": "nuxt-markdownit",
"version": "1.0.0",
"dependencies": {
"@nuxtjs/markdownit": "^1.1.2",
"nuxt": "latest",
"pug": "^2.0.0-rc.4"
},
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start"
}
}

View File

@ -0,0 +1,6 @@
<template lang="md">
# About Page!
Current route is: {{ $route.name }}
<nuxt-link to="/">Back home</nuxt-link>
</template>

View File

@ -0,0 +1,21 @@
<template lang="md">
# Hello World!
Current route is: {{ $route.path }}
Data model is: {{ model }}
<nuxt-link to="/about">Goto About</nuxt-link>
<nuxt-link to="/pug">Goto Pug</nuxt-link>
</template>
<script>
export default {
data () {
return {
model: 'I am index'
}
}
}
</script>

View File

@ -0,0 +1,17 @@
<template lang="pug">
div
h1 Pug Page
div(language="md") Current route is: {{ $route.name }}
div(language="md") Data model is: {{ model }}
a(href='/') Back Home
</template>
<script>
export default {
data () {
return {
model: 'I am pug'
}
}
}
</script>