Skip to content

Commit

Permalink
Rename package.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjisato committed Aug 28, 2023
1 parent f0623d3 commit 7447be0
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
^juicydown\.Rproj$
^juicedown\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^_pkgdown\.yml$
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: juicydown
Package: juicedown
Title: Convert R Markdown into HTML with Inline Styles
Version: 0.0.0.9000
Authors@R:
Expand All @@ -12,7 +12,7 @@ License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
URL: https://kenjisato.github.io/juicydown/
URL: https://kenjisato.github.io/juicedown/
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2023
COPYRIGHT HOLDER: juicydown authors
COPYRIGHT HOLDER: juicedown authors
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2023 juicydown authors
Copyright (c) 2023 juicedown authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions R/convert_markdown2html.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
convert_markdown2html <- function(
in_text, template = the$template, stylesheet = the$stylesheet) {

template <- getd(template, getOption("juicydown.template"))
stylesheet <- getd(stylesheet, getOption("juicydown.article.css"))
template <- getd(template, getOption("juicedown.template"))
stylesheet <- getd(stylesheet, getOption("juicedown.article.css"))

tdir <- getd(the$tempdir, tempdir())
dir <- getd(the$dir, tdir)
Expand Down
2 changes: 1 addition & 1 deletion R/css_resolve.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ css_combine <- function(stylesheet, file = stdout()) {
FUN.VALUE = character(1), USE.NAMES = FALSE)
compiled <- sass::sass(bundle)

cat("/* CSS generated by juicydown */\n\n", file = file)
cat("/* CSS generated by juicedown */\n\n", file = file)
cat(compiled, file = file, append = TRUE, sep = "\n")
}

Expand Down
2 changes: 0 additions & 2 deletions R/juicydown-package.R → R/juicedown-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@
#' @importFrom stringr str_split
#' @importFrom stringr str_split_1
#' @importFrom stringr str_squish
#' @importFrom utils head
#' @importFrom utils tail
## usethis namespace: end
NULL
8 changes: 8 additions & 0 deletions R/juicedown_example.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

juicedown_example <- function(path = NULL) {
if (is.null(path)) {
list.files(pkg_file("samples"))
} else {
pkg_file("samples", path)
}
}
6 changes: 4 additions & 2 deletions R/math.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ correct_equations_ <- function(text) {
text <- gsub("\u3002$", "\u3002 $", text, fixed = TRUE)

# math begin
math_lines <- which(head(text, -1) == "$$" & tail(text, -1) == "\\begin{aligned}")
math_lines <-
which(utils::head(text, -1) == "$$" & utils::tail(text, -1) == "\\begin{aligned}")
for (i in math_lines) {
text[[i]] <- "$$\\begin{aligned}"
text[[i+1]] <- NA
}

# math end
math_lines <- which(head(text, -1) == "\\end{aligned}" & tail(text, -1) == "$$")
math_lines <-
which(utils::head(text, -1) == "\\end{aligned}" & utils::tail(text, -1) == "$$")
for (i in math_lines) {
text[[i]] <- "\\end{aligned}$$"
text[[i+1]] <- NA
Expand Down
2 changes: 1 addition & 1 deletion R/rstudio.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ preview <- function(stylesheet = NULL, ...) {
message("Preview output created: ", htmlFile, "\n",
"Please verify the final result on your Moodle site."
)
message("To produce the final result, run juicydown::convert() ",
message("To produce the final result, run juicedown::convert() ",
"in the console.")

message("CSS files used: \n", paste(css, collapse = "\n"))
Expand Down
14 changes: 7 additions & 7 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.onLoad <- function(libname, pkgname) {
op <- options()
op.juicydown <- list(
juicydown.template = pkg_file("xml", "template.html"),
juicydown.article.css = pkg_file("css", "article.css"),
juicydown.div.css = pkg_file("css", "div.css")
op.juicedown <- list(
juicedown.template = pkg_file("xml", "template.html"),
juicedown.article.css = pkg_file("css", "article.css"),
juicedown.div.css = pkg_file("css", "div.css")
)
toset <- !(names(op.juicydown) %in% names(op))
if (any(toset)) options(op.juicydown[toset])
toset <- !(names(op.juicedown) %in% names(op))
if (any(toset)) options(op.juicedown[toset])

invisible()
}

.onAttach <- function(libname, pkgname) {
# packageStartupMessage("Welcome to juicydown")
# packageStartupMessage("Welcome to juicedown")
}
12 changes: 6 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@ knitr::opts_chunk$set(
)
```

# juicydown
# juicedown

<!-- badges: start -->
[![R-CMD-check](https://github.com/kenjisato/juicydown/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/kenjisato/juicydown/actions/workflows/R-CMD-check.yaml)
[![R-CMD-check](https://github.com/kenjisato/juicedown/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/kenjisato/juicedown/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of juicydown is to offer useful tools to minimize routine formatting of
The goal of juicedown is to offer useful tools to minimize routine formatting of
page contents on such CMS as Moodle where code editor silently ignore style and
link tags. To generate CSS-inlined HTML, the package uses [juicyjuce] package
along with [knitr] and [markdown] packages.

## Installation

You can install the development version of juicydown from [GitHub](https://github.com/) with:
You can install the development version of juicedown from [GitHub](https://github.com/) with:

``` r
# install.packages("remotes")
remotes::install_github("kenjisato/juicydown")
remotes::install_github("kenjisato/juicedown")
```

## Example

This is a basic example which shows you how to solve a common problem:

```{r example}
library(juicydown)
library(juicedown)
## basic example code
```

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# juicydown
# juicedown

<!-- badges: start -->

[![R-CMD-check](https://github.com/kenjisato/juicydown/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/kenjisato/juicydown/actions/workflows/R-CMD-check.yaml)
[![R-CMD-check](https://github.com/kenjisato/juicedown/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/kenjisato/juicedown/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of juicydown is to offer useful tools to minimize routine
The goal of juicedown is to offer useful tools to minimize routine
formatting of page contents on such CMS as Moodle where code editor
silently ignore style and link tags. To generate CSS-inlined HTML, the
package uses \[juicyjuce\] package along with \[knitr\] and \[markdown\]
packages.

## Installation

You can install the development version of juicydown from
You can install the development version of juicedown from
[GitHub](https://github.com/) with:

``` r
# install.packages("remotes")
remotes::install_github("kenjisato/juicydown")
remotes::install_github("kenjisato/juicedown")
```

## Example

This is a basic example which shows you how to solve a common problem:

``` r
library(juicydown)
library(juicedown)
## basic example code
```
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url: https://kenjisato.github.io/juicydown/
url: https://kenjisato.github.io/juicedown/
template:
bootstrap: 5

File renamed without changes.
12 changes: 6 additions & 6 deletions man/juicydown-package.Rd → man/juicedown-package.Rd

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

4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# * https://testthat.r-lib.org/reference/test_package.html#special-files

library(testthat)
library(juicydown)
library(juicedown)

test_check("juicydown")
test_check("juicedown")

0 comments on commit 7447be0

Please sign in to comment.