From c99f77aa13a1bcd7a75f7c78820b029e028702b0 Mon Sep 17 00:00:00 2001 From: xuanskyer Date: Wed, 22 Feb 2017 00:03:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC=E9=94=9A=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MarkdownBuildClass.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) mode change 100644 => 100755 MarkdownBuildClass.py diff --git a/MarkdownBuildClass.py b/MarkdownBuildClass.py old mode 100644 new mode 100755 index f785b1d..e4f292b --- a/MarkdownBuildClass.py +++ b/MarkdownBuildClass.py @@ -9,10 +9,15 @@ class MarkDownBuild: def buildMarkdown(self, table_data): text = '# 数据库文档\n\n' + text += '\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' + text += '## 数据表说明\n\n' + for table in table_data: + text = text + '\n\n' + text = text + '* ' + table[0][0] + '表(' + table[0][1] + ')[↑](#返回顶部)\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 \ No newline at end of file From a5a429d8fd784f3386feb59dcefa6dc4b5c54886 Mon Sep 17 00:00:00 2001 From: xuanskyer Date: Wed, 22 Feb 2017 12:11:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=94=9A=E7=82=B9?= =?UTF-8?q?=E8=AF=AD=E6=B3=95;=E6=B7=BB=E5=8A=A0ignore=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ MarkdownBuildClass.py | 10 +++++----- md/.gitignore | 3 +++ 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 .gitignore create mode 100644 md/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e40693 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +.idea/* +*.pyc \ No newline at end of file diff --git a/MarkdownBuildClass.py b/MarkdownBuildClass.py index e4f292b..fe70f2a 100755 --- a/MarkdownBuildClass.py +++ b/MarkdownBuildClass.py @@ -9,13 +9,13 @@ class MarkDownBuild: def buildMarkdown(self, table_data): text = '# 数据库文档\n\n' - text += '\n\n## 数据表列表\n\n' + text += '\n\n## 数据表列表\n\n' for table in table_data: - text = text + '* [' + table[0][0] + '(' + table[0][1] + ')](#' + table[0][0] + '_pointer)\n' - text += '## 数据表说明\n\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 + '\n\n' - text = text + '* ' + table[0][0] + '表(' + table[0][1] + ')[↑](#返回顶部)\n' + text = text + '\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' diff --git a/md/.gitignore b/md/.gitignore new file mode 100644 index 0000000..aa7847e --- /dev/null +++ b/md/.gitignore @@ -0,0 +1,3 @@ +# 忽略目录下除了.gitignore之外的所有文件 +* +!.gitignore \ No newline at end of file