Cake addin for Asciidoctor and Asciidoctor PDF
Install
| Product | Versions |
|---|---|
| .NET |
README
Cake.Asciidoctor
Cake.Asciidoctor is a Cake Addin that provides aliases for Asciidoctor and Asciidoctor PDF
You can read the latest documentation at https://github.com/ap0llo/Cake.Asciidoctor.
Table of Contents
Prerequisites
Asciidoctor and/or Asciidoctor PDF need to be installed separately for the Cake addin to work.
Please follow the official documentation for installation instructions:
Usage
Install the Addin
Install the addin into your Cake build.
If you are using Cake scripting, use the
#addinreprocessor directive:#addin nuget:?package=Cake.Asciidoctor&version=VERSIONIf you are using Cake.Frosting, install the addin by adding a package reference to your project:
<PackageReference Include="Cake.Asciidoctor" Version="VERSION" />
Converting an AsciiDoc document to HTML
The Asciidoctor() alias runs Asciidoctor to convert an AsciiDoc document to HTML.
The only required parameter is the path of the input document. This will convert the document to HTML and place it next to the input document:
Task("ConvertDocuments").Does(() =>
{
// This will create "input.html" in the same directory as input.adoc
Asciidoctor("input.adoc");
});
Additional (optional) settings can be specified using the AsciidoctorSettings parameter.
For example, to change the output directory, use the DestinationDirectory property:
Task("ConvertDocuments").Does(() =>
{
Asciidoctor(
"input.adoc",
new AsciidoctorSettings()
{
DestinationDirectory = "./output-directory"
});
});
The avaialble options in AsciidoctorSettings correspond to the command line options of Asciidoctor.
Please refer to asciidoctor(1) for detailed information.
Converting an AsciiDoc document to PDF
The AsciidoctorPdf() alias runs Asciidoctor PDF to convert an AsciiDoc document to PDF.
The only required parameter is the path of the input document. This will convert the document to a PDF and place it next to the input document:
Task("ConvertDocuments").Does(() =>
{
// This will create "input.html" in the same directory as input.adoc
AsciidoctorPdf("input.adoc");
});
Additional (optional) settings can be specified using the AsciidoctorPdfSettings parameter.
For example, to change the output directory, use the DestinationDirectory property:
Task("ConvertDocuments").Does(() =>
{
AsciidoctorPdf(
"input.adoc",
new AsciidoctorPdfSettings()
{
DestinationDirectory = "./output-directory"
});
});
The available options in AsciidoctorPdfSettings correspond to the command line options of Asciidoctor PDF and are mostly the same as the options of Asciidoctor.
Please refer to the Asciidoctor PDF documentation for details.
License
Cake.Asciidoctor is licensed under the MIT License.
For details see https://github.com/ap0llo/Cake.Asciidoctor/blob/main/LICENSE
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.