Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding pdf/epub/mobi generation from the markdown files using pandoc #67

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8c60b59
Initial release
holgern Dec 10, 2020
7c424a6
Improved formatting
holgern Dec 11, 2020
4205d15
Add create_pdf.sh
holgern Dec 19, 2020
b2acae3
Merge branch 'master' of https://github.com/btcguide/btcguide.github.…
holgern Jan 4, 2021
bdb3e22
Merge branch 'btcguide-master' into btcguide-pandoc
holgern Jan 4, 2021
91d983e
Merge upstream changes
holgern Jan 4, 2021
40bc961
Improved structure and bug fixes
holgern Jan 4, 2021
b170e34
Use lua filter to correct image links
holgern Jan 4, 2021
e844f6b
Use lua filters and change source files as little as possible
holgern Jan 8, 2021
2ac3dbb
Merge pull request #3 from btcguide/master
holgern Jan 8, 2021
d303583
Add gitlab ci to create pdf file automatically
holgern Jan 11, 2021
7a89865
Create main.yml
holgern Jan 11, 2021
2954334
Delete .gitlab-ci.yml
holgern Jan 11, 2021
7fce203
Merge branch 'btcguide-pandoc' of https://github.com/holgern/btcguide…
holgern Jan 11, 2021
dcfeffc
Rename github action and add epub creation
holgern Jan 11, 2021
76697f7
Change action name
holgern Jan 11, 2021
a57bf57
Add create release to ci
holgern Jan 11, 2021
42354f5
fix typo
holgern Jan 11, 2021
673702f
Change github token name
holgern Jan 11, 2021
6b5235a
Update pandoc.yml
holgern Jan 11, 2021
55896bf
Use date as release name
holgern Jan 11, 2021
495c648
Add tag name
holgern Jan 11, 2021
49f65da
Create tag and push release
holgern Jan 11, 2021
d340e92
Change list
holgern Jan 11, 2021
a64fc15
Update tag
holgern Jan 11, 2021
30ac0a8
Fix tag name
holgern Jan 11, 2021
43861e8
Merge branch 'master' of https://github.com/btcguide/btcguide.github.…
holgern Jan 13, 2021
67fdff3
Fix internal links in pandoc
holgern Jan 13, 2021
1f9cab6
Add mobi file
holgern Jan 13, 2021
b7a08e0
Update pandoc.yml
holgern Jan 13, 2021
2296832
Fix pandoc creation and remove btcguide docs from repo
holgern Jan 13, 2021
a49179d
fix typo
holgern Jan 13, 2021
6eb475e
Try to improve mobi outpout
holgern Jan 13, 2021
f2de589
Fix command and improve readme
holgern Jan 13, 2021
06afe1e
Fix spellchecker and improve readme
holgern Jan 13, 2021
dcc2ba4
Rename index.md to index_pandoc.md and fix spellcheck
holgern Jan 13, 2021
af75506
Merge pull request #10 from btcguide/master
holgern Jan 14, 2021
0197830
Fix header generation with correct hyperrefs and resolve duplicate hy…
holgern Jan 14, 2021
95dbdf1
Move template folder into assets
holgern Jan 14, 2021
af9552a
Merge pull request #11 from btcguide/master
holgern Jan 18, 2021
ebc42ae
Merge pull request #13 from btcguide/master
holgern Mar 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/pandoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Pandoc Action
on: [push,pull_request,workflow_dispatch]

jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Pandoc Document Converter pdf
uses: Ender-events/pandoc@master
with:
args: '--pdf-engine=xelatex --template=assets/templates/eisvogel.latex --highlight-style zenburn --toc -N --lua-filter _pandoc_filter/image_link.lua --lua-filter _pandoc_filter/add_title.lua -o assets/btcguide.pdf index_pandoc.md'
- name: Pandoc Document Converter epub
uses: Ender-events/pandoc@master
with:
args: '--css assets/templates/epub.css --toc -N --lua-filter _pandoc_filter/image_link.lua --lua-filter _pandoc_filter/add_title.lua -o assets/btcguide.epub index_pandoc.md'
- name: Install calibre
run: sudo apt-get update && sudo apt-get install calibre
- name: Convert epub to mobi
run: ebook-convert "assets/btcguide.epub" "assets/btcguide.mobi" --mobi-file-type new --pretty-print --mobi-keep-original-images
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H-%M')"
- name: Create tag
uses: actions/github-script@v3
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.date.outputs.date }}",
sha: context.sha
})
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.date.outputs.date }}
release_name: Release ${{ steps.date.outputs.date }}
draft: false
prerelease: false
- name: Upload Release Asset pdf
id: upload-release-asset-pdf
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./assets/btcguide.pdf
asset_name: btcguide.pdf
asset_content_type: application/pdf
- name: Upload Release Asset epub
id: upload-release-asset-epub
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./assets/btcguide.epub
asset_name: btcguide.epub
asset_content_type: application/epub
- name: Upload Release Asset mobi
id: upload-release-asset-mobi
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./assets/btcguide.mobi
asset_name: btcguide.mobi
asset_content_type: application/mobi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ dictionary.dic
Gemfile.lock
.DS_Store
*.swp
tex2pdf*/*
assets/btcguide.*
12 changes: 12 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ GBP
Guillemet
HODLer
HODLers
Holger
HW
HWI
HWIBridge
Expand All @@ -58,6 +59,7 @@ Multisig
Multisignature
MyNode
myNode
Nahrstaedt
NDA
Nodl
Novak
Expand Down Expand Up @@ -111,6 +113,7 @@ barcode
bb
bip
bips
bitbox
bitcoincore
bitcoiners
bitcoinonly
Expand All @@ -133,6 +136,7 @@ coldcard
coldcard's
coldcardwallet
colo
colorlinks
conf
config
configurability
Expand All @@ -146,13 +150,15 @@ disablewallet
diy
dmg
dropdown
ebook
electrum
elsif
endcomment
endfor
endif
endunless
english
epub
exe
explainer
faf
Expand Down Expand Up @@ -183,18 +189,21 @@ js
json
keepkey
keyspace
lang
li
localhost
lt
macOS
mainnet
markdownskip
md
meatspace
merkle
mflaxman
microSD
mins
mitigations
mobi
multicoin
multisig
multisig's
Expand All @@ -203,6 +212,7 @@ nd
notecards
ol
onsetup
pandoc
pdf
pendrive
php
Expand Down Expand Up @@ -246,6 +256,7 @@ stackoverflow
stateful
testnet
th
titlepage
tpub
tradeoff
tradeoffs
Expand All @@ -257,6 +268,7 @@ udev
ul
unencrypted
url
urlcolor
usb
useability
utxo
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,23 @@ Spelling check passed :)
Notes:
* See `.wordlist.txt` for all the exception words.
* `$ brew install aspell && pip install pyspelling` are needed.


## Create pdf/epub/mobi
1. Install [latex](https://www.latex-project.org/get/)
1. Install [pandoc](https://pandoc.org/installing.html)


1. Build the documents with

```
create_pdf.bat
create_ebook.bat
```
or
```
create_pdf.sh
create_ebook.sh
```
1. The mobi file can be created from the epub file using [kindle previewer](https://www.amazon.com/gp/feature.html?ie=UTF8&docId=1003018611)

Loading