title: Pre- or post-process roxygen snippets
body: <p>Is there some mechanism by which I can transform the comments that roxygen sees, preferably before it does the roxygen->rd conversion?</p>
  
  <p>For example, suppose I have:</p>
  
  <pre><code>#' My function. Does stuff with numbers.
  #'
  #' This takes an input `x` and does something with it.
  #' @param x a number.
  myFunction &lt;- function (x) {
  }
  </code></pre>
  
  <p>Now, suppose I want to do some conversion of the comment before roxygen parses it, for example replacing all instances of things in backticks with <code>\code{}</code>. Ie:</p>
  
  <pre><code>preprocess &lt;- function (txt) {
      gsub('`([^ ]+)`', '\\\\code{\\1}', txt)
  }
  # cat(preprocess('Takes an input `x` and does something with it'.))
  # Takes an input \code{x} and does something with it.
  </code></pre>
  
  <p>Can I feed <code>preprocess</code> into roxygen somehow so that it will run it on the doclets before (or after would work in this case) roxygen does its document generation?</p>
  
  <p>I don't want to do a permanent find-replace in my <code>.r</code> files. As you might guess from my example, I'm aiming towards some rudimentary markdown support in my roxygen comments, and hence wish to keep my <code>.r</code> files as-is to preserve readability (and insert the <code>\code{..}</code> stuff programmatically).</p>
  
  <p>Should I just write my own version of <code>roxygenise</code> that runs <code>preprocess</code> on all detected roxygen-style comments in my files, saves them temporarily somewhere, and then runs the <em>actual</em> <code>roxygenise</code> on those?</p>