Skip to content

Commit

Permalink
doc: Parse github issue and user
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Feb 12, 2017
1 parent d820d79 commit c5b665d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
16 changes: 13 additions & 3 deletions build/build-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function getComponentInfo(one, lang, docs, name) {

docs += `<ul>`
one.json.changes[lastestVersion]['zh-CN'].forEach(one => {
docs += `${getChangeTagHTNL(one, '14px')}`
docs += `${getChangeTagHTML(one, '14px')}`
})
docs += `</ul>\n`
}
Expand All @@ -457,7 +457,7 @@ function getTypeHTML(type) {
}
}

function getChangeTagHTNL(str, fontSize = '15px') {
function getChangeTagHTML(str, fontSize = '15px') {
const _split = str.split(']')
const type = _split[0].replace('[', '')
const content = _split[1]
Expand Down Expand Up @@ -567,6 +567,16 @@ nav: zh-CN
})
}

function parseChange (str) {
str = str.replace(/#(\d+)\s?/g, function (a, b) {
return `<a href="https://github.com/airyland/vux/issues/${b}" target="_blank">#${b}</a> `
})
str = str.replace(/@(\w+)\s?/g, function (a, b) {
return `<a href="https://github.com/${b}" target="_blank">${a}</a>`
})
return str
}

function buildChanges(infos) {
let rs = {}
infos.forEach(one => {
Expand Down Expand Up @@ -597,7 +607,7 @@ nav: zh-CN
str += `\n#### ${_camelCase(j)}\n`
str += `<ul>`
rs[i][j].forEach(one => {
str += `${getChangeTagHTNL(one)}`
str += `${parseChange(getChangeTagHTML(one))}`
})
str += `</ul>`
str += `\n`
Expand Down
8 changes: 4 additions & 4 deletions docs/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ self.$config = {
path: '/zh-CN/vux-loader'
},
{
title: '更新到v2.x',
title: '版本更新',
type: 'dropdown',
items: [{
title: '更新到v2.x',
path: '/zh-CN/upgrade-to-2'
},{
title: '版本更新历史',
path: '/zh-CN/changes'
}, {
title: '更新到v2.x',
path: '/zh-CN/upgrade-to-2'
}]

},
Expand Down
7 changes: 7 additions & 0 deletions src/styles/variable.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
@theme-color: #04BE02;
@opacity-disabled: 0.5;

/**
* datetime
*/
@datetime-header-item-font-color: @theme-color;
@datetime-header-item-cancel-font-color: @datetime-header-item-font-color;
@datetime-header-item-confirm-font-color: @datetime-header-item-font-color;

/**
* tabbar
*/
Expand Down

0 comments on commit c5b665d

Please sign in to comment.