Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F4820521
doctl
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Aug 24, 7:54 AM
Size
1 KB
Mime Type
text/x-shellscript
Expires
Wed, Aug 26, 7:54 AM (1 d, 16 h)
Engine
blob
Format
Raw Data
Handle
285760
Attached To
rXR Xreate
doctl
View Options
#!/bin/bash
PANDOC=/opt/pandoc/dist-newstyle/build/x86_64-linux/ghc-8.6.4/pandoc-2.7.1/x/pandoc/build/pandoc/pandoc
REMOTE='xreate@xreate.bigserver'
DOC_CONTENT=(
'documentation/Transcend/transcend.xml'
'documentation/Transcend/ast-api.xml'
'documentation/Transcend/latetranscend.xml'
'documentation/Transcend/modules-api.xml'
'documentation/Transcend/latex-api.xml'
'documentation/Concepts/interpretation.xml'
'documentation/Concepts/containers.xml'
'documentation/Concepts/polymorphism.xml'
'documentation/Concepts/context.xml'
'documentation/Syntax/syntax.xml'
'documentation/Syntax/modules.xml'
'documentation/virtualization.xml'
'documentation/exploitation.xml'
'documentation/communication.xml'
'documentation/index.xml'
)
PWD=`pwd`
Filename=`realpath $0`
upload () {
convert_all /tmp/docs2
rsync -e 'ssh -p24' -rtvz $Filename $REMOTE:/opt/doctl
rsync -e 'ssh -p24' -rtvz /tmp/docs2/ $REMOTE:/opt/documentation/
rsync -e 'ssh -p24' -rtvz $PWD/documentation/manual.json $REMOTE:/opt/documentation/
}
convert (){
SOURCE_FILE=$1
DEST_FOLDER=$2
Name=$(basename $SOURCE_FILE)
sed -e '/<?xxe-revisions/, /?>/ d' -e 's/<?xxe[^?]*?>//g' $SOURCE_FILE | \
$PANDOC \
-f docbook \
-t $PWD/documentation-tools/doc-converter/remarkup.lua \
-o $DEST_FOLDER/$Name.remarkup
}
convert_all (){
DEST_FOLDER=$1
mkdir -p $DEST_FOLDER
for Chapter in ${DOC_CONTENT[@]}; do
convert $PWD/$Chapter $DEST_FOLDER
done
}
case $1 in
convert)
convert $2 $3
;;
convert-all)
convert_all $2
;;
upload)
upload $2
;;
*) echo "usage: $0 convert <SOURCE-FILE> <DEST-FOLDER> | convert-all <DEST-FOLDER> | upload";;
esac
Event Timeline
Log In to Comment