Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAC手册网页版任务列表 #102

Closed
seisman opened this issue Jul 23, 2016 · 2 comments
Closed

SAC手册网页版任务列表 #102

seisman opened this issue Jul 23, 2016 · 2 comments

Comments

@seisman
Copy link
Owner

seisman commented Jul 23, 2016

用pandoc将latex源码转换成了markdown源码,但还存在很多问题,因而需要人工一一检查并修正。

markdown源码位于 gitbook 分支,网页版地址为:https://seisman.github.io/SAC_Docs_zh/


以下是所有需要检查的markdown文件。请通过 @ 自己来认领某一任务,待文件检查完毕后记得来这里打钩。


自动转换得到的markdown源码已知会存在如下问题:

  1. 图片的路径不对,正确的使用方式是 ![图标题](/figures/xxxx.png)
  2. 大部分的表格转换都有问题,需要重新做
  3. markdown只支持有序列表和无序列表,不支持定义列表,因而所有定义列表都需要修改。在每个命令的语法说明中,介绍选项时都使用的是定义列表,因而选项要如何介绍还需要讨论
  4. 命令的语法介绍部分转换存在问题,需要手动修改
  5. 网页版的脚注感觉很丑,考虑是否要去掉所有的脚注
  6. 数学公式存在问题。gitbook 是支持数学公式的,目前尚不确定为何不支持
  7. C、Perl等代码没有被包含进去 (解决办法见 sacio/sacio-in-c.md)

文档风格:

  1. 从文件中插入代码: [include](filename.c)
  2. 插入图片: ![标题](/figures/filename.png)
  3. 插入数学公式:
    1. 行内公式: 文字 $$x^2+y^2=x^2$$ 文字

    2. 行间公式

      文字
      $$x^2+y^2=z^2$$
      文字
      
  4. 链接到某一章: [地震数据处理](/data-process) 会链接到地震数据处理一章
  5. 链接到某一节/某个文件:[write](/commands/write.md) 会直接链接到 write 命令
  6. SAC很多命令和选项都有简写形式,在原先的PDF中,是通过将某些字母变成灰色来表示简写形式。在markdown中不可能做到,因而需要用其他方式来表示简写形式。目前采取的方式是将命令的语法写两遍,第一遍写完整版,第二遍写简写版,可以参考 commands/taper.md 的写法
  7. SAC中在介绍选项时使用的是定义列表,即 description 环境,而markdown 不支持,故而只能将其转换为无序列表,可以参考 commands/taper.md 的写法

  • SUMMARY.md
  • README.md
  • contributor.md
  • frontmatterIII.md
  • version.md
  • ChangeLog.md @seisman



  • fileformat/README.md add readme @likueimo
  • fileformat/header-variables.md
  • fileformat/binary-and-alphanumeric.md
  • fileformat/header-structure.md
  • fileformat/intro-to-fileformat.md @likueimo
  • fileformat/sac-time.md

  • data-process/README.md add readme @likueimo
  • data-process/intro-to-process.md @likueimo
  • data-process/traveltime.md
  • data-process/cut-data.md
  • data-process/data-analysis.md
  • data-process/data-format.md
  • data-process/data-request.md
  • data-process/event-info.md
  • data-process/instrument-response.md
  • data-process/merge-traces.md
  • data-process/naming.md
  • data-process/quality-control.md
  • data-process/resampling.md
  • data-process/sort-traces.md
  • data-process/station-info.md
  • data-process/time-zone-correction.md
  • data-process/rglitches.md
  • data-process/rmean-rtrend-taper.md
  • data-process/rotate.md
  • data-process/filter.md
  • data-process/picking-phase.md

  • graphics/README.md add readme @likueimo
  • graphics/begin-devices.md
  • graphics/format-conversion.md
  • graphics/save-image.md
  • graphics/graphic-devices.md @seisman
  • graphics/composite-plots.md
  • graphics/plot-appearance.md
  • graphics/plot-commands.md
  • graphics/plot-contour.md

  • macros/README.md @seisman
  • macros/blackboard-variables.md
  • macros/inline-functions.md
  • macros/macros.md
  • macros/header-variables.md
  • macros/intro-to-sac-programming.md @seisman

  • call-in-script/README.md @seisman
  • call-in-script/call-sac-in-python.md @seisman
  • call-in-script/call-sac-in-bash.md @seisman
  • call-in-script/intro-to-scripts.md @seisman
  • call-in-script/call-sac-in-perl.md @seisman

  • libs/README.md added by @seisman
  • libs/call-libsacio.md
  • libs/intro-to-libs.md
  • libs/call-libsac.md



  • tricks-and-traps/README.md @seisman
  • tricks-and-traps/command-line-length.md @seisman
  • tricks-and-traps/max-allowed-files.md @seisman
  • tricks-and-traps/tab-and-space.md @seisman
  • tricks-and-traps/wh-wover.md @seisman
  • tricks-and-traps/debug.md @seisman
  • tricks-and-traps/init-macro.md @seisman
  • tricks-and-traps/running-speed.md @seisman
  • tricks-and-traps/undefined-header-variables.md @seisman
  • tricks-and-traps/endian.md @seisman
  • tricks-and-traps/read-dir.md @seisman


