Search documentation of phoenix_kit

# PhoenixKit.Pages.Renderer (phoenix_kit v1.6.19)

View Source

Simple markdown rendering for Pages module.

Converts markdown files to HTML with metadata extraction.

# Summary

## Functions

render_file(relative_path)

Renders a markdown file to HTML.

render_file_with_metadata(relative_path)

Renders a markdown file to HTML with metadata extraction.

render_markdown(content)

Converts markdown content to HTML.

# Functions

# render_file(relative_path)

Renders a markdown file to HTML.

## Examples

    iex> Renderer.render_file("/test.md")
    {:ok, "<h1>Hello World</h1>"}

    iex> Renderer.render_file("/missing.md")
    {:error, :enoent}

# render_file_with_metadata(relative_path)

Renders a markdown file to HTML with metadata extraction.

Returns both the rendered HTML and the parsed metadata.

## Examples

    iex> Renderer.render_file_with_metadata("/test.md")
    {:ok, "<h1>Hello World</h1>", %{status: "published", ...}}

    iex> Renderer.render_file_with_metadata("/missing.md")
    {:error, :enoent}

# render_markdown(content)

Converts markdown content to HTML.

## Examples

    iex> Renderer.render_markdown("# Hello")
    "<h1>Hello</h1>"