CarbonAPI

public protocol CarbonAPI

Describes the API for Carbon

  • Renders a page into Carbon images.

    Declaration

    Swift

    static func renderVerbose(
        content: String,
        style: CarbonStyle
    ) -> EnvIO<ProgressReport, nef.Error, (ast: String, images: NEA<Data>)>

    Parameters

    content

    Content page in Xcode playground.

    style

    Style to apply to the generated snippets.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and values with the render information, having access to an immutable environment of type ProgressReport.

  • Renders a page into Carbon images and persit them.

    Declaration

    Swift

    static func renderVerbose(
        content: String,
        style: CarbonStyle,
        filename: String,
        into output: URL
    ) -> EnvIO<ProgressReport, nef.Error, (ast: String, url: URL)>

    Parameters

    content

    Content page in Xcode playground.

    style

    Style to apply to the generated snippets.

    filename

    Name to use in the exported carbon images.

    into

    Folder where to render carbon images.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and values with the render information, having access to an immutable environment of type ProgressReport.

  • Renders playground pages into Carbon images and persit them.

    Declaration

    Swift

    static func render(
        playground: URL,
        style: CarbonStyle,
        into output: URL
    ) -> EnvIO<ProgressReport, nef.Error, NEA<URL>>

    Parameters

    playground

    Path to Xcode playground.

    style

    Style to apply to the generated snippets.

    into

    Folder where to write the markdown files.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and values with the carbon files generated of type [URL], having access to an immutable environment of type ProgressReport.

  • Renders playground pages into Carbon images and persit them.

    Declaration

    Swift

    static func render(
        playgroundsAt: URL,
        style: CarbonStyle,
        into output: URL
    ) -> EnvIO<ProgressReport, nef.Error, NEA<URL>>

    Parameters

    playgroundsAt

    Folder where to search Xcode Playgrounds (recursive search).

    style

    Style to apply to the generated snippets.

    into

    Folder where to write the markdown files for each Xcode Playground page.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and the list of playgrounds rendered [URL], having access to an immutable environment of type ProgressReport.

  • Get an URL Request given a carbon configuration

    Declaration

    Swift

    static func request(configuration: CarbonModel) -> URLRequest

    Parameters

    carbon

    Configuration.

    Return Value

    URL request to carbon.now.sh

  • Get a NSView given a carbon configuration

    Declaration

    Swift

    static func view(configuration: CarbonModel) -> CarbonView

    Parameters

    carbon

    configuration

    Return Value

    View of type NSView

  • render(content:style:) Extension method

    Renders a page into Carbon images.

    Declaration

    Swift

    static func render(
        content: String,
        style: CarbonStyle
    ) -> EnvIO<ProgressReport, nef.Error, NEA<Data>>

    Parameters

    content

    Content page in Xcode playground.

    style

    Style to apply to the generated snippets.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and the images generated of type NEA<Data>, having access to an immutable environment of type ProgressReport.

  • render(page:style:) Extension method

    Renders a page into Carbon images.

    Declaration

    Swift

    static func render(
        page: URL,
        style: CarbonStyle
    ) -> EnvIO<ProgressReport, nef.Error, NEA<Data>>

    Parameters

    page

    Path to Xcode playground page.

    style

    Style to apply to the generated snippets.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and the images generated of type NEA<Data>, having access to an immutable environment of type ProgressReport.

  • Renders a page into Carbon images.

    Declaration

    Swift

    static func renderVerbose(
        page: URL,
        style: CarbonStyle
    ) -> EnvIO<ProgressReport, nef.Error, (ast: String, images: NEA<Data>)>

    Parameters

    page

    Path to Xcode playground page.

    style

    Style to apply to the generated snippets.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and values with the render information, having access to an immutable environment of type ProgressReport.

  • render(code:style:) Extension method

    Renders a code selection into Carbon image.

    Declaration

    Swift

    static func render(
        code: String,
        style: CarbonStyle
    ) -> EnvIO<ProgressReport, nef.Error, Data>

    Parameters

    code

    Code to render into Carbon image.

    style

    Style to apply to the generated snippet.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and the image generated of type Data, having access to an immutable environment of type ProgressReport.

  • Renders a code selection into Carbon image.

    Declaration

    Swift

    static func renderVerbose(
        code: String,
        style: CarbonStyle
    ) -> EnvIO<ProgressReport, nef.Error, (ast: String, image: Data)>

    Parameters

    code

    Code to render into Carbon image.

    style

    Style to apply to the generated snippet.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and values with the render information, having access to an immutable environment of type ProgressReport.

  • Renders a page into Carbon images and persit them.

    Declaration

    Swift

    static func render(
        content: String,
        style: CarbonStyle,
        filename: String,
        into output: URL
    ) -> EnvIO<ProgressReport, nef.Error, URL>

    Parameters

    content

    Content page in Xcode playground.

    style

    Style to apply to the generated snippets.

    filename

    Name to use in the exported carbon images.

    into

    Folder where to render carbon images.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and the file generated of type URL, having access to an immutable environment of type ProgressReport.

  • Renders a page into Carbon images and persit them.

    Declaration

    Swift

    static func render(
        page: URL,
        style: CarbonStyle,
        filename: String,
        into output: URL
    ) -> EnvIO<ProgressReport, nef.Error, URL>

    Parameters

    page

    Path to Xcode playground page.

    style

    Style to apply to the generated snippets.

    filename

    Name to use in the exported carbon images.

    into

    Folder where to render carbon images.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and the file generated of type URL, having access to an immutable environment of type ProgressReport.

  • Renders a page into Carbon images and persit them.

    Declaration

    Swift

    static func renderVerbose(
        page: URL,
        style: CarbonStyle,
        filename: String,
        into output: URL
    ) -> EnvIO<ProgressReport, nef.Error, (ast: String, url: URL)>

    Parameters

    page

    Path to Xcode playground page.

    style

    Style to apply to the generated snippets.

    filename

    Name to use in the exported carbon images.

    into

    Folder where to render carbon images.

    Return Value

    An EnvIO to perform IO operations that produce errors of type nef.Error and values with the render information, having access to an immutable environment of type ProgressReport.