Convert your Markdown files into HTML and PDF with Amatl!
This extension is based on Amatl, a binary tool that allows you to convert your Markdown files into HTML and PDF formats.
Transform your CommonMark (also known as Markdown) files into full-fledged documents from the command line.
Why the name
amatl?
Amate (Spanish: amate[aˈmate], from Nahuatl languages: āmatl[ˈaːmat͡ɬ]) is a type of bark paper that has been manufactured in Mexico since pre-Columbian times. It was primarily used to create codices.
Source: Wikipedia
- Create documents from local or remote resources via URL resolving.
- Integrate MermaidJS diagrams and code blocks with syntax highlighting.
- Use custom directives to include other documents or generate tables of contents.
- Use pre-defined or custom layouts to transform your content into presentations, reports, etc.
- Use Go templating to inject dynamic data into your document.
⚠ Caution
This project is in its early stages and subject to rapid evolution. Expect frequent changes and potential instability.
- Download the latest release of
amatl. - In your terminal, start transforming your documents into HTML:
amatl render html my-doc.mdSee doc for more information.
✅ Automatic HTML and PDF generation upon saving.
✅ Advanced management of excluded files.
✅ Custom styling with a dedicated CSS file.
✅ Easy to use with a simple installation.
- Download and install the extension from VS Code Marketplace.
- Configure your amatl.configDirectory if you wants witch your own template and style
- Open a Markdown file and save it to generate HTML/PDF.
- Use Amatl Sidebar for insert directives
- Add your own directives
- tape ./ or ../ to autocomple a route file
Enable HTML generation when saving a Markdown file.
Target path to the generate html. If empty, in the same place of the md.
Enable PDF generation when saving a Markdown file.
Target path to the generate pdf. If empty, in the same place of the md.
Path to an Amatl configuration directory. If empty, the default configuration is used.
config.yml
Which allows you to customize the execution of Amatl:
html-layout: ./template.gohtml
pdf-scale: 0.7
pdf-margin-left: 1.0
pdf-margin-right: 1.0
template.gohtml The template used for document generation.
<html>
<head>
<title>{{ .Meta.title }}</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="{{ resolve .Context "./theme.css" }}" />
</head>
<body>
{{ .Body }}
</body>
</html>
theme.css Your theme
body {
font-family: "Roboto" !important;
color: #333;
max-width: 1200px;
margin: auto;
padding:10px;
}
noreplace.txt Exclude file md to transform to html/pdf
readme.md
mydir/other.md
directives.json You can add directive to Amatl sidebar
[
{
"name": "Break Page",
"code": "<div class='break-page'></div>",
"replacePattern": "",
"description": "Break Page"
}
]
- amatl.reloadDirectives = Reload directive
- amatl.generateHtml = Generate the html of the current md
- amatl.generatePdf = Generate the pdf of the current md
