informatics-isi-edu / ermrestjs

ERMrest client library in JavaScript
Apache License 2.0
4 stars 3 forks source link

Support markdown in comment #981

Closed RFSH closed 10 months ago

RFSH commented 1 year ago

Currently comment property is displayed as is. So we cannot have more complicated UI elements (like a bullet point) in the comment. I should mention that this is mostly useful for comments that are displayed inline as we described here.

There are two ways to do this:

We most probably want to go with the second solution.

RFSH commented 10 months ago

After discussing this, we decided to add a new commen_render_markdown property to the same annotations we've added to the comment_display property. So,

display annotation (catalog, schema, table, column)

{
    "tag:misd.isi.edu,2015:display": {
      "comment": "value",
      "comment": {
        "detailed": "detailed comment",
        "compact": "compact comment"
      },
      "comment_display": {
        "detailed": {
          "comment_render_markdown": false, // new
          "table_comment_display": "tooltip",
          "column_comment_display": "toolip",
        }
      }
    }
}

foreignkey annotation (foreignkey)

{

    "tag:isrd.isi.edu,2016:foreign-key": {
        "comment_render_markdown": false, // new
        "from_comment": "value",
        "from_comment_display": "inline",
        "to_comment": "value",
        "to_comment_display": "inline"
    }
}

source definition (visible column or visible fk) (column, inline table, related table, etc)

{
  "source": "",
  "markdown_name": ""
  "comment": "",
  "comment_display": "inline",
  "comment_render_markdown": false// new (default is true basically)
}

Also, by default, we want to treat all comments as markdowns.