<commit_before>#!/bin/bash

### default options
MACHINE=all
DOCTYPE=html
HELP=0
TOOLDIR=$(cd $(dirname $0) && pwd -P)
TOPDIR=$(cd $TOOLDIR/.. && pwd -P)
DOCDIR=$TOPDIR/docs/getting-started
EXPORTDIR=$TOPDIR/export

function exportdoc {
        FILEDOC="$DOCDIR/machines/$1.md"
        if [ ! -e $FILEDOC ] ; then
                echo "Document for $1 not found."
                exit 1
        fi
        FILETROUBLE="$DOCDIR/footers/$1-footer.md"
        if [ ! -e $FILETROUBLE ] ; then
                FILETROUBLE=""
        fi
        FILEEXPORT="$EXPORTDIR/$DOCTYPE/$1.$DOCTYPE"
		mkdir -p $(dirname $FILEEXPORT)
        pandoc $DOCDIR/source-code.md $FILEDOC $DOCDIR/troubleshooting.md $FILETROUBLE $FILECONFIG -o $FILEEXPORT
        echo "Document exported to $FILEEXPORT"
}

while [[ $# -gt 0 ]]
do
	case $1 in
		-m|--machine)  MACHINE=$2; shift;;
		-d|--document) DOCTYPE=$2; shift;;
		-h|--help)     HELP=1;;
		*) ;;
	esac
	shift
done

if [[ 1 == $HELP ]] ; then
	printf "Usage: . $(basename $0) [options]\n"
	printf "Options:\n"
	printf "\t-m|--machine <machine>\n\t\twhat machine to use\n\t\tdefault: 'all'\n"
	printf "\t-d|--document <pdf|html|dokuwiki>\n\t\twhat document format to use\n\t\tdefault: 'html'\n"<commit_msg>check pandoc installation<commit_after>#!/bin/bash

### default options
MACHINE=all
DOCTYPE=html
HELP=0
TOOLDIR=$(cd $(dirname $0) && pwd -P)
TOPDIR=$(cd $TOOLDIR/.. && pwd -P)
DOCDIR=$TOPDIR/docs/getting-started
EXPORTDIR=$TOPDIR/export

function exportdoc {
        FILEDOC="$DOCDIR/machines/$1.md"
        if [ ! -e $FILEDOC ] ; then
                echo "Document for $1 not found."
                exit 1
        fi
        FILETROUBLE="$DOCDIR/footers/$1-footer.md"
        if [ ! -e $FILETROUBLE ] ; then
                FILETROUBLE=""
        fi
        FILEEXPORT="$EXPORTDIR/$DOCTYPE/$1.$DOCTYPE"
        mkdir -p $(dirname $FILEEXPORT)
        if  which pandoc 1>/dev/null 2>/dev/null; 
        then
            pandoc $DOCDIR/source-code.md $FILEDOC $DOCDIR/troubleshooting.md $FILETROUBLE $FILECONFIG -o $FILEEXPORT;
            echo "Document exported to $FILEEXPORT";
        else
            echo -e "Command \"pandoc\" not found!\n"
            exit 1
        fi
}

while [[ $# -gt 0 ]]
do
	case $1 in
		-m|--machine)  MACHINE=$2; shift;;
		-d|--document) DOCTYPE=$2; shift;;
		-h|--help)     HELP=1;;
		*) ;;
	esac
	shift
done

if [[ 1 == $HELP ]] ; then
	printf "Usage: . $(basename $0) [options]\n"
	printf "Options:\n"
	printf "\t-m|--machine <machine>\n\t\twhat machine to use\n\t\tdefault: 'all'\n"
	printf "\t-d|--document <pdf|html|dokuwiki>\n\t\twhat document format to use\n\t\tdefault: 'html'\n"
{'fraction_non_alphanumeric': 0.16785848701543093, 'fraction_numerical': 0.011667293940534437, 'mean_word_length': 2.4474708171206228, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '804199', 'n_tokens_mistral': 1052, 'n_tokens_neox': 958, 'n_words': 221}