swirldev/swirl — pull request #103 by ncarchedi (2014-03-07 19:48:11+00:00)
Title: DON'T MERGE: Content authoring GUI

To run the GUI, build from the `gui` branch. You'll need the `shiny` and `rstudio` packages installed, since I haven't added them to `Imports` yet (see number 2 below for explanation). Then from Rstudio, run:

```
library(swirl)
author_gui("Test Course", "Test Lesson")
```

I'm struggling with 2 things:

1) In my original demo at `swirldev/swirl_misc`, every time a unit is added, the open lesson document dynamically refreshes, displaying the appended content. For some bizarre reason, this behavior changed when I integrated with the rest of the swirl package. The content still appends properly, but you must click inside of the lesson document for the new content to appear. When I have the lesson open in a TextMate editor at the same time, that version updates dynamically, so this has something to do with RStudio. Can anyone else reproduce this problem?

2) At the moment, I'm not importing the `shiny` package, because when I do I get this cryptic `WARNING` and `NOTE` during `R CMD check` that I can't seem to figure out:

```
* checking S3 generic/method consistency ... WARNING
Error in Context$new : could not find function "loadMethod"
Calls: ... unlist -> lapply -> FUN -> .is_S3_generic -> get -> $
Execution halted
See section ‘Generic functions and methods’ of the ‘Writing R
Extensions’ manual.
```

and

```
* checking Rd \usage sections ... NOTE
Error in Context$new : could not find function "loadMethod"
Calls: ... unlist -> lapply -> FUN -> .is_S3_generic -> get -> $
Execution halted
The \usage entries for S3 methods should use the \method markup and not
their full name.
See the chapter ‘Writing R documentation files’ in the ‘Writing R
Extensions’ manual.
```

To reproduce, do the following:

1) Add `#' @import shiny rstudio` at line 46 of `authoring-gui.R` (roxygen documentation for `author_gui()`)
2) Add `shiny` and `rstudio` to `Imports` in `DESCRIPTION` file
3) Run `devtools::document()`
4) Run `R CMD check`