Comments (2)
使用pandoc将latex转换成了markdown。由于原latex源码中使用了很多自定义的命令,因而给转换带来了困难,需要做一些预处理。以下是预处理所需的命令:
# 将 !text! 转换为 \verb|text|
perl -pi -e 's/!(.*?)!/\\verb|$1|/g' *.tex
# 将 \nameref{cmd:xxx} 转换为 \href{/commands/xxx.md}
perl -pi -e 's/\\nameref\{cmd:(.*?)\}/\\href{\/commands\/$1.md}{$1}/g' *.tex
# 将其他的 nameref 等转换为纯文本,因为pandoc 无法处理交叉引用,所以需要手动处理
perl -pi -e 's/\\.*ref\{(.*?):(.*?)\}/nameref-$1-$2/g' *.tex
# 将 SACCode 转换为minted 环境
perl -pi -e 's/\\begin\{SACCode}/\\begin\{minted\}\{bash\}/g' *.tex
perl -pi -e 's/\\end\{SACCode\}/\\end\{minted\}/g' *.tex
# 将SACCMD 转换为 section
perl -pi -e 's/SACCMD/section/g' *.tex
# 将 SACTitle 转换为 subsection
perl -pi -e 's/SACTitle/subsection/g' *.tex
处理之后的latex源码使用如下命令进行转换:
pandoc -t markdown --base-header-level=2 --atx-headers xxxx.tex -o xxxx.md
from sac_docs_zh.
多人协作流程:
- 通过在某个任务之后 @ 自己以认领任务
- 仔细检查并修改文件
- commit 并 push
- 在任务前打钩,表示该任务已完成
若 push 时发现因为已经有人做了其他提交,导致自己的版本与远程的版本不同而出现如下无法提交的错误:
To [email protected]:seisman/SAC_Docs_zh.git
! [rejected] gitbook -> gitbook (fetch first)
error: failed to push some refs to '[email protected]:seisman/SAC_Docs_zh.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
可以使用如下方式解决此问题:
git fetch origin gitbook
git rebase origin/gitbook
git push
from sac_docs_zh.
Related Issues (20)
- 重新审核手册中的全部文件 HOT 3
- 下载数据的新功能需要至少添加新的一节 HOT 1
- Link Checker Report
- Link Checker Report
- Link Checker Report HOT 1
- Link Checker Report HOT 1
- Link Checker Report
- Link Checker Report
- Link Checker Report
- Link Checker Report
- Link Checker Report
- Link Checker Report
- Link Checker Report
- Link Checker Report
- 增加数据获取一节 HOT 4
- Link Checker Report
- Link Checker Report
- Link Checker Report
- Link Checker Report
- Link Checker Report
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sac_docs_zh.