HtmlInsert Wyam.Html

Queries HTML content of the input documents and inserts new content into the elements that match a query selector.

Package

This module exists in the Wyam.Html package which is not part of the core distribution. Add the following preprocessor directive to your configuration file to use it:
#n Wyam.Html
Alternativly, you can add all modules at once with the following preprocessor directive:
#n Wyam.All

Usage

  • HtmlInsert(string querySelector, DocumentConfig content)

    Creates the module with the specified query selector.

    • querySelector

      The query selector to use.

    • content

      The content to insert as a delegate that should return a string.

  • HtmlInsert(string querySelector, string content)

    Creates the module with the specified query selector.

    • querySelector

      The query selector to use.

    • content

      The content to insert.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • AtPosition(AdjacentPosition position = null)

    Specifies where in matching elements the new content should be inserted.

    • position

      A AdjacentPosition indicating where the new content should be inserted.

  • First(bool first = true)

    Specifies that only the first query result should be processed (the default is false).

    • first

      If set to true, only the first result is processed.

GitHub