mirror of
https://github.com/funkypenguin/geek-cookbook/
synced 2025-12-13 01:36:23 +00:00
Experiment with PDF generation
Signed-off-by: David Young <davidy@funkypenguin.co.nz>
This commit is contained in:
@@ -11,12 +11,12 @@ python3 scripts/build.py mkdocs.yml
|
||||
if [ -z "$GH_TOKEN" ]
|
||||
then
|
||||
pip install mkdocs-material
|
||||
mkdocs build -f mkdocs.yml
|
||||
ENABLE_PDF_EXPORT=true mkdocs build -f mkdocs.yml
|
||||
else
|
||||
# Bypass search issue described at https://github.com/squidfunk/mkdocs-material/issues/3053
|
||||
git clone --depth 1 https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
|
||||
pip install -e mkdocs-material-insiders
|
||||
mkdocs build -f mkdocs-insiders.yml
|
||||
ENABLE_PDF_EXPORT=true mkdocs build -f mkdocs-insiders.yml
|
||||
fi
|
||||
|
||||
# Setup any necessary netlify redirects
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
for file in `find manuscript -type f -name "*.md"`
|
||||
do
|
||||
echo "Processing $file..."
|
||||
|
||||
# Markua doesn't know what to do with 4 backticks (````), so convert to 3:
|
||||
sed -i "s/\`\`\`\`/\`\`\`/g" $file
|
||||
|
||||
# Can't use relative paths in a book, so make all paths static
|
||||
sed -i 's/](\//\](https:\/\/geek-cookbook.funkypenguin.co.nz\//g' $file
|
||||
|
||||
# GitHub emojis look beautiful but don't render nicely
|
||||
sed -i 's/:[a-z\ ]://g' $file
|
||||
|
||||
# Animated gifs make leanpub fail, so strip 'em out by deleting the entire line
|
||||
sed -i '/.gif/d' $file
|
||||
|
||||
# Strip out mkdocs admonitions
|
||||
sed -i '/!!!/d' $file
|
||||
|
||||
# Change highlights to bold underlines
|
||||
sed -iE 's/==(.*)==/___\1___/' $file
|
||||
|
||||
# strip emojis
|
||||
tr -cd '\11\12\15\40-\176' < $file > $file-clean
|
||||
mv $file-clean $file
|
||||
done
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
setup_git() {
|
||||
git config --global user.email "travis@travis-ci.org"
|
||||
git config --global user.name "Travis CI"
|
||||
}
|
||||
|
||||
commit_website_files() {
|
||||
git checkout -b leanpub-preview
|
||||
git add manuscript
|
||||
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER"
|
||||
}
|
||||
|
||||
upload_files() {
|
||||
#git remote add origin-leanpub-preview https://${LEANPUB-PREVIEW-TOKEN}@github.com/funkypenguin/geek-cookbook.git > /dev/null 2>&1
|
||||
git remote add origin-leanpub-preview https://${TOKEN}@github.com/funkypenguin/geek-cookbook.git
|
||||
git pull origin-leanpub-preview leanpub-preview
|
||||
#git push --quiet --set-upstream origin-leanpub-preview leanpub-preview
|
||||
git push --quiet --set-upstream origin-leanpub-preview leanpub-preview
|
||||
}
|
||||
|
||||
# Not needed at this stage, since github integration still works. It's noted as being deprecated however,
|
||||
# so might need this in future
|
||||
#trigger_preview() {
|
||||
# curl -d "api_key=${LEANPUB-API-KEY}" https://leanpub.com/geek-cookbook/preview.json
|
||||
#}
|
||||
|
||||
setup_git
|
||||
commit_website_files
|
||||
upload_files
|
||||
#trigger_preview
|
||||
Reference in New Issue
Block a user