diff --git a/R/doc.R b/R/doc.R index cc43206..529076c 100644 --- a/R/doc.R +++ b/R/doc.R @@ -75,15 +75,14 @@ dldoc <- function # Make directlabels documentation version <- read.dcf("DESCRIPTION")[,"Version"] git.line <- system('git log -1 --pretty=format:"%h %aD"', intern=TRUE) foot.info <- list(version=version,git=as.character(git.line)) - setwd(file.path("..","..","www","docs")) - foot <- filltemplate(foot.info,"templates/foot.html") + foot <- filltemplate(foot.info,"docs/templates/foot.html") makehtml <- function # Make HTML documentation ## Make plots and HTML for documentation website. (L ## List of positioning method and plots to match up. ){ ## all paths are relative to the docs directory - subdir <- L$type + subdir <- file.path("docs",L$type) pngurls <- matrix("",nrow=length(L$posfuns),ncol=length(L$plots), dimnames=list(names(L$posfuns), sapply(L$plots,function(x)x$name))) @@ -128,15 +127,15 @@ dldoc <- function # Make directlabels documentation parname=item$name, url=file.path("..",row,paste(f$name,".html",sep=""))) }) - rowfile <- paste("templates/",row,"-row.html",sep="") + rowfile <- paste("docs/templates/",row,"-row.html",sep="") rowhtml <- sapply(tmp,filltemplate,rowfile) item$table <- paste(c("",rowhtml,"
"),collapse="\n") } item$type <- L$type item$pagetitle <- item$name - item$head <- filltemplate(item,"templates/head.html") + item$head <- filltemplate(item,"docs/templates/head.html") item$foot <- foot - html <- filltemplate(item,paste("templates/",main,".html",sep="")) + html <- filltemplate(item,paste("docs/templates/",main,".html",sep="")) write(html,file.path(subdir,main,paste(item$name,".html",sep=""))) item } @@ -165,12 +164,12 @@ dldoc <- function # Make directlabels documentation },simplify=FALSE) } links <- apply(m,1,extract.links) - tmp <- list(head=filltemplate(list(pagetitle="home"),"templates/head.html"), + tmp <- list(head=filltemplate(list(pagetitle="home"),"docs/templates/head.html"), foot=foot) - rows <- lapply(links,filltemplate,"templates/index-row.html") + rows <- lapply(links,filltemplate,"docs/templates/index-row.html") tmp$table <- paste(rows,collapse="\n") - html <- filltemplate(tmp,"templates/index.html") - write(html,"index.html") + html <- filltemplate(tmp,"docs/templates/index.html") + write(html,"docs/index.html") m ### Matrix of lists describing example plots and matching builtin @@ -248,4 +247,3 @@ filltemplate <- function } txt } - diff --git a/R/positioning.functions.R b/R/positioning.functions.R index 40f0cdd..58dc51c 100644 --- a/R/positioning.functions.R +++ b/R/positioning.functions.R @@ -88,7 +88,7 @@ dlgrob <- function axes2native=identity, ... ){ - ## increment dlgrob.id to get a unique name because as explaine on + ## increment dlgrob.id to get a unique name because as explained on ## ?grid::gTree "Grob names need not be unique in general, but all ## children of a gTree must have different names." dl.env$dlgrob.id <- dl.env$dlgrob.id+1L @@ -147,7 +147,7 @@ direct.label <- structure(function # Direct labels for color decoding print(direct.label(ratplot)) ## To put them on the same side, just manually specify the ## Positioning Method. - print(direct.label(ratplot,"last.qp")) + print(direct.label(ratplot,"last.qp")) lattice.options(oldopt) })