Skip to content

Commit

Permalink
Merge branch 'main' of github.com:rjournal/rjtools
Browse files Browse the repository at this point in the history
  • Loading branch information
dicook committed Oct 6, 2023
2 parents 349f66c + 0e439e7 commit f9415cc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
9 changes: 4 additions & 5 deletions R/rj_article.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
#' and `rticles::rjournal_article()` for pdf articles.
#' @inheritParams distill::distill_article
#' @param legacy_pdf whether an article is from the past and only have pdf version
#' @param web_only additional param for embedding PDF or using Rmd to produce HTML
#' @importFrom rlang caller_env env_poke
#' @return the rendered R Journal article
#' @export
#' @rdname rjournal_article
rjournal_article <- function(toc = FALSE, self_contained = FALSE,
legacy_pdf = FALSE, web_only = !legacy_pdf, ...) {
legacy_pdf = FALSE, ...) {
args <- c()
base_format <- distill::distill_article(
self_contained = self_contained, toc = toc, ...
Expand Down Expand Up @@ -149,7 +148,7 @@ rjournal_article <- function(toc = FALSE, self_contained = FALSE,
output_dir) {

# Add embedded PDF
embed_pdf <- if(! web_only){
embed_pdf <- if(legacy_pdf){
whisker::whisker.render(
'<div class="l-page">
<embed src="{{slug}}.pdf" type="application/pdf" height="955px" width="100%">
Expand Down Expand Up @@ -184,7 +183,7 @@ rjournal_article <- function(toc = FALSE, self_contained = FALSE,
data <- c(data, list(BIOC = BIOC))
}
}
if (web_only && legacy_pdf) {
if (FALSE && legacy_pdf) {
TEXOR <- "This article is converted from a Legacy LaTeX article using the
[texor](https://cran.r-project.org/package=texor) package.
The pdf version is the official version. To report a problem with the html,
Expand All @@ -204,7 +203,7 @@ rjournal_article <- function(toc = FALSE, self_contained = FALSE,
yaml::as.yaml(metadata),
"---",
"",
if(! web_only) embed_pdf else input[(front_matter_delimiters[2]+1):length(input)],
if(legacy_pdf) embed_pdf else input[(front_matter_delimiters[2]+1):length(input)],
"",
appendix
),
Expand Down
23 changes: 23 additions & 0 deletions inst/rjdistill.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,27 @@
color: rgb(60, 60, 60);
}

d-article h2 {
border-bottom: 0px solid rgba(0, 0, 0, 0.1);
padding-bottom: 0rem;
}
d-article h3 {
font-size: 20px;
}
d-article h4 {
font-size: 18px;
text-transform: none;
}

@media (min-width: 1024px) {
d-article h2 {
font-size: 32px;
}
d-article h3 {
font-size: 24px;
}
d-article h4 {
font-size: 20px;
}
}
</style>
11 changes: 1 addition & 10 deletions man/rjournal_article.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f9415cc

Please sign in to comment.