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
Hi! Thanks for make Yard. I am using it in a Rails engine to generate documentation for APIs. I am looking in the code how can I get all the lines from a tag (Multi-line), I try a lot of things read the code and docs, but I don't get how make it works. I tested with the default tags like @abstract and this works. But when I try to use my custom tags, I just get the value stripped.
And look at the code, there is no a third parameter like the documentation says:
The text parameter contains pre-parsed text with extra spaces and newlines removed. If required, the method could also be declared with a third parameter containing unmodified raw text
If I add a third parameter, I just get: ArgumentError: wrong number of arguments (given 2, expected 3).
My implementation is something like:
# My factory:moduleOasRailsmoduleYARDclassOasRailsFactory < ::YARD::Tags::DefaultFactory# Parses a tag that represents a request body example.# @param tag_name [String] The name of the tag.# @param text [String] The tag text to parse.# @return [RequestBodyExampleTag] The parsed request body example tag object.defparse_tag_with_request_body_example(tag_name,text,_raw)description,_,hash=extract_description_type_and_content(text,process_content: true,expresion: /^(.*?)\[([^\]]*)\](.*)$/m)RequestBodyExampleTag.new(tag_name,description,content: hash)end
....endend
I hope someone can help me with this please, I will be very thankful.
The text was updated successfully, but these errors were encountered:
a-chacon
changed the title
Multi-line tag text not working with a custom Factory.
Multi-line tag text not working with a custom Factory. (Question)
Mar 24, 2025
Hi! Thanks for make Yard. I am using it in a Rails engine to generate documentation for APIs. I am looking in the code how can I get all the lines from a tag (Multi-line), I try a lot of things read the code and docs, but I don't get how make it works. I tested with the default tags like
@abstract
and this works. But when I try to use my custom tags, I just get the value stripped.I already read:
And look at the code, there is no a third parameter like the documentation says:
If I add a third parameter, I just get:
ArgumentError: wrong number of arguments (given 2, expected 3)
.My implementation is something like:
I need all lines in the parse tag of my factory.
And this is used like this:
Currently, I am just able to read tags like:
But I need to implement a multi-line option.
You can see the complete code in my repo: https://github.com/a-chacon/oas_rails
I hope someone can help me with this please, I will be very thankful.
The text was updated successfully, but these errors were encountered: