YAML front matter in Typora
I was looking for ways to add a cover page, header, and footer in Markdown and just figured out how we do it in Typora Markdown editor. It is easy. Set the header and footer using YAML Front Matter.
The YAML front matter must be the first thing in the file and must be valid YAML, set between triple-dashed lines.
Source: https://support.typora.io/
The following is an example for setting the document title, header, and footer using YAML:
---
title: Agile Technical Documentation
header: A Quick Guide for Agile Technical Documentation
footer: ${pageNo}
---
Apart from this, you need to make a few PDF export settings.
Select File > Preferences > Export > PDF and select the checkbox for Read and overwrite export settings from YAMAL front matters.
Now, the document exported into PDF will have A Quick Guide for Agile Technical Documentation in its header and page number in its footer.
If you need a cover page as well for the PDF export, paste the following content in the Append Extra Content (HTML) field:
<meta name="title" content="${title}"> <div id='_export_cover' style="height:100vh;"> <div id='_export_title' style="margin-top: 25%;text-align: center;font-size: 3rem;"> </div> </div> <script> var $cover = document.querySelector("#_export_cover"); var title = document.querySelector("meta[name='title']").getAttribute("content"); if(!title || title == "${title}") { // no title $cover.remove(); } else { document.body.insertBefore($cover, document.body.childNodes[0]) $cover.querySelector("#_export_title").textContent = title; } </script>
- Insert images in Typora
- Use markdown for your README
- Why I am gung-ho about Typora
- Conditional text in markdown
- Author documents using markdown
- Using mermaid in markdown
- Do agile technical documentation using markdown
- Tool independent technical documentation
- Techniques for cost-effective technical documentation
The ability to learn is the key to survival. We can learn faster by learning from each other.
Comments
Post a Comment