3
$\begingroup$

I'd like to share link that jumps directly to a particular part of deployed notebook, any tips?

Online Mathematica docs provide an anchor to each cell, so you can link to them directly -- example

I looked through the source of my deployed notebook and didn't see any anchors, so probably need changes on the notebook side.

$\endgroup$
4
  • $\begingroup$ I have lectures organized as multiple notebooks (one notebook for one lecture). I used to give in one notebook a reference to a certain equation in another notebook. This reference has been organized as a button that opens this other notebook with the necessary equation being already on the screen. Is it close to what you need? If yes, I will share the code. $\endgroup$ Aug 26, 2021 at 8:17
  • $\begingroup$ @AlexeiBoulbitch does it work on wolfram cloud? I'm looking for a clickable link to a deployed notebook that I can share online $\endgroup$ Aug 26, 2021 at 8:26
  • $\begingroup$ I never tried it with the cloud. $\endgroup$ Aug 26, 2021 at 10:20
  • $\begingroup$ In my opinion it is not possible now, but maybe in the next release. Therefore I deleted my post. $\endgroup$
    – hieron
    Aug 26, 2021 at 16:53

1 Answer 1

1
$\begingroup$

Update

In the recent post on the Wolfram Community Brian Van Vertloo (WRI) showed how it is possible to build HTML from the Documentation pages using "PacletTools`":

The documentation build code that is shipping with the desktop products is capable of building HTML pages already, believe it or not. The relevant function is PacletDocumentationBuild (https://reference.wolfram.com/language/PacletTools/ref/PacletDocumentationBuild.html), where you use:

Needs["PacletTools`"];PacletDocumentationBuild[paclet, outdir, "HTML"]

I haven't tried it, but probably it will add the anchors I described in the original version of this answer.


Original answer

You can easily check that every anchor on a published Documentation page is equal to the CellID of the corresponding Cell in the offline Documentation:

screenshot1

screenshot2

Your deployed notebook has no CellIDs set to its Cells.

According to the Docs,

Typically, a CellID will be created automatically by the system for each new cell inserted in a notebook that has the setting CreateCellID->True.

Setting CreateCellID->True will not affect CellID options of cells already in the notebook at the time the option is set.

Your Notebook has no CreateCellID->True. So you should first create a new Notebook and set this option:

SetOptions[EvaluationNotebook[], CreateCellID -> True]

Then you can copy-paste the contents of your original Notebook into the new Notebook. All Cells will have CellID assigned. After this you may deploy the new Notebook.

$\endgroup$
4
  • $\begingroup$ that sounds like exactly what I need.....how do I get CellID? The example in help for CellId uses NotebookRead command but that requires CellTags to be set first $\endgroup$ Aug 27, 2021 at 15:04
  • $\begingroup$ I think this may need something extra, I just tried deploying notebook with cell ids set, as seen by printing FullForm of the cell, but still no anchors -- wolframcloud.com/obj/yaroslavvb/newton/… $\endgroup$ Aug 27, 2021 at 15:07
  • $\begingroup$ @YaroslavBulatov You are right, it seems in deployed version anchors still aren't present. The Documentation pages aren't deployed in this sense, they were exported as HTML pages, I think. $\endgroup$ Aug 27, 2021 at 15:12
  • 1
    $\begingroup$ @YaroslavBulatov I updated the answer with a possible workaround via building HTML and deploying it to the cloud with PacletDocumentationBuild. See examples on the linked Docs page. $\endgroup$ Jan 17 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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