2022-03-28 12:12:27 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Run this from root of repo - graphql-engine-mono
|
2022-04-13 15:00:46 +03:00
|
|
|
# ./docs/scripts/pandoc-auto-transform.sh "docs/docs"
|
2022-03-28 12:12:27 +03:00
|
|
|
|
|
|
|
# Make sure globstar is enabled
|
|
|
|
# shopt -s globstar
|
|
|
|
# cd docs
|
|
|
|
# for f in **/*.rst; do # Whitespace-safe and recursive
|
|
|
|
# # echo "../$1/${f%.*}"
|
|
|
|
# mkdir -pv -- "../$1/${f%/*}" && touch -- "../$1/${f%}.txt";
|
|
|
|
# pandoc "$f" -f rst -t gfm -s -o "../$1/${f%}.txt";
|
|
|
|
# done
|
|
|
|
# cd ..
|
|
|
|
|
|
|
|
|
|
|
|
# wc -l graphql/**/* > files.txt
|
|
|
|
# tree -f
|
|
|
|
|
|
|
|
# run on only one file
|
2022-04-13 15:00:46 +03:00
|
|
|
# ./docs/scripts/pandoc-auto-transform.sh "graphql/core/actions/create.rst"
|
2022-04-18 17:55:14 +03:00
|
|
|
# pandoc "docs-old/$1" -f rst -t gfm -s -o "docs/docs/${1%}.txt";
|
2022-03-28 12:12:27 +03:00
|
|
|
|
|
|
|
# run on list of files
|
|
|
|
# Ref: https://stackoverflow.com/a/424142/10208226 to get list of changed files in a commit
|
|
|
|
# git diff-tree --no-commit-id --name-only -r 90c8f75
|
2022-04-13 15:00:46 +03:00
|
|
|
# ./docs/scripts/pandoc-auto-transform.sh
|
2022-03-28 12:12:27 +03:00
|
|
|
# files=( "graphql/core/databases/ms-sql-server/index.rst" "graphql/core/databases/ms-sql-server/mutations/index.rst" "graphql/core/databases/ms-sql-server/mutations/insert.rst" "graphql/core/databases/ms-sql-server/mutations/upsert.rst" "graphql/core/databases/postgres/mutations/upsert.rst" )
|
|
|
|
# for f in "${files[@]}"; do
|
2022-04-13 15:00:46 +03:00
|
|
|
# mkdir -pv -- "docs/${f%/*}" && touch -- "docs/docs/${f%}.txt";
|
2022-04-18 17:55:14 +03:00
|
|
|
# pandoc "docs-old/$f" -f rst -t gfm -s -o "docs/docs/${f%}.txt";
|
2022-03-28 12:12:27 +03:00
|
|
|
# done
|
|
|
|
|
|
|
|
# mkdir -pv -- "$1/${f%/*}" && touch -- "$1/${f%}.txt";
|
|
|
|
# pandoc "$f" -f rst -t gfm -s -o "$1/${f%}.txt";
|