Skip to content

Commit

Permalink
Merge pull request #38 from Anirban166/master
Browse files Browse the repository at this point in the history
Incorporate reasonable changes to some of the R files within R/
  • Loading branch information
tdhock authored Jul 7, 2021
2 parents b543ce1 + b4782d9 commit 00d2ff4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
20 changes: 9 additions & 11 deletions R/doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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("<table>",rowhtml,"</table>"),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
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -248,4 +247,3 @@ filltemplate <- function
}
txt
}

4 changes: 2 additions & 2 deletions R/positioning.functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
})
Expand Down

0 comments on commit 00d2ff4

Please sign in to comment.