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


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

screenshot from the RainbowText resource function website

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.

the RainbowText notebook, opened in Mathematica

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?

  • 2
    $\begingroup$ 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. $\endgroup$ Oct 12, 2021 at 3:41
  • 5
    $\begingroup$ ResourceFunction["RainbowText", "Properties"] for more info $\endgroup$
    – Syed
    Oct 12, 2021 at 4:48
  • $\begingroup$ Thank you CA Trevilian and Syed! $\endgroup$
    – imida k
    Oct 13, 2021 at 3:28

3 Answers 3


ResourceFunction["RainbowText", "Definition"]

Get Definition.


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




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

{"AllVersions", "AutoUpdate", "Categories", "ContributorInformation", 
 "Definition", "DefinitionNotebook", "DefinitionNotebookObject", 
 "Description", "Details", "Documentation", "DocumentationLink", 
 "DocumentationNotebook", "DownloadedVersion", "ExampleNotebook", 
 "ExampleNotebookObject", "Function", "FunctionLocation", "Keywords", 
 "LatestUpdate", "Name", "Originator", "Properties", "RelatedSymbols", 
 "ReleaseDate", "RepositoryLocation", "ResourceLocations", 
 "ResourceObject", "ResourceType", "SeeAlso", "ShortName", 
 "SourceMetadata", "Symbol", "SymbolName", "TestReport", "Usage", 
 "UUID", "VerificationTests", "Version", "VersionInformation", 
 "VersionsAvailable", "WolframLanguageVersionRequired"}

The definition notebook:


enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.