diff --git a/.gitignore b/.gitignore index 5df36ec..078b4dd 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ colonnade/ex1.hs colonnade/result reflex-dom-colonnade/result +siphon-0.8.0-docs.tar.gz +siphon-0.8.0-docs/ diff --git a/siphon/src/Siphon.hs b/siphon/src/Siphon.hs index 1b54685..716ceb6 100644 --- a/siphon/src/Siphon.hs +++ b/siphon/src/Siphon.hs @@ -319,11 +319,12 @@ textEscapeAlways t = Escaped $ LT.toStrict $ TB.toLazyText $ t <> TB.singleton '"' --- | Parse a record, not including the terminating line separator. The +-- Parse a record, not including the terminating line separator. The -- terminating line separate is not included as the last record in a -- CSV file is allowed to not have a terminating line separator. You -- most likely want to use the 'endOfLine' parser in combination with -- this parser. +-- -- row :: Word8 -- ^ Field delimiter -- -> AL.Parser (Vector ByteString) -- row !delim = rowNoNewline delim <* endOfLine @@ -337,6 +338,7 @@ textEscapeAlways t = Escaped $ LT.toStrict $ TB.toLazyText $ -- removeBlankLines :: [Vector ByteString] -> [Vector ByteString] -- removeBlankLines = filter (not . blankLine) + -- | Parse a field. The field may be in either the escaped or -- non-escaped format. The return value is unescaped. This -- parser will consume the comma that comes after a field diff --git a/stack-haddock-upload b/stack-haddock-upload new file mode 100755 index 0000000..1fdc5ae --- /dev/null +++ b/stack-haddock-upload @@ -0,0 +1,26 @@ +#!/bin/bash + +# Author: Dimitri Sabadie +# 2015 + +dist=`stack path --dist-dir --stack-yaml ./stack.yaml 2> /dev/null` + +echo -e "\033[1;36mGenerating documentation...\033[0m" +stack haddock 2> /dev/null + +if [ "$?" -eq "0" ]; then + docdir=$dist/doc/html + cd $docdir + doc=$1-$2-docs + echo -e "Compressing documentation from \033[1;34m$docdir\033[0m for \033[1;35m$1\033[0m-\033[1;33m$2\033[1;30m" + cp -r $1 $doc + tar -c -v -z --format=ustar -f $doc.tar.gz $doc + echo -e "\033[1;32mUploading to Hackage...\033[0m" + read -p "Hackage username: " username + read -p "Hackage password: " -s password + echo "" + curl -X PUT -H 'Content-Type: application/x-tar' -H 'Content-Encoding: gzip' --data-binary "@$doc.tar.gz" "https://$username:$password@hackage.haskell.org/package/$1-$2/docs" + exit $? +else + echo -e "\033[1;31mNot in a stack-powered project\033[0m" +fi