PolyPost (poly_post v0.2.0)

Copy Markdown View Source

Summary

Functions

Builds a list of raw content into a list of resource content without storing it.

Builds a list of content for a specific markdown + metadata resource and store it in a Depot process.

Builds all the content for each markdown + metadata resource and store it in a corresponding Depot process.

Clears all content for a specific resource

Clears all content out of all resources

Fetches raw content from git and then a path on disk listed under config.

Fetches raw content from a path on disk listed under config.

List all resources and their metadata

Stores built content in a Depot under a specific resource name.

Functions

build(resource_unit)

(since 0.2.0)
@spec build(PolyPost.Resource.Unit.t()) ::
  {:ok, {PolyPost.Resource.name(), PolyPost.Resource.content()}}
  | {:error, term()}
  | {:error, term(), term()}

Builds a list of raw content into a list of resource content without storing it.

build_and_store!(resource)

(since 0.1.0)
This function is deprecated. Use fetch/1, build/1 and store/1 instead. Will be removed in 0.3.0..
@spec build_and_store!(PolyPost.Resource.name()) :: :ok | {:error, :not_found}

Builds a list of content for a specific markdown + metadata resource and store it in a Depot process.

Raises an error if the building or storage fails on the specific resource.

build_and_store_all!()

(since 0.1.0)
This function is deprecated. Use fetch/1, build/1 and store/1 instead. Will be removed in 0.3.0..
@spec build_and_store_all!() :: :ok

Builds all the content for each markdown + metadata resource and store it in a corresponding Depot process.

Raises an error if the building or storage fails.

clear(resource)

(since 0.2.0)
@spec clear(PolyPost.Resource.name()) :: :ok | {:error, :not_found}

Clears all content for a specific resource

clear_all()

(since 0.2.0)
@spec clear_all() :: :ok

Clears all content out of all resources

fetch(name)

(since 0.2.0)
@spec fetch(PolyPost.Resource.name()) ::
  {:ok, [PolyPost.Resource.Unit.t()]} | {:error, term()}

Fetches raw content from git and then a path on disk listed under config.

fetch_from_path(name)

(since 0.2.0)
@spec fetch_from_path(PolyPost.Resource.name()) ::
  {:ok, [PolyPost.Resource.Unit.t()]} | {:error, term()}

Fetches raw content from a path on disk listed under config.

list_resources()

(since 0.2.0)
@spec list_resources() ::
  {:ok, keyword(PolyPost.Resource.config())}
  | {:error, :resources_not_found}
  | {:error, :config_not_found}

List all resources and their metadata

store(resource, content)

(since 0.2.0)
@spec store(PolyPost.Resource.name(), PolyPost.Resource.content()) ::
  :ok | {:error, term()}

Stores built content in a Depot under a specific resource name.