Expand description
This crate implements transformations of Noosphere content into other content types. For the time being, the focus is on transforming Subtext to HTML.
Structs§
- Memory
Write Target - An implementation of WriteTarget that is only intended to be used in tests.
- Native
Fs - A generalized file system-backed implementation of WriteTarget. It roots
all writes to the configured
root, making it suitable for rendering Noosphere content to a target directory. - Sphere
Content Transcluder - A Transcluder implementation that uses HasSphereContext to resolve the content being transcluded.
- Static
Html Resolver - A Resolver that is suitable for resolving a Slashlink to an
hreffor a basic static website generator. - Static
Html Transform - A Transform that is suitable for converting Noosphere content to HTML for a basic state website generator.
- Text
Transclude - Transform
Stream - This is a helper for taking a Stream of strings and converting it to an AsyncRead suitable for writing to a file.
Enums§
- Html
Output - Used to configure the output format of the file_to_html_stream transform
- Resolved
Link - This enum represents the resolved value that may be returned by a Resolver and is provided to a Transcluder
- Transclude
- The set of possible transcludes that may need to be rendered to a target format. At this time, only text transcludes are supported.
Traits§
- Resolver
- A Resolver is given a Slashlink and resolves it to a ResolvedLink which includes an href, which is a URL string that can be used to link to the content referred to by the Slashlink over the hypertext web.
- Resolver
Conditional Send Sync - Transcluder
- A Transcluder is responsible for taking a slug and generating a transclude for the content that the slug refers to.
- Transcluder
Conditional Send Sync - Transform
- A Transform represents the combination of a Resolver and a Transcluder. Together these elements form a transformation over some input Noosphere content.
- Write
Target - An interface for accessing durable storage. This is used by transformers in this crate to render files from Noosphere content.
- Write
Target Conditional Send - Write
Target Conditional Send Sync
Functions§
- block_
to_ html - Given a Transform and a Block, produce an HTML string
- entity_
to_ html - Given a Transform and an Entity, produce an HTML string
- file_
to_ html_ stream - Given a Transform, a SphereFile and an HtmlOutput, perform a streamed transformation of the SphereFile into HTML. The transformation that is performed may vary depending on content type. At this time, only Subtext is supported.
- html_
document_ envelope - Generate an HTML “envelope” for content described by the given MemoIpld. Currently, only Subtext and Sphere content types are explicitly supported. This envelope is made up of two parts because the content inside will be streamed for most content types.
- sphere_
into_ html - Given a sphere [Did], [SphereDb] and a WriteTarget, produce rendered HTML output up to and including the complete historical revisions of the slug-named content of the sphere.
- sphere_
to_ html_ document_ stream - Given a Transform and a Sphere, produce a stream that yields the file content as an HTML document
- sphere_
to_ subtext_ stream - subtext_
to_ html_ document_ stream - Given a Transform and a SphereFile, produce a stream that yields the file content as an HTML document
- subtext_
to_ html_ fragment_ stream - Given a Transform and a SphereFile, produce a stream that yields the file content as an HTML fragment
- transclude_
to_ html - Convert a Transclude to an HTML string