query
On this page

literalExample

lib.literalExample

Docs pulled from | This Revision | 8 minutes ago


For use in the defaultText and example option attributes. Causes the given string to be rendered verbatim in the documentation as Nix code. This is necessary for complex values, e.g. functions, or values that depend on other values or packages.

Inputs

text

1. Function argument

(lib.options.literalExpression)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

literalExpression = text:
    if ! isString text then throw "literalExpression expects a string."
    else { _type = "literalExpression"; inherit text; };