Git Product home page Git Product logo

cake.asciidoctor's Introduction

Cake.Asciidoctor

Cake.Asciidoctor is a Cake Addin that provides aliases for Asciidoctor and Asciidoctor PDF

status%2FCake

Cake.Asciidoctor

Usage

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:

Install the Addin

Install the addin into your Cake build.

  • If you are using Cake scripting, use the #addin reprocessor directive:

    #addin nuget:?package=Cake.Asciidoctor&version=VERSION
  • If 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.

Building from source

Building the project from source requires the .NET 7 SDK (version as specified in global.json) and uses Cake for the build.

To execute the default build, run

.\build.ps1

This will build the project, run all tests and pack the NuGet package.

Versioning and Branching

The version of the addin is automatically derived from git and the information in version.json using Nerdbank.GitVersioning:

  • The main branch always contains the latest version. Packages produced from main are always marked as pre-release versions (using the -pre suffix).

  • Stable versions are built from release branches. Build from release branches will have no -pre suffix

  • Builds from any other branch will have both the -pre prerelease tag and the git commit hash included in the version string

To create a new release branch use the nbgv tool:

dotnet tool install --global nbgv
nbgv prepare-release

cake.asciidoctor's People

Contributors

ap0llo avatar renovate[bot] avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.