From a8ff63426a74298a6f211931b2dc39906b14b578 Mon Sep 17 00:00:00 2001 From: fivesmallq Date: Mon, 30 May 2016 20:05:35 +0800 Subject: [PATCH 1/3] add toc --- mysql-workbench-plugin-doc-generating.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-workbench-plugin-doc-generating.py b/mysql-workbench-plugin-doc-generating.py index 09869ba..787498a 100644 --- a/mysql-workbench-plugin-doc-generating.py +++ b/mysql-workbench-plugin-doc-generating.py @@ -15,6 +15,7 @@ def documentation(diagram): text = "#Schema documentation\n\n" text += "Generated by MySQL Workbench Model Documentation v1.0.0 - Copyright (c) 2015 Hieu Le\n\n"; + text += "[TOC]\n\n"; for figure in diagram.figures: From 4e586c1bcff36f18707b20dba67d1a746a186f61 Mon Sep 17 00:00:00 2001 From: fivesmallq Date: Mon, 30 May 2016 20:46:52 +0800 Subject: [PATCH 2/3] show some columns length --- mysql-workbench-plugin-doc-generating.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysql-workbench-plugin-doc-generating.py b/mysql-workbench-plugin-doc-generating.py index 787498a..2904ed7 100644 --- a/mysql-workbench-plugin-doc-generating.py +++ b/mysql-workbench-plugin-doc-generating.py @@ -63,10 +63,13 @@ def writeColumnDoc(column, table): # column type name if column.simpleType: - text += " | " + column.simpleType.name # column max lenght if any if column.length != -1: + text += " | " + column.simpleType.name text += "(" + str(column.length) + ")" + else: + #use raw formatted + text += " | " + column.formattedRawType else: text += " | " From ee6a2f74e33e06ff5e205c53751621f9652003df Mon Sep 17 00:00:00 2001 From: fivesmallq Date: Mon, 30 May 2016 21:09:15 +0800 Subject: [PATCH 3/3] use formattedRawType --- mysql-workbench-plugin-doc-generating.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/mysql-workbench-plugin-doc-generating.py b/mysql-workbench-plugin-doc-generating.py index 2904ed7..d50c3a5 100644 --- a/mysql-workbench-plugin-doc-generating.py +++ b/mysql-workbench-plugin-doc-generating.py @@ -62,14 +62,9 @@ def writeColumnDoc(column, table): text = "| `" + column.name + "`" # column type name - if column.simpleType: - # column max lenght if any - if column.length != -1: - text += " | " + column.simpleType.name - text += "(" + str(column.length) + ")" - else: - #use raw formatted - text += " | " + column.formattedRawType + if column.formattedRawType: + #use raw formatted + text += " | " + column.formattedRawType else: text += " | "