Crate noosphere_into

Crate noosphere_into 

Source
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§

MemoryWriteTarget
An implementation of WriteTarget that is only intended to be used in tests.
NativeFs
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.
SphereContentTranscluder
A Transcluder implementation that uses HasSphereContext to resolve the content being transcluded.
StaticHtmlResolver
A Resolver that is suitable for resolving a Slashlink to an href for a basic static website generator.
StaticHtmlTransform
A Transform that is suitable for converting Noosphere content to HTML for a basic state website generator.
TextTransclude
TransformStream
This is a helper for taking a Stream of strings and converting it to an AsyncRead suitable for writing to a file.

Enums§

HtmlOutput
Used to configure the output format of the file_to_html_stream transform
ResolvedLink
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.
ResolverConditionalSendSync
Transcluder
A Transcluder is responsible for taking a slug and generating a transclude for the content that the slug refers to.
TranscluderConditionalSendSync
Transform
A Transform represents the combination of a Resolver and a Transcluder. Together these elements form a transformation over some input Noosphere content.
WriteTarget
An interface for accessing durable storage. This is used by transformers in this crate to render files from Noosphere content.
WriteTargetConditionalSend
WriteTargetConditionalSendSync

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