cran-task-views / ctv

CRAN Task View Initiative
82 stars 13 forks source link

HTML anchors #36

Closed bbolker closed 2 years ago

bbolker commented 2 years ago

At the moment [text]{anchorname} works to denote an anchor within the document and [text](#anchorname) links to it, but according to StackOverflow this is a markdown extension and is back-end-dependent.

Is it safe/advisable to use this format for anchors in task views?

zeileis commented 2 years ago

Yes, that's ok. You can try out whether it works via ctv2html() which processes the Markdown part with pandoc and this supports such anchors.

Also note that it may not be necessary to set the anchors explicitly. Namely when you want to refer to a section Section title you can simply use #section-title.

bbolker commented 2 years ago

Thanks. I can see that this works at present, but wanted to make sure you weren't contemplating changes in the back-end that would make it stop working ...

In the case I'm thinking of I wanted to redirect users to a point in the document that was not indicated by a section head (it's part of a bulleted list, below section headers in the hierarchy).

zeileis commented 2 years ago

Yes, thanks for checking with us, this is fine!