st-annotated-text icon indicating copy to clipboard operation
st-annotated-text copied to clipboard

added list support

Open prashantkodali opened this issue 2 years ago • 2 comments

modified util.py to accept list of elements as input.

so far, elements have to be passed on like below,

annotated_text(
    "This ",    ("is", "verb", "#8ef"),    " some ",    ("annotated", "adj", "#faa"),    ("text", "noun", "#afa"),    " for those of ",
    ("you", "pronoun", "#fea"),    " who ",    ("like", "verb", "#8ef"),    " this sort of ",    ("thing", "noun", "#afa"),    "."
)

with this PR, we can pass a list

any_list =    ["This ",   ("is", "verb", "#8ef"),    " some ",    ("annotated", "adj", "#faa"),    ("text", "noun", "#afa"),    " for those of ",    ("you", "pronoun", "#fea"),     " who ",    ("like", "verb", "#8ef"),    " this sort of ",    ("thing", "noun", "#afa"),    "."]

annotated_text(any_list)

prashantkodali avatar Jun 08 '22 09:06 prashantkodali

+1 to this functionality!!

sashavor avatar Jun 13 '22 17:06 sashavor

had made a similar PR , but then the repo was updated, and the changes were conflicting. so made a new PR.

would love to see this functionality added. with this PR merge.

tagging the repo contributors for better reach/notifications. @tvst @sashavor @mataney @sai-krishna-msk

prashantkodali avatar Jun 27 '22 05:06 prashantkodali

Thanks for the idea. I just implemented this in v4.0 using recursion as proposed by @Jrryy .

sfc-gh-tteixeira avatar Apr 05 '23 21:04 sfc-gh-tteixeira