It is convenient to generate RStudio reports using R Markdown, which are dynamic documents containing both text and code that can also be updated as data pour in. They can also be used as final reports, like this one, for reproducibility. But I was having trouble easily converting RStudio generated HTML files to DokuWiki. Fortunately, Myron Turner over at the DokuWiki forum provided a nice solution using ckgdedit.

Steps for transferring RStudio generated HTML reports to DokuWiki:

  1. Watch this video by Myron Turner to get visual overview of the steps below
  2. Install ckgdedit extension in DokuWiki
  3. Open HTML file in Firefox and press Cmd-A to select all
  4. Press Cmd-C to copy HTML page content
  5. Create a new page in DokuWiki and ensure ckgEdit mode is active
  6. Place the cursor inside the edit panel and click paste by clicking Cmd-V
  7. Still inside the edit panel, press Cmd-A to select the pasted content
  8. On ckgedit toolbox, press Tx to remove formatting

If you have blocks of R code and want proper highlighting in DokuWiki:

  1. Install “rstudio” plugin in DokuWiki. Instructions are here: https://www.dokuwiki.org/plugin:rstudio
  2. Click to edit the saved report in DokuWiki but ensure to switch to DokuWiki editing mode (DW Edit button below the edit panel)
  3. Insert ~~R_STUDIO~~ macro at the beginning and click save. This will tell “rstudio” plugin to format R code blocks for propoer highlighting.
  4. Remove ~~R_STUDIO~~ from the page and save again to avoid repetitive processing.

Note: ckgedit automatically saves figures in the DokuWiki folder called media. In the media manager, these figures appear in the “root” namespace. I am presently not sure how to easily move figures from “root” under a different namespace, such as “img”.