[Doc] remove unused file

This commit is contained in:
陈嘉涵 2018-08-09 17:23:08 +08:00
parent 8e301dddb4
commit 467df35780
8 changed files with 0 additions and 324 deletions

View File

@ -1,26 +0,0 @@
{
"name": "vant-weapp",
"authors": [
"Pangxie <pangxie@youzan.com>",
"Chenjiahan <chenjiahan@buaa.edu.cn>"
],
"directory": "vant-weapp",
"description": "Lightweight Mobile UI Components for weapp",
"main": "zan",
"license": "MIT",
"homepage": "",
"ignore": [
"**/.*",
".github",
"assets",
"example",
"node_modules",
"packages",
"scripts",
"website",
"postcss.config.js",
"package.json",
"*.md",
"*.log"
]
}

View File

@ -1,8 +0,0 @@
{
"cdn": {
"basic": {
"src": ["website/dist/**/*.*"],
"dist": "vant/weapp"
}
}
}

View File

@ -1,29 +0,0 @@
const path = require('path')
const fs = require('fs')
const file = require('./file')
const demoPath = path.join(__dirname, '../example/pages')
function getDemoFiles (demoDir) {
if (!file.hasFile(demoDir)) return {}
let files = file.getFiles(demoDir)
let conf = {}
files.forEach(_file => {
let ext = file.getExtname(_file)
conf[ext] = fs.readFileSync(_file, 'utf-8')
})
return conf
}
function getDemoDir (docFile) {
return path.join(demoPath, docFile.split('/').pop())
}
module.exports = function (template) {
// let demoDir = getDemoDir(this.context)
// let demoConf = getDemoFiles(demoDir)
// template = Object.keys(demoConf).reduce((res, key) => {
// res += `\n~~~ ${key}\n${demoConf[key]}~~~`
// return res
// }, template + `<wxapp-demo demo-types="${Object.keys(demoConf)}">\n`)
// return template + '\n</wxapp-demo>'
return template + `<wxapp-demo></wxapp-demo>`;
}

View File

@ -1,115 +0,0 @@
let path = require('path')
let fs = require('fs')
let Readable = require('stream').Readable
let process = require('child_process')
function mkfile(filename, string = '') {
let dir = path.dirname(filename)
if (dir === '.' || dir === '..' || existFile(mkfile)) {
return
}
mkdir(dir)
fs.writeFileSync(filename, string, {mode: 0777, encoding: 'utf8'})
}
function mkfileStream (from, to) {
try {
mkfile(to)
let reader = fs.createReadStream(from)
reader.pipe(fs.createWriteStream(to))
reader.on('end', () => `File modify: ${to}`)
} catch (e) {
console.log(e);
}
}
function rmdir(dir) {
let files = getFiles(dir)
let dirs = getDirs(dir)
files.forEach((file) => {
rmFile(file)
})
dirs.forEach((dir) => {
fs.rmdirSync(dir)
})
fs.rmdirSync(dir)
}
function getExtname (fileName) {
let ext = path.extname(fileName)
return ext ? ext.substr(1) : ''
}
function isJS (file) {
let ext = getExtname(file)
return ext === 'js' ? true : false
}
function getDirs (dir) {
let files = fs.readdirSync(dir)
let fileList = []
files.forEach((file) => {
file = path.join(dir, file)
if (isDir(file)) {
fileList.push(...getDirs(file), file)
}
})
return fileList
}
function getFiles (dir) {
let files = fs.readdirSync(dir)
let fileList = []
files.forEach((file) => {
file = path.join(dir, file)
isDir(file) ? fileList.push(...getFiles(file)) : fileList.push(file)
})
return fileList
}
function hasFile (dir) {
try {
return fs.readdirSync(dir).length
} catch (e) {
return 0
}
}
function mkdir (dir) {
let parPath = path.dirname(dir)
if (isDir(dir)) {
return
} else if (!isDir(parPath)) {
mkdir(parPath)
}
fs.mkdirSync(dir, 0777)
}
function rmFile (file) {
return fs.existsSync(file) && fs.unlinkSync(file)
}
function isDir(dir) {
return fs.existsSync(dir) && fs.statSync(dir).isDirectory()
}
function existFile (file) {
return fs.existsSync(file)
}
function readLines (file) {
if (isDir(file)) throw new Error('参数必须是一个文件')
let index = 0
let lines = fs.readFileSync(file, 'utf-8').split(/[\n|\n\r]/)
lines.next = function () {
return lines[index + 1]
}
lines.find = function (word) {
let i = -1
while(i === -1 || lines[i].indexOf(word) === -1) {
i++
}
return i
}
return lines
}
exports.getExtname = getExtname
exports.mkfile = mkfile
exports.getFiles = getFiles
exports.isJS = isJS
exports.mkfileStream = mkfileStream
exports.rmdir = rmdir
exports.hasFile = hasFile
exports.rmFile = rmFile
exports.mkdir = mkdir
exports.existFile = existFile
exports.readLines = readLines

