box icon indicating copy to clipboard operation
box copied to clipboard

Support Markdown in documentation

Open mbojan opened this issue 4 years ago • 2 comments

Currently box does not render Markdown markup in the documentation, which would be very convenient. It seems to be hackable though with:

use::box(m = a/module)
old <- roxygen2:::roxy_meta_set("markdown", TRUE)
box::help(m$some_function) # Markdown is rendered
roxygen2:::roxy_meta_set("markdown", old)

It is hacky because roxy_meta_set() is not exported by roxygen2. Perhaps there is another way (I don't see it)? Or roxygen2 developers could be convinced to expose this functionality in some way.

mbojan avatar Nov 10 '21 14:11 mbojan

Since I don’t use Markdown in ‘roxygen2’ documentation myself I’m not very familiar with it.

As far as I can see, a proper solution would require the possibility for the user to somehow opt into Markdown for their module, right? Using @md inside a documentation comment already works. If I understand this feature request correctly, what’s missing is some way of enabling Markdown markup for all ‘roxygen2’ comments inside a module, correct?

Since ‘box’ modules currently don’t have an equivalent of a DESCRIPTION file, the best way of implementing this would probably be via a new, custom ‘royxgen2’ tag that would be used at the beginning of a module; something like @mdAll maybe?

klmr avatar Jan 16 '22 00:01 klmr

A tag @mdAll sounds good.

Alternatively the example in the vignette uses __init__.r for some "global" code, so I guess a call to a function enabling that could perhaps work too, although the tag sounds simpler.

mbojan avatar Jan 26 '22 12:01 mbojan