Skip to content

Instantly share code, notes, and snippets.

@matteoforni
Forked from giuliobosco/markdown-hf-samt.txt
Last active February 6, 2019 10:09
Show Gist options
  • Save matteoforni/b880bb9a1e6ca189fe1558d84b88674f to your computer and use it in GitHub Desktop.
Save matteoforni/b880bb9a1e6ca189fe1558d84b88674f to your computer and use it in GitHub Desktop.
SAMT Header and Footer in markdown with atom.io package: markdown-themeable-pdf
Make SAMT (Scuola Arti e Mestieri Trevano) documentations using markdown and convert them to pdf.
Install the atom package markdown-themeable-pdf, then open the folder of the package:
~/.atom/markdown-themeable-pdf/ and copy inside your logo (must be a square logo).
Then open the file "header.js" in the markdown-themeable-pdf foler and set the "height" to "2cm" and the "contents" to:
<div style="margin:0;"><div style="float:left;border:1px solid black;padding:2px 2px 0 2px;height:35px;z-index:1;background-color:white;"><img src="samt.png" style="width:33px"></div><div style="float:right;border:1px solid black;padding:4px 4px 0 4px;height:33px;font-size:11px;text-align:center;z-index:1;background-color:white;color:black;">Pagina:<br>{{page}} / {{pages}}</div><div style="overflow:auto;border-top:1px solid black;border-bottom:1px solid black;padding:2px 4px 2px 0;height:33px;font-size:11px;"><div style="width:100%;text-align:center;"><span style="color:black;">SAMT - Sezione Informatica</span><br><div style="width:100%;border-top:1px solid black;margin-top:2px;padding:2px;color:black;">doc</div></div></div></div>
After the header set the footer, open the file "footer.js" in the markdown-themeable-pdf set the "height" to "1cm" and the "contents" to:
<div style="border-top:1px solid black;padding-top:2px;margin-top:0;"><div style="width:33%;float:left;text-align:left;color:black;">Giulio Bosco</div><div style="width:34%;float:left;text-align:center;color:black;">documentazione</div><div style="width:33%;float:left;text-align:right;color:black;">versione: 1.0</div></div>
Remember to modify your name, the version and the file name. Then save and close the file.
Is also suggested to change the color of the paragraph (tag p) to black, so insert in the file "style.css" in the markdown-themeable-pdf folder, the following string: ".p{color:black!important;}" and for all other just with "*{color:black;}".
An other suggestion is to resize the text size of the code, so add also the following string: "code{font-size:8px!important;}".
After this reload Atom, open your markdown file, and click the following key combination: shift+control+E this will export your .md file in a .pdf file.
Enjoy it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment