package jekyll-format

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type highlight = {
  1. lang : string option;
    (*

    optional language of syntax

    *)
  2. body : Astring.String.Sub.t;
    (*

    code to be highlighted

    *)
  3. linenos : bool;
    (*

    whether line numbers should be emitted

    *)
}

highlight represents the various syntax highlighting options.

val mk_highlight : ?lang:string -> ?body:Astring.String.sub -> ?linenos:bool -> unit -> highlight

mk_highlight constructs a highlight value. lang defaults to None, body defaults to Astring.String.Sub.empty and linenos defaults to false.

val pp_highlight : highlight Fmt.t

pp_highlight formats a highlight in human-readable format.

val highlight : string -> highlight option

highlight s attempts to parse the contents of a {% highlight %} tag. s should have had the tags removed via extract_tag and just contain the tag body.

val endhighlight : string -> bool

endhighlight s checks if a {% endhighlight %} tag is present. s should have had the tags removed via extract_tag and just contain the tag body.