Skip to content

Commit

Permalink
no need tech dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jangorecki committed Oct 19, 2024
1 parent c4d0dd5 commit 2378041
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 65 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/pkgup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,19 @@ jobs:
- name: doc
if: github.ref == 'refs/heads/master'
run: |
rm -rf .pkgup/doc
mkdir -p .pkgup/doc/vignettes
rsync -r --exclude 'doc' --exclude 'repo' .pkgup/* .pkgup/doc/
echo -e "output:\n litedown::html_format:\n options:\n toc:\n depth: 4\n litedown::latex_format:\n meta:\n documentclass: \"book\"\n\nbook:\n new_session: false\n subdir: true\n pattern: \"[.]R?md$\"\n chapter_before: \"Information before a chapter.\"\n chapter_after: \"This chapter was generated from `$input$`.\"" > pkgup/doc/_litedown.yml
echo -e "---\nsite:\n rebuild: \"outdated\"\n pattern: \"[.]R?md$\"\n---\n\n```{r, echo=FALSE}\nlitedown::pkg_desc()\n```\n\nTo cite the package:\n\n```{r, echo=FALSE}\nlitedown::pkg_citation()\n```" > .pkgup/doc/index.Rmd
echo -e "```{r, echo=FALSE}\nlitedown::pkg_manual()\n```" > .pkgup/doc/manual.Rmd
echo -e "```{r, echo=FALSE}\nlitedown::pkg_news(recent=0)\n```" > .pkgup/doc/news.Rmd
echo -e "```{r, echo=FALSE, results='asis'}\nrmd = list.files(\"./vignettes\", \"*.Rmd\", full.names=TRUE)\nif (!length(rmd)) {\n cat(\"no vignettes\\n\")\n} else {\n title = function(f) {\n title1 = function(f) {\n if (!file.exists(f))\n stop(\"file \", f, \" does not exists\")\n l = readLines(f)\n t = paste(head(strsplit(basename(f), \".\", fixed=TRUE)[[1L]], -1L), collapse=\".\") ## default, basename without extension\n for (i in seq_along(l)) {\n if (substr(l[i], 1L, 6L) != \"title:\")\n next\n t = trimws(gsub(\"title:\", \"\", l[i], fixed=TRUE))\n break\n }\n t\n }\n sapply(f, title1)\n }\n html = paste0(substr(rmd, 1L, nchar(rmd)-3L), \"html\")\n lapply(html, function(f) cat(sprintf(\"[%s](%s)\\n\", title(rmd), f))) |> invisible()\n}\n```" > .pkgup/doc/vignettes.Rmd
cp -r vignettes/* .pkgup/doc/vignettes/
R CMD INSTALL $(ls -1t pkgup_*.tar.gz | head -n 1)
Rscript -e 'litedown::fuse_site(".pkgup/doc")'
#ls -aR .pkgup/doc
- name: repo
if: github.ref == 'refs/heads/master'
run: |
rm -rf .pkgup/repo
mkdir -p .pkgup/repo/src/contrib
mv "$(ls -1t pkgup_*.tar.gz | head -n 1)" .pkgup/repo/src/contrib
Rscript -e 'tools::write_PACKAGES(".pkgup/repo/src/contrib", fields="Revision")'
Expand Down
15 changes: 0 additions & 15 deletions .pkgup/_litedown.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .pkgup/index.Rmd

This file was deleted.

3 changes: 0 additions & 3 deletions .pkgup/manual.Rmd

This file was deleted.

3 changes: 0 additions & 3 deletions .pkgup/news.Rmd

This file was deleted.

25 changes: 0 additions & 25 deletions .pkgup/vignettes.Rmd

This file was deleted.

1 change: 0 additions & 1 deletion vignettes/howto.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ vignette: >
```sh
cp pkgup/.github/workflows/pkgup.yaml yourpkg/.github/workflows/pkgup.yaml
sed -i 's|pkgup|yourpkg|g' yourpkg/.github/workflows/pkgup.yaml
cp -r .pkgup .
```

If needed, add OS dependencies chunk in `yourpkg/.github/workflows/pkgup.yaml`
Expand Down

0 comments on commit 2378041

Please sign in to comment.