MySQL 表結(jié)構(gòu)生成 Markdown 文檔 | 工具篇

mysql_markdown

It can generate markdown structure documents of MySQL succinctly~


mysql_markdown

視頻鏈接:https://asciinema.org/a/68r0iwYLODOLVbAhHPExIjdo9


背景

在實施軟件工程的時候,當(dāng)要將某一版本歸檔時,需要匯總的文檔要求還是比較高的、各類文檔齊全,包括項目架構(gòu)、項目安裝、接口等文檔,而數(shù)據(jù)庫表結(jié)構(gòu)說明文檔亦屬于其一。記得很早之前想找一個可以導(dǎo)出 MySQL 數(shù)據(jù)庫表結(jié)構(gòu)說明文檔的工具,生態(tài)上的這種工具是有的、只不過并沒有一個使我比較滿足的。當(dāng)然、看個人所需,我需要一個可以導(dǎo)出 markdown 文檔的。

于是 mysql_markdown 就出現(xiàn)了、應(yīng)用而生。它是一款基于 go 語言編寫的一個命令行工具,適用于 Linux、Mac、Windows等平臺。那么它可以做什么?他只有一個功能、就是生成數(shù)據(jù)庫表結(jié)構(gòu)說明文檔,格式為madkdown。

安裝

unix
curl -o /usr/local/bin/mysql_markdown -sSL https://raw.githubusercontent.com/alicfeng/mysql_markdown/master/release/mysql_markdown_unix
chmod +x /usr/local/bin/mysql_markdown
mac
curl -o /usr/local/bin/mysql_markdown -sSL https://raw.githubusercontent.com/alicfeng/mysql_markdown/master/release/mysql_markdown_mac
chmod +x /usr/local/bin/mysql_markdown
other
git clone https://github.com/alicfeng/mysql_markdown.git
cd mysql_markdown
go get "github.com/go-sql-driver/mysql"
go build -o /usr/local/bin/mysql_markdown mysql_markdown.go
chmod +x /usr/local/bin/mysql_markdown

使用

# 幫助函數(shù)
?  mysql_markdown -h
flag needs an argument: -h
Usage: mysql_markdown [options...]
--help  This help text
-h      host.     default 127.0.0.1
-u      username. default root
-p      password. default root
-d      database. default mysql
-P      port.     default 3306
-c      charset.  default utf8
-o      output.   default current location

# 簡單使用
? mysql_markdown -p samego -d samego
mysql connected ...
1/8 the demo table is making ...
2/8 the failed_jobs table is making ...
3/8 the migrations table is making ...
4/8 the password_resets table is making ...
5/8 the roles table is making ...
6/8 the user table is making ...
7/8 the userinfo table is making ...
8/8 the users table is making ...
mysql_markdown finished ...

md2anyDoc

md轉(zhuǎn)其它類型的文檔推薦使用 typora 工具 它支持如下轉(zhuǎn)換格式

  • md2pdf
  • md2html
  • md2html(without styles)
  • md2word
  • md2rtf
  • md2openOffice
  • md2Epub
  • md2latex
  • md2MediaWiki
  • md2reStructureText
  • md2textile
  • md2OPML
  • md2png

文檔頁面效果

生成的MD文件
MySQL 表結(jié)構(gòu)生成 Markdown 文檔
MD文件轉(zhuǎn)PDF
MySQL 表結(jié)構(gòu)生成 Markdown轉(zhuǎn)PDF 文檔
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容