Skip to content

Keyword categorization (i.e. tagging) support #925

Closed

Description

@spooning

Originally submitted to Google Code by imranoftherings on 4 Aug 2011

Many time you can bunch keywords in natural categories. In these cases you want to be able to specify the category and the usage doc to be created in a categorized manner.

Keyword 1
[Category] category1
Keyword 2
[Category] category1
Keyword New 1
[Category] category2

Documentation

category1
|---- Keyword 1
|---- Keyword 2

category2
|---- Keyword New 1

Activity

  1. added this to the 2.9 milestone on Jun 29, 2014
  2. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by imranoftherings on 5 Aug 2011

    maybe add support for subcategories as well. For example

    Keyword 1
    [Category] category1
    Keyword 2
    [Category] category1.subcat1
    Keyword New 1
    [Category] category2

    Documentation

    category1
    |---- Keyword 1
    |---- subcat1
    |---- Keyword 2

    category2
    |---- Keyword New 1

    The syntax is open for discussion.

  3. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 5 Aug 2011

    I like the underlying idea of categorizing (or tagging) keywords but don't like adding new [Category] setting too much. Adding new syntax like this always requires changes to other tools (such as RIDE), and in this case the syntax wouldn't work with library keywords.

    The simplest idea I have is to allow specifying categories/tags as part of the documentation. Having them, for example, on the last line in format Categories: category 1, category 2 would both look nice and be easy to parse.

    The largest part in implementing this would be changing libdoc so that it shows categories somehow, allows viewing all keywords with same category, etc. Most likely we should make library docs more dynamic, similarly as new reports in RF 2.6, which in turn would require changing libdoc to use jQuery. That would be great otherwise too but obviously require quite large changes.

    What do you think?

  4. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by imranoftherings on 5 Aug 2011

    I just chose an example for explaining the concept. Your way is better actually. It allows us to be able to categorize keywords implemented in libraries, without any additional work, which the example I chose didn't really consider.

  5. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 11 Aug 2011

    I like the idea and mark this accepted. Not sure when there's time to implement this, though.

  6. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by imranoftherings on 13 Aug 2011

    I need this quickly. So I will go ahead and implement this myself and submit a patch later.

  7. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 16 Aug 2011

    Sounds good. Assuming you read the categories from the documentation, there's no need to change the core framework at all.

  8. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 7 Jan 2012

    Issue 1024 has been merged into this issue.

  9. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by bryan.oakley on 7 Jan 2012

    Could we agree on a specific format now, so we could start using this format before it officially gets into robot? Is the following example what you're going to do?

    | My Keyword
    | | [Documentation] | blah blah yada yada \n
    | | [...] | Categories: private, deprecated
    
  10. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by bryan.oakley on 8 Jan 2012

    The more I think about this, the more I think it's not necessary for "Categories:" to be the last line in the doc string. We should support it anywhere in the doc string. I think the chance of getting a false positive would be pretty small.

  11. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 8 Jan 2012

    I thought about this a bit more and think now that:

    1. We should should use term "tags" instead of "categories". I think think it's better to use same terms with similar concepts. The risk of someone confusing tests' tags with keywords' tags ought to be pretty small.

    2. It would probably be a good idea to add support for separate [Tags] setting for keywords. The needed work to make RF and RIDE support it ought to be relatively small. I doubt we have time to include this into RF 2.7, though, at least unless we get external help or sponsoring. Until this is added, using Tags: in the end or middle of keyword documentation ought to be fine.

  12. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 8 Jan 2012

    Ooops, should have read my old comment where I mention that [Categories] don't work with library keywords. Parsing tags/categories from their documentation is a lot easier than inventing some other system and works automatically also with dynamic libraries. For consistency we probably should support parsing this info from user keyword documentation too and it's questionable is it worth supporting also [Tags].

  13. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by bryan.oakley on 6 Feb 2012

    Can we agree here and now on a specific convention, even if no direct support will be added in the near future? I am working on a tool that needs this feature and I'd like my documentation to be forward-compatible.

    It looks like Pekka's suggestion is to use "Tags: x,y,z" -- can we call that official? Or, does it make sense to use "[tags] x,y,z" to be a bit closer to the way tags are used in the plain text formats?

    While we will probably put this information as the last line of the documentation, should it be allowed anywhere in the docstring? I say yes.

  14. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by GodTdd on 15 Feb 2012

    I have an similar idea for tagging keywords but instead of using the libdoc I would like the tagging bee visible in the log.html file and/or change the how the tagged keywords are seen in the log file.

    I did post my idea in separate enhancement request, issue 1055 [1], describes my idea in more detailed manner.

    https://code.google.com/p/robotframework/issues/detail?id=1055

  15. spooning commented on Jun 29, 2014

    @spooning
    ContributorAuthor

    Originally submitted to Google Code by @pekkaklarck on 16 Feb 2012

    @⁠bryan, I would say that Tags: t1, t2 on the last line of the documentation is the way to go. Do you have use cases why it should be allowed somewhere else?

    @⁠godtdd, we could add this information to log file in two formats:

    1. List tag inside the keyword similarly as the first line of the documentation and start/end/elapsed times.
    2. Add tags to the source as classes. For this to be useful there should then be a separate feature to somehow inject custom CSS into the log file so that you can style the keywords as you want.
  16. 12 remaining items

  17. jussimalinen commented on May 27, 2015

    @jussimalinen
    Member

    We still need to document this, but otherwise it should be ready.

  18. added a commit that references this issue on May 27, 2015
  19. pekkaklarck commented on Jun 3, 2015

    @pekkaklarck
    Member

    Small doc enhancements in a1378ee. This issue is done!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions