diff --git a/.gitignore b/.gitignore index 5c1a30d..46419d7 100644 --- a/.gitignore +++ b/.gitignore @@ -111,4 +111,7 @@ nbproject/ docs/index.html -.DS_Store \ No newline at end of file +.DS_Store + +out.md +out.pdf \ No newline at end of file diff --git a/README.md b/README.md index 98a220b..f947099 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/combine.py b/combine.py new file mode 100644 index 0000000..ac831d9 --- /dev/null +++ b/combine.py @@ -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() \ No newline at end of file diff --git a/pdf.sh b/pdf.sh new file mode 100755 index 0000000..cb3ad5f --- /dev/null +++ b/pdf.sh @@ -0,0 +1,3 @@ +python combine.py + +pandoc out.md -o out.pdf \ No newline at end of file