请参考 command/taper.md 的处理方式。

  • commands/about.md
  • commands/abs.md
  • commands/taper.md
  • commands/addf.md
  • commands/add.md
  • commands/apk.md
  • commands/arraymap.md
  • commands/axes.md
  • commands/bandpass.md
  • commands/bandrej.md
  • commands/bbfk.md
  • commands/beam.md
  • commands/begindevices.md
  • commands/beginframe.md
  • commands/beginwindow.md
  • commands/benioff.md
  • commands/binoperr.md
  • commands/border.md
  • commands/capf.md
  • commands/chnhdr.md
  • commands/chpf.md
  • commands/color.md
  • commands/comcor.md
  • commands/contour.md
  • commands/convert.md
  • commands/convolve.md
  • commands/copyhdr.md
  • commands/correlate.md
  • commands/cuterr.md
  • commands/cutim.md
  • commands/cut.md
  • commands/datagen.md
  • commands/decimate.md
  • commands/deletechannel.md
  • commands/dif.md
  • commands/divf.md
  • commands/div.md
  • commands/divomega.md
  • commands/echo.md
  • commands/enddevices.md
  • commands/endframe.md
  • commands/envelope.md
  • commands/erase.md
  • commands/evaluate.md
  • commands/exp10.md
  • commands/exp.md
  • commands/fft.md
  • commands/fileid.md
  • commands/filenumber.md
  • commands/filterdesign.md
  • commands/fir.md
  • commands/floor.md
  • commands/func_commands.md
  • commands/funcgen.md
  • commands/getbb.md
  • commands/grayscale.md
  • commands/grid.md
  • commands/gtext.md
  • commands/hanning.md
  • commands/help.md
  • commands/highpass.md
  • commands/hilbert.md
  • commands/history.md
  • commands/ifft.md
  • commands/image.md
  • commands/inicm.md
  • commands/installmacro.md
  • commands/interpolate.md
  • commands/int.md
  • commands/keepam.md
  • commands/khronhite.md
  • commands/linefit.md
  • commands/line.md
  • commands/linlin.md
  • commands/linlog.md
  • commands/listhdr.md
  • commands/loadctable.md
  • commands/load.md
  • commands/log10.md
  • commands/loglab.md
  • commands/loglin.md
  • commands/loglog.md
  • commands/log.md
  • commands/lowpass.md
  • commands/macro.md
  • commands/map.md
  • commands/markptp.md
  • commands/marktimes.md
  • commands/markvalue.md
  • commands/mathop.md
  • commands/merge.md
  • commands/message.md
  • commands/mtw.md
  • commands/mulf.md
  • commands/mul.md
  • commands/mulomega.md
  • commands/news.md
  • commands/null.md
  • commands/oapf.md
  • commands/ohpf.md
  • commands/pause.md
  • commands/pickphase.md
  • commands/pickprefs.md
  • commands/picks.md
  • commands/plabel.md
  • commands/plot1.md
  • commands/plot2.md
  • commands/plotalpha.md
  • commands/plotc.md
  • commands/plotdy.md
  • commands/plot.md
  • commands/plotpk.md
  • commands/plotpm.md
  • commands/plotsp.md
  • commands/plotxy.md
  • commands/printhelp.md
  • commands/print.md
  • commands/production.md
  • commands/qdp.md
  • commands/quantize.md
  • commands/quit.md
  • commands/quitsub.md
  • commands/readbbf.md
  • commands/readcss.md
  • commands/readerr.md
  • commands/readhdr.md
  • commands/readsp.md
  • commands/readtable.md
  • commands/report.md
  • commands/reverse.md
  • commands/rglitches.md
  • commands/rmean.md
  • commands/rms.md
  • commands/rotate.md
  • commands/rq.md
  • commands/rtrend.md
  • commands/saveimg.md
  • commands/setbb.md
  • commands/setdevice.md
  • commands/setmacro.md
  • commands/sgf.md
  • commands/smooth.md
  • commands/sonogram.md
  • commands/sort.md
  • commands/spectrogram.md
  • commands/sqr.md
  • commands/sqrt.md
  • commands/stretch.md
  • commands/subf.md
  • commands/sub.md
  • commands/symbol.md
  • commands/synchronize.md
  • commands/systemcommand.md
  • commands/ticks.md
  • commands/title.md
  • commands/trace.md
  • commands/transcript.md
  • commands/transfer.md
  • commands/traveltime.md
  • commands/tsize.md
  • commands/unsetbb.md
  • commands/unwrap.md
  • commands/vspace.md
  • commands/wait.md
  • commands/whiten.md
  • commands/whpf.md
  • commands/width.md
  • commands/wiener.md
  • commands/wild.md
  • commands/window.md
  • commands/writebbf.md
  • commands/writecss.md
  • commands/writehdr.md
  • commands/write.md
  • commands/writesp.md
  • commands/xdiv.md
  • commands/xfudge.md
  • commands/xfull.md
  • commands/xgrid.md
  • commands/xlabel.md
  • commands/xlim.md
  • commands/xlin.md
  • commands/xlog.md
  • commands/xvport.md
  • commands/ydiv.md
  • commands/yfudge.md
  • commands/yfull.md
  • commands/ygrid.md
  • commands/ylabel.md
  • commands/ylim.md
  • commands/ylin.md
  • commands/ylog.md
  • commands/yvport.md
  • commands/zcolors.md
  • commands/zlabels.md
  • commands/zlevels.md
  • commands/zlines.md
  • commands/zticks.md

  • spe/plotspe.md
  • spe/spe.md
  • spe/writecor.md
  • spe/cor.md
  • spe/mem.md
  • spe/mlm.md
  • spe/pds.md
  • spe/plotcor.md
  • spe/plotpe.md
  • spe/readcor.md
  • spe/writespe.md

  • sss/deletestack.md
  • sss/distanceaxis.md
  • sss/globalstack.md
  • sss/plotrecordsection.md
  • sss/sumstack.md
  • sss/timewindow.md
  • sss/velocityroset.md
  • sss/zerostack.md
  • sss/addstack.md
  • sss/deltacheck.md
  • sss/distancewindow.md
  • sss/incrementstack.md
  • sss/plotstack.md
  • sss/sss.md
  • sss/timeaxis.md
  • sss/velocitymodel.md
  • sss/writestack.md
  • sss/changestack.md
  • sss/liststack.md
  • sss/traveltime.md
@seisman
Copy link
Owner Author

seisman commented Jul 23, 2016

使用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

@seisman
Copy link
Owner Author

seisman commented Jul 23, 2016

多人协作流程:

  1. 通过在某个任务之后 @ 自己以认领任务
  2. 仔细检查并修改文件
  3. commit 并 push
  4. 在任务前打钩,表示该任务已完成

若 push 时发现因为已经有人做了其他提交,导致自己的版本与远程的版本不同而出现如下无法提交的错误:

To git@github.com:seisman/SAC_Docs_zh.git
 ! [rejected]        gitbook -> gitbook (fetch first)
error: failed to push some refs to 'git@github.com: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

@seisman seisman closed this as completed Jul 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant