常用命令

清缓存

git rm --cached “UserInterfaceState.xcuserstate”的路径
git commit -m ""

打印出一个文件的全路径

mdfind -name 'flutter'

删除该目录下的.git

find . -name ".git" | xargs rm -Rf

查看指令集细节

需要cd到具体的framework,然后info后面的库名不要加后缀
cd /Users/xxx/Desktop/xxxxxx.framework
lipo -info xxxxxx

真机调试包路径

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

gitbook

1.node.js 官网: https://nodejs.org/en/
node -v
2.sudo npm install gitbook-cli -g
gitbook -V
3.cd desktop
mkdir mybook
cd mybook
gitbook init 

mybook % gitbook init
warn: no summary file in this book
info: create README.md
info: create SUMMARY.md
info: initialization is finished

README.md是说明文档
SUMMARY.md是章节目录

预览
gitbook serve
http://localhost:4000

会生成_book文件 里面是html文件

生成网页不开启服务器:gitbook build

可以反复使用gitbook init来根据SUMMARY.md来初始化文件

若生成的index.html文件无法进行页面内跳转则

gitbook build --gitbook=2.6.7
Error loading version latest: Error: Cannot find module 'internal/util/types'

临时更换版本
sudo npm install -g n (sudo npm install n -g) 安装node版本管理工具'n';
sudo n 6 切换到6的node版本(安装稳定版sudo n stable)
sudo npm install npm -g

gitbook build --gitbook=2.6.7 编译

book.json配置文件参考:
<a href="https://www.cnblogs.com/mingyue5826/p/10307051.html#12-%E6%8F%92%E4%BB%B6%E5%88%97%E8%A1%A8-plugins" target="_blank">Markdown的超链接由新窗口打开</a>
切回版本(sudo n x.x.x )
node -v 查看当前版本
n list列出历史版本
sudo n x.x.x切回版本
sudo npm install npm -g

安装最新版本 n stable
markdown表格生成 https://tool.lu/tables 

pkg安装包安装的node,node的卸载方式:sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}

注意 安装homebrew 命令是"" 不是“”
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安装homebrew遇到的问题

注意 安装homebrew 命令是"" 不是“”
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
感谢https://blog.csdn.net/txl910514/article/details/105880125

SSH

ls -al ~/.ssh 检查是否有SSH Key
idrsa.pub等文件表示有了
输入命令拷贝到粘贴板:pbcopy < ~/.ssh/id_rsa.pub 

vim ~/.bash_profile
环境变量配置好后,退出终端,环境变量则失效,(例如Flutter ,node命令都失效了)需要每次都先执行source ~/.bash_profile,很麻烦

vim ~/.zshrc
按i进入编辑模式

添加 source ~/.bash_profile

退出
Esc :wq

生成PDF

https://calibre-ebook.com/download
安装文件夹书籍目录指定为你的gitbook项目即可
sudo ln -s /Applications/calibre.app/Contents/MacOS/ebook-convert /usr/local/bin
gitbook pdf . xx.pdf

gitbook本页跳转

要跳转到的地方设置锚点
<span id="jump">跳转到的地方</span>
然后,
[点击跳转](#jump)

gitbook跳转到其他页

相对路径
[点击跳转](./cancel.html)

posted @ 2020-06-29 10:46  yxg889  阅读(123)  评论(0编辑  收藏  举报