You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To build more tools for the ecosystem we should be able to reuse features implemented in fabric. This means fabric must provide a programmatic API to be used in other Go-powered tools.
The goal of the programmatic API for fabric is to provide parsing, data fetching and content rendering capabilities to other tools.
Design
The API must provide the functions:
a function that accepts a Fabric config, provided as a string, and returns all parsed root-level blocks as structs.
a function that accepts all parsed root-level blocks as structs, name of the document block, and either a path to the content block in the document or a parsed content block struct to be rendered. The function returns a struct with the content block details and the rendered text
a function that accepts all parsed root-level blocks as structs, name of the document block, and either a path to the data block in the document or a parsed data block struct to run. The function returns a struct with the data block details and the data returned by the plugin
a function that accepts all parsed root-level blocks as structs, and either the name of the root-level data block or a parsed data block struct to run. The function returns a struct with the data block details and the data returned by the plugin.
The text was updated successfully, but these errors were encountered:
how are plugins initialized? maybe a separate Init() function that accepts the config blocks is necessary before any of the rendering
how do we define a path to a content block inside a document tree? With anonymous nested section blocks, the path might not be straight forward to produce.
Background
To build more tools for the ecosystem we should be able to reuse features implemented in
fabric
. This meansfabric
must provide a programmatic API to be used in other Go-powered tools.The goal of the programmatic API for
fabric
is to provide parsing, data fetching and content rendering capabilities to other tools.Design
The API must provide the functions:
document
block, and either a path to thecontent
block in the document or a parsedcontent
block struct to be rendered. The function returns a struct with thecontent
block details and the rendered textdocument
block, and either a path to thedata
block in the document or a parseddata
block struct to run. The function returns a struct with thedata
block details and the data returned by the plugindata
block or a parseddata
block struct to run. The function returns a struct with thedata
block details and the data returned by the plugin.The text was updated successfully, but these errors were encountered: