Merge pull request #5 from xuanskyer/master

添加数据表页面跳转锚点
This commit is contained in:
我才是二亮
2017-03-02 22:02:50 +08:00
committed by GitHub
3 changed files with 13 additions and 2 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
.DS_Store
.idea/*
*.pyc

9
MarkdownBuildClass.py Normal file → Executable file
View File

@@ -9,10 +9,15 @@ class MarkDownBuild:
def buildMarkdown(self, table_data):
text = '# 数据库文档\n\n'
text += '<a name="返回顶部"></a>\n\n## 数据表列表\n\n'
for table in table_data:
text = text + '## ' + table[0][0] + '(' + table[0][1] + ')\n'
text = text + '* [' + table[0][0] + '(' + table[0][1] + ')](#' + table[0][0] + '_pointer)\n\n'
text += '\n\n## 数据表说明\n\n'
for table in table_data:
text = text + '<a name="'+table[0][0]+'_pointer"></a>\n\n'
text = text + '* ' + table[0][0] + '表(' + table[0][1] + ')[↑](#返回顶部)\n\n'
text += self.table_header
for column in table[1]:
text = text + '|' + column[0] + '|' + column[1] + '|' + column[2] + '|\n'
text += '\n'
return text
return text

3
md/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
# 忽略目录下除了.gitignore之外的所有文件
*
!.gitignore