View File

@ -1,84 +0,0 @@
<template>
<div class="demo" :class="activeCodeType">
<h3 v-if="types.length">示例代码</h3>
<div class="demo-view-qrcode">
<img src="https://img.yzcdn.cn/public_files/2017/10/30/554dd940eb1a269d4ac9133e78ae321f.jpg?imageView2/2/w/300/h/300" />
<div>微信扫一扫</div>
</div>
<!-- <div class="code-type-tabs">
<div class="code-type-tab" @click="activeCodeType = $type" v-for="$type in types" :key="$type">
{{$type}}
</div>
</div> -->
<div class="demo-code">
<slot></slot>
</div>
</div>
</template>
<script>
export default {
props: ['demoTypes'],
data () {
return {
types: [],
activeCodeType: ''
}
},
created () {
this.types = this.demoTypes ? this.demoTypes.split(',') : []
this.activeCodeType = this.types ? this.types[0] : ''
}
}
</script>
<style scoped>
code.language-wxml::after {
content: 'WXML';
}
code.language-js::after {
content: 'JS';
}
code.language-wxss::after {
content: 'WXSS';
}
code.language-json::after {
content: 'JSON';
}
/* .demo {
margin-top: 15px;
}
.demo-code {
height: 500px;
overflow: auto;
background-color: #f5f7fa;
}
.code-type-tabs {
display: flex;
justify-content: center;
text-align: center;
}
.code-type-tab {
flex: 1;
}
.language-js, .language-wxml, .language-wxss, .language-json {
display: none;
}
.js .language-js {
display: block;
}
.json .language-json {
display: block;
}
.wxml .language-wxml {
display: block;
}
.wxss .language-wxss {
display: block;
}
pre + pre {
margin-top: 0;
} */
</style>

View File

@ -1,35 +0,0 @@
.van-doc-header {
position: fixed;
background: #fff;
top: 0;
z-index: 2;
}
.van-doc-header__top-nav-item .van-doc-header__top-nav-lang {
display: none;
}
.van-doc-footer {
position: relative
}
.doc-body {
margin: 60px auto !important;
min-height: 100vh;
}
.side-menus {
position: fixed;
height: calc(100vh - 120px);
overflow: auto;
}
.demo-view-qrcode {
position: fixed;
top: 80px;
right: 20px;
padding: 10px;
border-radius: 5px;
text-align: center;
color: #999;
}
.demo-view-qrcode img {
width: 160px;
height: 160px;
margin-bottom: 10px;
}

View File

@ -1,7 +0,0 @@
import WxappDemo from './components/WxappPage'
import './styles/main.css'
export default {
install (vue) {
vue.component('wxapp-demo', WxappDemo)
}
}

View File

@ -1,20 +0,0 @@
const path = require('path')
const getDemoTemplate = require('./website/demo')
module.exports = {
async: false,
config: path.resolve(__dirname, 'doc.config.js'),
docs: [ path.resolve(__dirname, 'packages') ],
out: path.resolve(__dirname, 'website/dist'),
markdown: {
before (source) {
return getDemoTemplate.call(this, source)
}
},
webpack: {
output: {
publicPath: process.argv[process.argv.length - 1] === 'build' ? 'https://b.yzcdn.cn/vant/weapp' : '/',
filename: '[name].[hash].js'
}
}
}