Message Boards Message Boards

1
|
457 Views
|
3 Replies
|
7 Total Likes
View groups...
Share
Share this post:

Paclet for Paclet Repository without resource definition

Posted 1 month ago

I want to understand how I can create and publish my paclet using only Wolfram Engine without the Mathematica interface. I know I can do this using PacletCICD, but what if I can't open, create, and edit the .nb file? I won't be able to create a home page and documentation pages for individual functions. Is it then possible to publish the package to the Paclet Repository?

POSTED BY: Kirill Belov
3 Replies

To publish in the paclet repository you need to create a definition notebook at least once. You do not need to use it when you submit or update your paclet, but the ResourceDefinition.nb needs to exist in your paclet layout.

If the notebook exists, then the tools in PacletCICD allow programmatic publishing.

POSTED BY: Bob Sandheinrich

You can programmatically generate most sections of the definition notebook, but the whole process won't be easy without a frontend, since you would need to write out cell expressions manually:

nb = DefinitionNotebookClient`GenerateDefinitionNotebook @ <|
    "ResourceType" -> "Paclet",
    "Name" -> Cell[ "MyPublisher/NameOfThePaclet", "Title" ],
    "Description" -> Cell[ "This is the description", "Text" ],
    "HeroImage" -> Cell[ BoxData @ ToBoxes @ FreeformEvaluate[ "picture of a cat" ], "Output" ],
    "LongDescription" -> {
        Cell[ "This is the \"Basic Description\" section", "Notes" ],
        Cell[ "This is the stuff that appears next to the hero image on the web page", "Notes" ]
    },
    "Details" -> { Cell[ "This is the \"Details\" section", "Notes" ], Cell[ "Write details here", "Notes" ] },
    "PrimaryContext" -> Cell[ "MyPublisher`NameOfThePaclet`", "Text" ],
    "ExampleNotebook" -> {
        Cell[ "The first example:", "Text" ],
        Cell[ BoxData @ MakeBoxes[ 1 + 1 ], "Input", CellLabel -> "In[1]:=" ],
        Cell[ BoxData[ "2" ], "Output", CellLabel -> "Out[1]=" ]
    },
    "Contributed By" -> Cell[ "Your name here", "Text" ]
|>

This will generate a Notebook[...] expression with the specified sections filled out.

You can use this to see the names of available template slots:

DeleteDuplicates @ Cases[
    DefinitionNotebookClient`DefinitionTemplate[ "Paclet" ],
    TemplateSlot[ name_String, ___ ] :> name,
    Infinity
]

Note that you won't be able to fill out every section this way, since some of them contain more complex UI interfaces.

You'll also need documentation notebooks but I'm not sure if there's a way to generate those programmatically.

POSTED BY: Richard Hennigan
Posted 1 month ago

Thank! This is exactly what I need!

POSTED BY: Kirill Belov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract