forked from yanping/vistat-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
still use r-forge to host images, because Dropbox does not work well …
…with animations
- Loading branch information
Showing
1 changed file
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,16 @@ invisible(local({ | |
# generate figures to the ./figure/ directory | ||
if (!file.exists('figure/')) dir.create('figure') | ||
opts_knit$set(base.dir = normalizePath('figure', mustWork = TRUE)) | ||
# I save figures to my Dropbox folder | ||
opts_knit$set(base.url = if (Sys.getenv('USER') != 'yihui') '/figure/' else | ||
'http://dl.dropbox.com/u/15335397/vistat/') | ||
# save images to R-Forge; I can simply save them to my Dropbox folder, e.g. | ||
# http://dl.dropbox.com/u/15335397/vistat/ but the problem is that animations | ||
# do not work well under Google Chrome for some reason (SciAnimator keeps on | ||
# fetching images from Dropbox) | ||
opts_knit$set(base.url = if (Sys.getenv('USER') != 'yihui') '/figure/' else { | ||
# mount my R-Forge dir to the local figure dir | ||
if (as.character(file.info('figure/')[, 'mode']) != '2755') { | ||
stopifnot(system('sshfs [email protected]:/srv/gforge/chroot/home/groups/isu/htdocs/vistat figure') == 0L) | ||
} | ||
'http://isu.r-forge.r-project.org/vistat/' | ||
}) | ||
knit(f, paste('_posts/', base, '.md', sep = ''), envir = globalenv()) | ||
})) |