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

Built-in content.text plugin #15

Closed
traut opened this issue Dec 30, 2023 · 3 comments
Closed

Built-in content.text plugin #15

traut opened this issue Dec 30, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@traut
Copy link
Member

traut commented Dec 30, 2023

Background

In addition to the installable plugins (#3), fabric must have built-in plugins to allow generation of simple content without the need to download extra components.

Related: #13, #18

Design

content.text plugin is be a part of the fabric binary.

Specification

  • the plugin has no configuration options
  • API interface:
    • local context object
    • required text string attribute
    • optional format_as enum string attribute with allowed values title, code and blockquote (nil by default)
    • optional absolute_title_size int attribute (nil by default)
    • optional code_language string attribute

Behavior

The plugin renders and returns a text value as a template string using local context as input data and formats it in Markdown according to format_as parameter (if provided).

If format_as set to code, the text is formatted with triple backticks. If code_language is provided, the language should be set after the first triple backtick.

If format_as is title and absolute_title_size is set, the Markdown title size is absolute_title_size * #
If format_as is title and absolute_title_size is not set, the relative title size is calculated from the local context object that contains a document body (issue TBD) -- the multiplier for # for a Markdown title prefix is the number of title text seen previously in the document

Deliverables

  • new built-in content.text plugin
  • unit test for the plugin
@traut traut added enhancement New feature or request plugins labels Dec 30, 2023
@traut traut added this to the v0.1 milestone Dec 30, 2023
@dobarx dobarx self-assigned this Jan 16, 2024
@traut
Copy link
Member Author

traut commented Jan 17, 2024

implemented in #43

@traut traut closed this as completed Jan 17, 2024
@traut
Copy link
Member Author

traut commented Jan 18, 2024

reopening, pending #17, to add the implementation of a relative title size

@traut traut reopened this Jan 18, 2024
@traut traut modified the milestones: v0.1, v0.4 Feb 21, 2024
@traut
Copy link
Member Author

traut commented Feb 21, 2024

moved to v0.4 milestone because it depends on #98, as agreed in a conversation on slack

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

2 participants