Skip to content

Commit

Permalink
inital PDF genertation
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Griffin <griffin.kev@gmail.com>
  • Loading branch information
m00sey committed Jan 26, 2024
1 parent 724c486 commit c6298b9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,7 @@ nbproject/

docs/index.html

.DS_Store
.DS_Store

out.md
out.pdf
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ Run `npm run edit` to watch for changes and re-render the HTML.

Be sure to remove references to `specification-template` in favor of your new specification!

### Experimental PDF generation

To output a PDF (on macOS, requires Python)

`# brew install pandoc`
`# brew install librsvg homebrew/cask/basictex`

`# python combine.py`
`# chmod +x pdf.sh`
`# ./pdf.sh`

#### Contributing

All Trust Over IP Foundation Technical Stack Working Group contributions are done so under the following licenses:
Expand Down
18 changes: 18 additions & 0 deletions combine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import json

f = open('specs.json')
data = json.load(f)

files = []
for i in data['specs'][0]['markdown_paths']:
files.append(i)

with open('out.md', 'w') as out:
for f in files:
with open(f"spec/{f}") as i:
for l in i:
out.write(l)

out.write("\n\n")

out.close()
3 changes: 3 additions & 0 deletions pdf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python combine.py

pandoc out.md -o out.pdf

0 comments on commit c6298b9

Please sign in to comment.