You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keyword categorization (i.e. tagging) support #925
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.
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.
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.
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?
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.
I thought about this a bit more and think now that:
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.
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.
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].
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.
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.
@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:
List tag inside the keyword similarly as the first line of the documentation and start/end/elapsed times.
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.
Activity
spooning commentedon Jun 29, 2014
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.
spooning commentedon Jun 29, 2014
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 2would 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?
spooning commentedon Jun 29, 2014
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.
spooning commentedon Jun 29, 2014
I like the idea and mark this accepted. Not sure when there's time to implement this, though.
spooning commentedon Jun 29, 2014
I need this quickly. So I will go ahead and implement this myself and submit a patch later.
spooning commentedon Jun 29, 2014
Sounds good. Assuming you read the categories from the documentation, there's no need to change the core framework at all.
spooning commentedon Jun 29, 2014
Issue 1024 has been merged into this issue.
spooning commentedon Jun 29, 2014
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?
spooning commentedon Jun 29, 2014
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.
spooning commentedon Jun 29, 2014
I thought about this a bit more and think now that:
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.
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.spooning commentedon Jun 29, 2014
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].
spooning commentedon Jun 29, 2014
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.
spooning commentedon Jun 29, 2014
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
spooning commentedon Jun 29, 2014
@bryan, I would say that
Tags: t1, t2on 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:
12 remaining items
Show keyword tags in log. #925
Show tags in Libdoc outputs. #1840
Get tags from keyword docs. #925
Tags in keyword documentation are supported by libdoc. #1840 #925
Report invalid tags type as an error. #925
jussimalinen commentedon May 27, 2015
We still need to document this, but otherwise it should be ready.
Test that keyword tags (#925) are handled correctly by Tidy
Documentation for keyword tags. #925
pekkaklarck commentedon Jun 3, 2015
Small doc enhancements in a1378ee. This issue is done!!