TL;DR
The problem boils down to how to convert a correctly prepared submission Notebook into a ResourceObject
suitable for ResourceSubmit
, using the Free Wolfram Engine for Developers or the Wolfram Cloud. The Free Wolfram Engine for Developers doesn't support NotebookObject
, and hence the last example on the Documentation page for ResourceSubmit
doesn't work. And it also doesn't work in the Wolfram Cloud, despite the fact that the latter supports NotebookObject
! I'm asking for a way to do the conversion without intermediate NotebookObject
. I hope it is possible.
One can obtain the "FunctionResource" submission Notebook template by evaluating the following in Mathematica or in the Cloud:
nbo = CreateNotebook["FunctionResource"];
After filling the template it can be converted into a ResourceObject
simply by applying ResourceObject
to the NotebookObject
handle returned by CreateNotebook
:
funResource = ResourceObject[nbo];
Now the resource can be submitted using ResourceSubmit
:
ResourceSubmit[funResource, "PublisherID" -> "MyPublisherID"];
I'm currently working with the Free Wolfram Engine for Developers (FWED) which doesn't support NotebookObject
handle, and hence the above code doesn't work. I have a "FunctionResource" Notebook prepared some time ago on another machine with Mathematica 12.0 and wish to submit it to the Wolfram Function Repository using ResourceSubmit
which is available in FWED and works (at least submission of a "DataResource"
ResourceObject
as shown on the Docs page for ResourceSubmit
was successful).
The above code was adapted from the second example on ResourceSubmit
page which shows how it is possible to turn an opened "DataResource" submission Notebook (available as a NotebookObject
) into an actual ResourceObject
:
Open a definition notebook and create a new data resource:
nbo = CreateNotebook["DataResource"]
dogResource = ResourceObject[nbo]
Note that ResourceSubmit
page seems to be the only place in the Documentation where this functionality is described. A direct attempt to supply a Notebook
expression results in error:
ResourceObject::defkey: The resource must have a value for Name.
ResourceObject
and ResourceRegister
pages describe how to convert a LocalObject
or CloudObject
into a ResourceObject
object and register it in order to have it available by name:
ResourceObject[loc]
accepts locations of previous resource object deployments includingLocalObject
andCloudObject
.
Registering the resource allows it to be discovered by name:
ResourceRegister[ro]; ResourceObject["English Words"]
Hence it should be sufficient to find a way to convert "FunctionResource" Notebook into correct LocalObject
for turning it on the next step into an NotebookObject
.
Does anyone have an idea how this can be achieved?