Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate reasonable changes to some of the R files within R/ #38

Merged
merged 12 commits into from
Jul 7, 2021
Merged
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.
){
Anirban166 marked this conversation as resolved.
Show resolved Hide resolved
## 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"))
Anirban166 marked this conversation as resolved.
Show resolved Hide resolved
print(direct.label(ratplot,"last.qp"))

lattice.options(oldopt)
})
Expand Down