-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildDoc.md
executable file
·74 lines (53 loc) · 3.54 KB
/
buildDoc.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
shopt -s expand_aliases
alias ~~~=":<<'~~~bash'"
:<<'~~~bash'
# Usage
```bash
./buildDoc.md
```
# Introduction
Generate the `github pages` documentation for this project. The documentation for `core/Rearrangement` is generated by `doxygen`. `bash` shells are transformed to executable `markdown` by the track at [here](https://gist.github.com/bwoods/1c25cb7723a06a076c2152a2781d4d49). `awk` and `perl` scripts are wrapped by the corresponding code block in `markdown`.
# Source
~~~bash
add_header()
{
title=$1
permalink=$2
sed "1i ---\ntitle: \"$title\"\npermalink: $permalink\ntoc: true\n---\n"
}
wrap_script()
{
script_type=$1
sed -e "1i ~~~$script_type" -e '$a~~~'
}
# Failure stop the execution.
set -e
add_header "Quick start" "/quick-start/" < README.md > docs/_docs/README.md
add_header "Remove duplicates" "/core/remove-duplicates/" < core/removeDuplicates.md > docs/_docs/removeDuplicates.md
add_header "Demultiplex" "/core/demultiplex/" < core/demultiplex/demultiplex.md > docs/_docs/demultiplex.md
wrap_script awk < core/demultiplex/getAlignPos.awk | add_header "Get alignment position" "/core/demultiplex/get-alignment-position/" > docs/_docs/getAlignPos.awk.md
add_header "Chimeric alignment" "/core/rearr/" < core/Rearrangement/rearr.md > docs/_docs/rearr.md
wrap_script awk < core/Rearrangement/correct_micro_homology.awk | add_header "Correct micro-homology" "/core/rearr/correct-micro-homology/" > docs/_docs/correct_micro_homology.awk.md
mkdir -p docs/core/rearr
cd core/Rearrangement
doxygen
cd -
add_header "Shi Xing extract spliter" "/sx/sx-extract-spliter/" < sx/sxExtractSpliter.md > docs/_docs/sxExtractSpliter.md
add_header "Shi Xing post-process from demultiplex to rearr" "/sx/sx-cut-r2-adapter-filter-cumulate/" < sx/sxCutR2AdapterFilterCumulate/sxCutR2AdapterFilterCumulate.md > docs/_docs/sxCutR2AdapterFilterCumulate.md
wrap_script awk < sx/sxCutR2AdapterFilterCumulate/sxCumulateToMapCutAdaptSpliter.awk | add_header "Accumulate adjacent duplicated queries" "/sx/sx-cut-r2-adapter-filter-cumulate/sx-cumulate-to-map-cut-adapt-spliter/" > docs/_docs/sxCumulateToMapCutAdaptSpliter.awk.md
add_header "Get Shi Xing csvfile reference" "/sx/get-sx-csvfile-ref/" < sx/getSxCsvFileRef/getSxCsvFileRef.md > docs/_docs/getSxCsvFileRef.md
wrap_script perl < sx/getSxCsvFileRef/getSxCsvFileTarget.pl | add_header "Get Shi Xing csvfile target" "/sx/get-sx-csvfile-ref/get-sx-csvfile-target/" > docs/_docs/getSxCsvFileTarget.pl.md
wrap_script awk < sx/getSxCsvFileRef/sxTargetSam2Bed.awk | add_header "Shi Xing target sam to bed" "/sx/get-sx-csvfile-ref/sx-target-sam-2-bed/" > docs/_docs/sxTargetSam2Bed.awk.md
wrap_script perl < sx/getSxCsvFileRef/getSxRefFile.pl | add_header "Get Shi Xing reference file" "/sx/get-sx-csvfile-ref/get-sx-ref-file/" > docs/_docs/getSxRefFile.pl.md
add_header "Build documentation" "/others/build-doc/" < buildDoc.md > docs/_docs/buildDoc.md
add_header "Compose script" "/others/compose/" < compose.md > docs/_docs/compose.md
wrap_script yaml < compose.yaml | add_header "Compose yaml" "/others/compose/yaml" > docs/_docs/compose.yaml.md
add_header "Install" "/others/install/" < install.md > docs/_docs/install.md
add_header "Login worker" "/other/login-worker/" < loginWorker.md > docs/_docs/loginWorker.md
add_header "Run work flow" "/other/run-work-flow/" < runWorkFlow.md > docs/_docs/runWorkFlow.md
wrap_script makefile < workFlow.mak | add_header "Work flow" "/other/run-work-flow/work-flow/" > docs/_docs/workFlow.mak.md
~~~
~~~bash
alias ~~~=":" # This suppresses a warning and is not part of source.
~~~