korsimoro / pubtest

Testing GH Pages Publication
http://korsimoro.com/pubtest
2 stars 1 forks source link

move copy-md.sh into toolkit #2

Closed ewelton closed 5 years ago

ewelton commented 5 years ago

Currently

:docs$ cat mkdocs-src/copy-md.sh 
#!/bin/bash
RWOT=$1
DIR=$(dirname ../assets/repos/WebOfTrustInfo/$RWOT*/.)
SCOPE=topics-and-advance-readings
DOCDIR=$DIR/$SCOPE
TARGETDIR=docs/$RWOT/$SCOPE
pushd $DOCDIR > /dev/null
LIST=$(ls -1 *.md | sed -e s/.md$//g)
popd > /dev/null
mkdir -p $TARGETDIR
for paper in $LIST; do
    FPATH=$DOCDIR/$paper.md
    if [ -f "$FPATH" ]; then
        cp $FPATH $TARGETDIR/$paper.md
    fi
done

pushd $TARGETDIR > /dev/null
LIST=$(ls -1 *.md | sed -e s/.md$//g)
popd > /dev/null
for paper in $LIST; do
    echo "      - $(slugify $paper):'$RWOT/$SCOPE/$paper'"
done

is in the docs - it should be migrated to a rebaseable toolkit.