diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..2bf64e2 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,45 @@ +on: + push: + branches: master + +name: pkgdown + +jobs: + pkgdown: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@master + + - uses: r-lib/actions/setup-pandoc@master + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v1 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + install.packages("remotes") + remotes::install_deps(dependencies = TRUE) + remotes::install_dev("pkgdown") + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Deploy package + run: pkgdown::deploy_to_branch(new_process = FALSE) + shell: Rscript {0} diff --git a/.gitignore b/.gitignore index 10b9ca4..655cbfa 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .Rbuildignore *.webloc .httr-oauth +docs diff --git a/DESCRIPTION b/DESCRIPTION index 072f848..13b4d9d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: livecode -Title: Broadcast a source file to multiple concurrant users +Title: Broadcast a Source File to Multiple Concurrent Users Version: 0.1.0.9000 Authors@R: person(given = "Colin", @@ -26,6 +26,8 @@ Imports: tibble, crayon, rstudioapi -RoxygenNote: 7.1.0 +RoxygenNote: 7.1.1 LinkingTo: Rcpp +URL: https://github.com/rundel/livecode +BugReports: https://github.com/rundel/livecode/issues diff --git a/NAMESPACE b/NAMESPACE index 8dca8a9..93b3b75 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -12,4 +12,6 @@ export(network_interfaces) export(serve_file) export(stop_all) importFrom(Rcpp,sourceCpp) +importFrom(stats,setNames) +importFrom(utils,URLencode) useDynLib(livecode, .registration = TRUE) diff --git a/R/file_stream_server.R b/R/file_stream_server.R index abfa98f..21b8666 100644 --- a/R/file_stream_server.R +++ b/R/file_stream_server.R @@ -126,7 +126,7 @@ file_stream_server = function(host, port, file, file_id, interval = 3, template }, staticPaths = list( - "/web" = livecode:::pkg_resource("resources") + "/web" = pkg_resource("resources") ) ) diff --git a/R/livecode-package.R b/R/livecode-package.R new file mode 100644 index 0000000..ab470f8 --- /dev/null +++ b/R/livecode-package.R @@ -0,0 +1,10 @@ +#' @keywords internal +#' @importFrom stats setNames +#' @importFrom utils URLencode +"_PACKAGE" + +# The following block is used by usethis to automatically manage +# roxygen namespace tags. Modify with care! +## usethis namespace: start +## usethis namespace: end +NULL diff --git a/README.Rmd b/README.Rmd index 67d0193..7545933 100644 --- a/README.Rmd +++ b/README.Rmd @@ -44,7 +44,7 @@ server$stop() ## Using bitly -`livecode` has built in functionality for generating a bitlink automatically for your livecoding session. To do this you will need to provide `livecode` with a bitly API access token. To obtain one of these tokens you will need to create an account with bitly (the free tier is sufficient) and then select Profile Settings > Generic Access Token and then enter your password when prompted. This results in a long hexidecimal string that you should copy to your clipboard. +`livecode` has built in functionality for generating a bitlink automatically for your livecoding session. To do this you will need to provide `livecode` with a bitly API access token. To obtain one of these tokens you will need to create an account with bitly (the free tier is sufficient) and then select Profile Settings > Generic Access Token and then enter your password when prompted. This results in a long hexadecimal string that you should copy to your clipboard. `livecode` looks for this token in an environmental variable called `BITLY_PAT`. To properly configure this environmental variable we can use the `usethis` package. In R run the following, @@ -58,7 +58,7 @@ which will open your `.Renviron` file for you and you will just need to add a si BITLY_PAT=0123456789abcdef0123456789abcdef01234567 ``` -replacing `0123456789abcdef0123456789abcdef01234567` with the hexidecimal string you copied from bitly. After saving `.Renviron` you will need to restart your R session and can then test that your token is function correctly by running, +replacing `0123456789abcdef0123456789abcdef01234567` with the hexadecimal string you copied from bitly. After saving `.Renviron` you will need to restart your R session and can then test that your token is function correctly by running, ```r livecode::bitly_test_token() diff --git a/README.md b/README.md index 67ef783..6ccb76a 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ provide `livecode` with a bitly API access token. To obtain one of these tokens you will need to create an account with bitly (the free tier is sufficient) and then select Profile Settings \> Generic Access Token and then enter your password when prompted. This -results in a long hexidecimal string that you should copy to your +results in a long hexadecimal string that you should copy to your clipboard. `livecode` looks for this token in an environmental variable called @@ -69,7 +69,7 @@ add a single line with the format BITLY_PAT=0123456789abcdef0123456789abcdef01234567 replacing `0123456789abcdef0123456789abcdef01234567` with the -hexidecimal string you copied from bitly. After saving `.Renviron` you +hexadecimal string you copied from bitly. After saving `.Renviron` you will need to restart your R session and can then test that your token is function correctly by running, diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..e69de29 diff --git a/man/livecode-package.Rd b/man/livecode-package.Rd index 4d566d6..fa1c54f 100644 --- a/man/livecode-package.Rd +++ b/man/livecode-package.Rd @@ -1,20 +1,35 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/livecode.R +% Please edit documentation in R/livecode-package.R, R/livecode.R \docType{package} \name{livecode-package} -\alias{livecode-package} \alias{livecode} -\title{Source code broadcasting server} +\alias{livecode-package} +\title{livecode: Broadcast a Source File to Multiple Concurrent Users} \description{ +\if{html}{\figure{logo.png}{options: align='right' alt='logo' width='120'}} + +Broadcast a local R (or other text) document over the web and provide live updates as it is edited. + Server for broadcasting source code to multiple viewers } \details{ Broadcast a local R (or other text) document over the web and provide live updates as it is edited. } \seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/rundel/livecode} + \item Report bugs at \url{https://github.com/rundel/livecode/issues} +} + + \link{serve_file} } \author{ +\strong{Maintainer}: Colin Rundel \email{rundel@gmail.com} + + Colin Rundel \email{rundel@gmail.com} } +\keyword{internal} \keyword{package} diff --git a/pkgdown/favicon/apple-touch-icon-120x120.png b/pkgdown/favicon/apple-touch-icon-120x120.png new file mode 100644 index 0000000..d3c38b4 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-120x120.png differ diff --git a/pkgdown/favicon/apple-touch-icon-152x152.png b/pkgdown/favicon/apple-touch-icon-152x152.png new file mode 100644 index 0000000..1d53325 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-152x152.png differ diff --git a/pkgdown/favicon/apple-touch-icon-180x180.png b/pkgdown/favicon/apple-touch-icon-180x180.png new file mode 100644 index 0000000..67c3d33 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-180x180.png differ diff --git a/pkgdown/favicon/apple-touch-icon-60x60.png b/pkgdown/favicon/apple-touch-icon-60x60.png new file mode 100644 index 0000000..40e2b6e Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-60x60.png differ diff --git a/pkgdown/favicon/apple-touch-icon-76x76.png b/pkgdown/favicon/apple-touch-icon-76x76.png new file mode 100644 index 0000000..91f227c Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon-76x76.png differ diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png new file mode 100644 index 0000000..67c3d33 Binary files /dev/null and b/pkgdown/favicon/apple-touch-icon.png differ diff --git a/pkgdown/favicon/favicon-16x16.png b/pkgdown/favicon/favicon-16x16.png new file mode 100644 index 0000000..9a4ca88 Binary files /dev/null and b/pkgdown/favicon/favicon-16x16.png differ diff --git a/pkgdown/favicon/favicon-32x32.png b/pkgdown/favicon/favicon-32x32.png new file mode 100644 index 0000000..5142293 Binary files /dev/null and b/pkgdown/favicon/favicon-32x32.png differ diff --git a/pkgdown/favicon/favicon.ico b/pkgdown/favicon/favicon.ico new file mode 100644 index 0000000..63d5d8a Binary files /dev/null and b/pkgdown/favicon/favicon.ico differ