ShowDoc
官网
https://www.showdoc.cc/
GitHub
https://github.com/star7th/showdoc
帮助说明
https://www.showdoc.cc/help?page_id=1385767280275683
ShowDoc 是什么?
每当接手一个他人开发好的模块或者项目,看着那些没有写注释的代码,我们都无比抓狂。文档呢?!文档呢?!Show me the doc !!
程序员都很希望别人能写技术文档,而自己却很不希望要写文档。因为写文档需要花大量的时间去处理格式排版,想着新建的word文档放在哪个目录等各种非技术细节。
word文档零零散散地放在团队不同人那里,需要文档的人基本靠吼,吼一声然后上qq或者邮箱接收对方丢过来的文档。这种沟通方式当然可以,只是效率不高。
ShowDoc就是一个非常适合IT团队的在线文档分享工具,它可以加快团队之间沟通的效率。
它都有些什么功能?
分享与导出
响应式网页设计,可将项目文档分享到电脑或移动设备查看。同时也可以将项目导出成word文件,以便离线浏览。
权限管理
公开项目与私密项目
ShowDoc上的项目有公开项目和私密项目两种。公开项目可供任何登录与非登录的用户访问,而私密项目则需要输入密码验证访问。密码由项目创建者设置。
项目转让
项目创建者可以自由地把项目转让给网站的其他用户。
项目成员
你可以很方便地为ShowDoc的项目添加、删除项目成员。项目成员可以对项目进行编辑,但不可转让或删除项目(只有项目创建者才有权限)
团队管理
利用showdoc的团队功能你可以更好地进行团队协作
编辑功能
markdown编辑
ShowDoc采用markdown编辑器,无论是编辑还是阅读体验都极佳很棒。如果你不了解Markdown,请在搜索引擎搜索”认识与入门 Markdown”
模板插入
在ShowDoc的编辑页面,点击编辑器上方的按钮可方便地插入API接口模板和数据字典模板。插入模板后,剩下的就是改动数据了,省去了很多编辑的力气。
历史版本
ShowDoc为页面提供历史版本功能,你可以方便地把页面恢复到之前的版本。
部署到自己的服务器
ShowDoc部署手册请参考:https://www.showdoc.cc/help?page_id=13732
开源地址:https://github.com/star7th/showdoc 。若觉得showdoc好用,不妨点个star。良好的关注度和参与度有助于开源项目的长远发展。
二次开发指引
https://www.showdoc.cc/help?page_id=1385576954326448
自动脚本安装
#下载
sudo wget https://www.showdoc.cc/script/showdoc
# 增加执行权限
sudo chmod +x showdoc
# 安装软件
sudo apt install curl
#默认安装中文版。如果想安装英文版,请加上 en 参数,如 ./showdoc en
./showdoc
# showdoc 脚本
#!/bin/bash
if [[ -n "$1" ]] ; then
action=$1
else
action='install'
fi
if [ "$action" == "start" ] ;then
sudo -s service docker start
sudo -s docker start showdoc
exit 1
fi
if [ "$action" == "restart" ] ;then
sudo -s docker restart showdoc
exit 1
fi
if [ "$action" == "stop" ] ;then
sudo -s docker stop showdoc
exit 1
fi
if [ "$action" == "update" ] ;then
DATE=$(date +%Y%m%d_%H%M%S_%N)
if [ ! -d "/showdoc_data/html" ]; then
echo "Directory /showdoc_data/html does not exist"
echo "/showdoc_data/html 目录不存在"
exit 1 ;
fi
rm -f master.tar.gz
wget https://github.com/star7th/showdoc/archive/master.tar.gz
if [ ! -f "master.tar.gz" ]; then
echo "Download file fail"
echo "文件下载失败"
exit 1
fi
sudo -s docker stop showdoc
sudo -s chmod -R 777 /showdoc_data/
sudo -s mv /showdoc_data/html /showdoc_data/html_bak_${DATE}
tar -zxvf master.tar.gz -C /showdoc_data/
sudo -s mv /showdoc_data/showdoc-master /showdoc_data/html ##// */
if [ ! -d "/showdoc_data/html" ]; then
echo "Directory /showdoc_data/html does not exist"
echo "/showdoc_data/html 目录不存在"
exit 1 ;
fi
sudo -s chmod -R 777 /showdoc_data/html
sudo -s docker start showdoc
sleep 10
result=$(tail /showdoc_data/html_bak_${DATE}/web/index.html | grep zh)
if [ ! -z "$result" ] ; then
curl http://localhost:4999/install/non_interactive.php?lang=zh
else
curl http://localhost:4999/install/non_interactive.php?lang=en
fi
\cp -f /showdoc_data/html_bak_${DATE}/Sqlite/showdoc.db.php /showdoc_data/html/Sqlite/showdoc.db.php
\cp -r -f /showdoc_data/html_bak_${DATE}/Public/Uploads /showdoc_data/html/Public/
sudo -s curl http://localhost:4999?s=/home/update/db
rm -f master.tar.gz
exit 1
fi
if [ "$action" == "uninstall" ] ;then
echo -e " Showdoc is about to be uninstalled. Are you sure to delete all showdoc data? [Y/n] \n 即将卸载showdoc,你是否确认删除showdoc所有数据? [Y/n] "
read -r -p '' input
case $input in
[yY][eE][sS]|[yY])
sudo -s docker stop showdoc
sudo -s docker rm showdoc
echo "uninstalling..."
echo "正在卸载..."
sudo -s docker rmi xd2idwf5.mirror.aliyuncs.com/star7th/showdoc
sudo -s docker rmi registry.docker-cn.com/star7th/showdoc
sudo -s docker rmi registry.cn-shenzhen.aliyuncs.com/star7th/showdoc
sudo -s docker rmi star7th/showdoc
sudo -s rm -rf /showdoc_data
echo "Done"
echo "完成"
;;
[nN][oO]|[nN])
;;
*)
exit 1
;;
esac
exit 1
fi
if ! [ -x "$(command -v docker)" ]; then
echo 'It was detected that Docker was not installed. Attempting to install from the network... The time required is related to your network environment.'
echo '检测到Docker尚未安装。正在试图从网络安装...所需时间与你的网络环境有关'
sudo -s curl -sSL https://get.daocloud.io/docker | sh
sudo -s chkconfig docker on
fi
if ! [ -x "$(command -v docker)" ]; then
echo 'It was detected that Docker was not installed. Attempting to install from the network... The time required is related to your network environment.'
echo '检测到Docker尚未安装。正在试图从网络安装...所需时间与你的网络环境有关'
sudo -s curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
sudo -s chkconfig docker on
fi
if ! [ -x "$(command -v docker)" ]; then
echo 'Docker failed to install automatically. It is recommended that you install the docker environment manually before starting this script.'
echo 'Docker自动安装失败,建议你手动安装好docker环境后再启动本脚本'
exit 1
fi
if [ "$(docker images |grep showdoc)" ]; then
echo ""
echo "You have installed showdoc image"
echo "If you want to update showdoc, please execute ./showdoc update "
echo "If you want to restart showdoc, please execute ./showdoc restart "
echo "If you want to uninstall showdoc, please execute ./showdoc uninstall "
echo ""
echo "你已经安装过showdoc镜像"
echo "如果你想更新showdoc,请执行 ./showdoc update "
echo "如果你想重启showdoc,请执行 ./showdoc restart "
echo "如果你想卸载showdoc,请执行 ./showdoc uninstall "
exit 1
fi
sudo -s service docker start
echo 'The showdoc image is being retrieved, please wait a moment... The time required is related to your network environment.'
echo '正在拉取showdoc镜像,请稍后...所需时间与你的网络环境有关'
if [ "$action" == "en" ] ;then
sudo -s docker pull star7th/showdoc
else
sudo -s docker pull registry.cn-shenzhen.aliyuncs.com/star7th/showdoc
sudo -s docker tag registry.cn-shenzhen.aliyuncs.com/star7th/showdoc:latest star7th/showdoc:latest
fi
sudo -s mkdir /showdoc_data
if [ ! -d "/showdoc_data" ]; then
echo "/showdoc_data directory does not exist. Make sure you have create permissions"
echo "/showdoc_data 目录不存在,请确保有创建权限"
exit 1 ;
fi
sudo -s mkdir /showdoc_data/html
sudo -s chmod -R 777 /showdoc_data
sudo -s docker run -d --name showdoc -p 4999:80 -v /showdoc_data/html:/var/www/html/ star7th/showdoc
sleep 10
if [ "$action" == "en" ] ;then
sudo -s curl http://localhost:4999/install/non_interactive.php?lang=en
else
sudo -s curl http://localhost:4999/install/non_interactive.php?lang=zh
fi
sudo -s wget http://localhost:4999/install/install.lock
if [ -f "install.lock" ]; then
rm -rf install.lock
if [ "$action" == "en" ] ;then
echo -e "\n \033[32m Successful installation , The address is:http://localhost:4999 (You can also use LAN or public IP / domain name access) \033[0m \n"
echo -e " \033[32m The account password is showdoc/123456 , After you log in, you can see the admin buttun at the top right.Suggested password modification after login \033[0m \n"
echo -e " \033[32m For questions or suggestions on showdoc, please go to https://github.com/star7th/showdoc \033[0m \n"
else
echo -e "\n \033[32m 安装成功,访问地址:http://localhost:4999 (你也可以用局域网或者公网IP/域名访问) \033[0m \n"
echo -e " \033[32m 账户密码是showdoc/123456,登录后你便可以看到右上方的管理后台入口。建议登录后修改密码。 \033[0m \n"
echo -e " \033[32m 对showdoc的问题或建议请至https://github.com/star7th/showdoc 提issue \033[0m \n"
echo -e " \033[32m 若觉得showdoc好用,不妨到github点个star。良好的关注度和参与度有助于开源项目的长远发展 \033[0m \n"
fi
fi
# Ubuntu-18 未成功
# CentOS-7.4
It was detected that Docker was not installed. Attempting to install from the network... The time required is related to your network environment.
检测到Docker尚未安装。正在试图从网络安装...所需时间与你的网络环境有关
# Executing docker install script, commit: f45d7c11389849ff46a6b4d94e0dd1ffebca32c1
+ sh -c 'yum install -y -q yum-utils'
软件包 yum-utils-1.1.31-52.el7.noarch 已安装并且是最新版本
+ sh -c 'yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo'
已加载插件:fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
+ '[' stable '!=' stable ']'
+ sh -c 'yum makecache'
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
epel | 5.4 kB 00:00:00
extras | 2.9 kB 00:00:00
gitlab-ce | 2.9 kB 00:00:00
gitlab_gitlab-ce/x86_64/signature | 836 B 00:00:00
gitlab_gitlab-ce/x86_64/signature | 1.0 kB 00:00:00 !!!
gitlab_gitlab-ce-source/signature | 836 B 00:00:00
gitlab_gitlab-ce-source/signature | 951 B 00:00:00 !!!
mysql-connectors-community | 2.5 kB 00:00:00
mysql-tools-community | 2.5 kB 00:00:00
mysql57-community | 2.5 kB 00:00:00
nginx-stable | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/11): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:00
(2/11): docker-ce-stable/x86_64/primary_db | 37 kB 00:00:00
(3/11): epel/x86_64/prestodelta | 2.6 kB 00:00:00
(4/11): epel/x86_64/other_db | 3.3 MB 00:00:00
(5/11): epel/x86_64/updateinfo_zck | 1.5 MB 00:00:00
(6/11): epel/x86_64/filelists_db | 12 MB 00:00:00
(7/11): updates/7/x86_64/filelists_db | 4.0 MB 00:00:00
(8/11): docker-ce-stable/x86_64/other_db | 111 kB 00:00:00
(9/11): updates/7/x86_64/other_db | 481 kB 00:00:00
(10/11): docker-ce-stable/x86_64/filelists_db | 18 kB 00:00:04
(11/11): gitlab-ce/7/filelists_db | 281 MB 00:00:26
元数据缓存已建立
+ '[' -n '' ']'
+ sh -c 'yum install -y -q docker-ce'
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/docker-ce-19.03.5-3.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
docker-ce-19.03.5-3.el7.x86_64.rpm 的公钥尚未安装
导入 GPG key 0x621E9F35:
用户ID : "Docker Release (CE rpm) "
指纹 : 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
来自 : https://download.docker.com/linux/centos/gpg
setsebool: SELinux is disabled.
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:
sudo usermod -aG docker your-user
Remember that you will have to log out and back in for this to take effect!
WARNING: Adding a user to the "docker" group will grant the ability to run
containers which can be used to obtain root privileges on the
docker host.
Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
for more information.
注意:正在将请求转发到“systemctl enable docker.service”。
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Redirecting to /bin/systemctl start docker.service
The showdoc image is being retrieved, please wait a moment... The time required is related to your network environment.
正在拉取showdoc镜像,请稍后...所需时间与你的网络环境有关
Using default tag: latest
latest: Pulling from star7th/showdoc
ff3a5c916c92: Pulling fs layer
2ca736d3a2d3: Pulling fs layer
ed01bffbd8ba: Pulling fs layer
86a241b7142f: Pulling fs layer
2ffa2200859b: Pulling fs layer
bba89656402e: Pulling fs layer
3f9869615113: Pulling fs layer
ca6f4c22bb7e: Pulling fs layer
c6e670a03139: Pulling fs layer
d68194d4a919: Pulling fs layer
3886fecfffe3: Pull complete
72d73c916ca2: Pull complete
66c290981af1: Pull complete
ae984e1cd476: Pull complete
4f5c98e97881: Pull complete
7a5c8005874f: Pull complete
d0e5afcf9ed6: Pull complete
a77fddbcccce: Pull complete
29fbff2beeff: Pull complete
6acbe516593c: Pull complete
b2e0f8f06f86: Pull complete
a3982ad6ae6d: Pull complete
53fe85e64f8b: Pull complete
401d987fb2cd: Pull complete
955b2c3c2280: Pull complete
b7957d06df75: Pull complete
fce749939a8f: Pull complete
747e227b8897: Pull complete
8eea7612ac50: Pull complete
fc16400d9d1c: Pull complete
3e0ee360fd75: Pull complete
825d163187d4: Pull complete
998e867b72f9: Pull complete
ee3cf456b599: Pull complete
575d41d3ddbb: Pull complete
36d46827cd08: Pull complete
283a81555d5d: Pull complete
a9f839ce9b50: Pull complete
Digest: sha256:7bed49190407043d99cce85e34c655fc3ca133d8f66dcdc40f75b30ba1528d47
Status: Downloaded newer image for registry.cn-shenzhen.aliyuncs.com/star7th/showdoc:latest
registry.cn-shenzhen.aliyuncs.com/star7th/showdoc:latest
2b072edda2bb1ef5fc3cd2d0709cfb2a0f2a232213b944f6e10a85bed2085bf1
install success !!!
--2020-02-08 22:13:54-- http://localhost:4999/install/install.lock
正在解析主机 localhost (localhost)... 127.0.0.1, ::1
正在连接 localhost (localhost)|127.0.0.1|:4999... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:23 [application/octet-stream]
正在保存至: “install.lock”
100%[===============================================>] 23 --.-K/s 用时 0s
2020-02-08 22:13:54 (1.80 MB/s) - 已保存 “install.lock” [23/23])
安装成功,访问地址:http://localhost:4999 (你也可以用局域网或者公网IP/域名访问)
账户密码是showdoc/123456,登录后你便可以看到右上方的管理后台入口。建议登录后修改密码。
对showdoc的问题或建议请至https://github.com/star7th/showdoc 提issue
若觉得showdoc好用,不妨到github点个star。良好的关注度和参与度有助于开源项目的长远发展
#下面附上脚本其他命令,以便管理 showdoc 时可以用得上。
#停止
./showdoc stop
#重启
./showdoc restart
#升级showdoc到最新版
./showdoc update
#卸载showdoc
./showdoc uninstall