Alternera.Plugin.MigrationGuides (alternera_plugin_sdk v0.9.0)

Copy Markdown View Source

Reads a migration guides file: the Markdown a plugin declares with use Alternera.Plugin, migration_guides: "…", and the proxy's own shipped guides, in one format.

A migration guide is what a model reads when a user brings an integration from another platform: how that platform's pieces map onto the proxy's, the recipes to copy for each mapping, and what has no equivalent. One guide is a ##### section: its heading is the title, then a first paragraph, as a recipe's, that holds a description in a sentence or two (required) and the lines

  • platform: <text> — the platform the guide is a migration from (required); a plugin's guide may name a product, since the product is its subject;
  • words: <word>, <word>, … — that platform's own vocabulary (its names for a route, an upstream, a policy), which a search scores beside the title and the platform (optional).

The platform: and words: lines are left out of the text a model reads (strip/1); the rest of the section is the guide, its own parts under ###### headings. The slug comes from the title as a recipe's does (Alternera.Plugin.Recipes.slug/1).

problems/1 is what the SDK's test kit (Plugin.Test.Contract) and use Alternera.Plugin check a declared file with, so a plugin cannot ship a guide the proxy could not index.

Summary

Types

One migration guide of a file.

Functions

The guides of a file's text, in file order.

What is wrong with a migration guides file, one line each; [] for a file the proxy indexes whole: at least one guide, each with a title no other has, a platform: line, a description and a body after it.

A slug from a title, as a recipe's: lowercase, every run of other characters an underscore.

A file's text with each guide's platform: and words: lines left out.

Types

entry()

@type entry() :: %{
  slug: String.t(),
  title: String.t(),
  platform: String.t() | nil,
  words: [String.t()],
  description: String.t(),
  text: String.t()
}

One migration guide of a file.

Functions

parse(text)

@spec parse(String.t()) :: [entry()]

The guides of a file's text, in file order.

problems(text)

@spec problems(String.t()) :: [String.t()]

What is wrong with a migration guides file, one line each; [] for a file the proxy indexes whole: at least one guide, each with a title no other has, a platform: line, a description and a body after it.

slug(title)

@spec slug(String.t()) :: String.t()

A slug from a title, as a recipe's: lowercase, every run of other characters an underscore.

strip(text)

@spec strip(String.t()) :: String.t()

A file's text with each guide's platform: and words: lines left out.