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

Introduce web_presentation annotation for documentation #5532

Closed
bartv opened this issue Feb 15, 2024 · 0 comments
Closed

Introduce web_presentation annotation for documentation #5532

bartv opened this issue Feb 15, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@bartv
Copy link
Collaborator

bartv commented Feb 15, 2024

The goal of this feature is to allow the model developer to provide information to the user/operator in the web console. The current proposal is to use the following in the model:

    string documentation
    lsm::attribute_modifier documentation__modifier="r"
    dict documentation__annotations = {
        "web_presentation": "documentation",
        "web_title": "Documentation",
        "web_icon": "fa-info-circle",
        "web_content_type": "text/markdown"
    }
The json equivalent
{
    "attribute_annotations": {
        "web_content_type": "text/markdown",
        "web_icon": "fa-info-circle",
        "web_presentation": "documentation",
        "web_title": "Documentation"
    },
    "default_value": null,
    "default_value_set": false,
    "description": null,
    "modifier": "r",
    "name": "documentation",
    "type": "string",
    "validation_parameters": null,
    "validation_type": null
}
This results in an additional tab in expanded row (before the others).

image

The support content types could/should be:

  • text/plain
  • text/html (do we want to do this??)
  • text/markdown

For text/markdown we also want to support the mermaid extension so that we can include diagrams.

Discussion: do we use "tab" for the web_presentation annotation?

This also means we need to be able to render markdown in the browser. markdown-it (also used in the python world) seems to be one of the most complete and most used implementations:

For mermaid this is mermaid-js and there seems to be a number of plugins available. The original implementation of the plugin seems to be no longer maintained. However this fork seems to be more active: https://github.com/wekan/markdown-it-mermaid#readme

The following is some example code that you can use to test (without the backslashes):

# This is some more information

\```mermaid
  graph TD;
      A-->B;
      A-->C;
      B-->D;
      C-->D;
\```
@LukasStordeur LukasStordeur added the enhancement New feature or request label Feb 15, 2024
@LukasStordeur LukasStordeur self-assigned this Mar 5, 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

Successfully merging a pull request may close this issue.

2 participants