I have a template notebook that I'd like to substitute a string, but the string could possibly contain a Hyperlink.
Here is an example template notebook:
I create a hyperlink to a help page with:
Hyperlink["Association", "ref/Association"]
That creates the hyperlinked text which I then paste into the GenerateDocument
command.
GenerateDocument["testingTemplateNB.nb",
<|
"aString" -> "This is a string with a link to an Association"
|>
]
The word "Association" is the hyperlink.
But when I generate the notebook from the template, it doesn't make the hyperlink. This is the text that is generated:
This is a string with a link to an \!\(\*TemplateBox[{"\"Association\"",{"\!\(\*Cell[TextData[ButtonBox[\"ref/Association\",BaseStyle->\"ExampleLink\",ButtonData->\"CellID\"]]]\)", None},"\!\(\*Cell[TextData[ButtonBox[\"ref/Association\",BaseStyle->\"ExampleLink\",ButtonData->\"CellID\"]]]\)"},"HyperlinkDefault"]\)
How do I put a link into a notebook generated from a template?
GenerateDocument[nb, <|"aString" -> "text ", "link" -> Hyperlink["Associations", "ref/Associations"]|>]
. $\endgroup$