# Definition of a ResourceFunction

There is a feature called ResourceFunction in Mathematica. For example you can color a string with rainbow style.

https://resources.wolframcloud.com/FunctionRepository/resources/RainbowText/

Below is a screenshot of the site in the Chrome browser.

As you see, the definition is not immediately visible, although it is available after downloading the source notebook (marked in light green) and opening the .nb file.

Below is a screenshot of the Mathematica program after opening the RainbowText-1-0-0-definition.nb file.

Q1) Why are so many steps required to see the definition?

Q2) Can I get the definition of a resource function without downloading a notebook? I mean, just knowing the function name RainbowText, can I get the definition of RainbowText?

• Seems that Domen has answered Q2. As for Q1, I think that a comment should suffice: it does not seem to be so uncomfortable to get the source notebook if one wants to have it, but this is not the intended use case/scenario for the general user. Presenting such information as the intended use case/scenario would likely result in some errors by the user when copying over the code blocks. By wrapping the functions in a contained format like that of the ResourceFunction allows for access to information like the version number, while also cleanly integrating with the overarching system. Oct 12, 2021 at 3:41
• ResourceFunction["RainbowText", "Properties"] for more info
– Syed
Oct 12, 2021 at 4:48
• Thank you CA Trevilian and Syed! Oct 13, 2021 at 3:28

ResourceFunction["RainbowText", "Definition"]

Alternatively, you could use "ResourceFunctionDefinitionViewer", to open a new notebook showing the implementation:

ResourceFunction["ResourceFunctionDefinitionViewer"][ResourceFunction["RainbowText"]]


You can treat the resource as an object rather than a function in order to make meta-queries:

ResourceObject["RainbowText"]["Properties"]

{"AllVersions", "AutoUpdate", "Categories", "ContributorInformation",
"Definition", "DefinitionNotebook", "DefinitionNotebookObject",

ResourceObject["RainbowText"]["DefinitionNotebook"];