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§
- An implementation of WriteTarget that is only intended to be used in tests.
- 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. - A Transcluder implementation that uses HasSphereContext to resolve the content being transcluded.
- A Transform that is suitable for converting Noosphere content to HTML for a basic state website generator.
- This is a helper for taking a [Stream] of strings and converting it to an AsyncRead suitable for writing to a file.
Enums§
- Used to configure the output format of the file_to_html_stream transform
- This enum represents the resolved value that may be returned by a Resolver and is provided to a Transcluder
- The set of possible transcludes that may need to be rendered to a target format. At this time, only text transcludes are supported.
Traits§
- 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.
- A Transcluder is responsible for taking a slug and generating a transclude for the content that the slug refers to.
- A Transform represents the combination of a Resolver and a Transcluder. Together these elements form a transformation over some input Noosphere content.
- An interface for accessing durable storage. This is used by transformers in this crate to render files from Noosphere content.
Functions§
- 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.
- 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.
- 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.
- Given a Transform and a SphereFile, produce a stream that yields the file content as an HTML document
- Given a Transform and a SphereFile, produce a stream that yields the file content as an HTML fragment
- Convert a Transclude to an HTML string