Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatic API #51

Open
traut opened this issue Jan 26, 2024 · 3 comments
Open

Programmatic API #51

traut opened this issue Jan 26, 2024 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@traut
Copy link
Member

traut commented Jan 26, 2024

Background

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.
@traut traut added the enhancement New feature or request label Jan 26, 2024
@traut traut added this to the v0.4 milestone Jan 26, 2024
@traut
Copy link
Member Author

traut commented Jan 26, 2024

there are some open questions there:

  • 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.

@traut traut added the draft label Mar 29, 2024
@traut
Copy link
Member Author

traut commented Mar 29, 2024

This issue might be too abstract to argue about, so it is better to postpone it until we have a clear use case

@traut traut modified the milestones: v0.4, v0.6 Apr 3, 2024
@traut
Copy link
Member Author

traut commented Oct 23, 2024

it's time!

@traut traut removed the draft label Oct 23, 2024
@traut traut added this to the v0.6 milestone Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant