Giter VIP home page Giter VIP logo

docs's Introduction

rOpenSci docs badge

Tooling to generate pkgdown sites and more.

Create a Volume

First create a persistent volume data which will hold the websites and source packages:

docker volume create data

Then use any standard webserver container to host the data volume:

docker run -d -p 80:8043 -v data:/srv/http --name httpd pierrezemb/gostatic

Now navigate to http://localhost in your browser. Use docker stop and docker start to pause and restart the webserver:

docker stop httpd

The data volume persists after killing or restarting webserver. To manually explore the data volume, just mount it in any container with a shell:

docker run --rm -it -v data:/data busybox

Building and host locally

Build packages from their git url using the ropensci/docs image with arguments build {git_url}. These may run in parallel:

docker run --rm -it -v data:/data ropensci/docs build https://github.com/jeroen/openssl
docker run --rm -it -v data:/data ropensci/docs build https://github.com/ropensci/magick
docker run --rm -it -v data:/data ropensci/docs build https://github.com/ropensci/tesseract

Alternatively you can build from a local path. For example to copy the current directory in the container and build that:

docker create --name builder --rm -it -v data:/data ropensci/docs build "/sources"
docker cp $PWD "builder:/sources"
docker start builder --attach

Upon success, websites are saved to /data will be available in http://localhost/docs

Deploy to Github

To also deploy to Github you need to provide a GITHUB_PAT variable with permission to your Github org. Then run deploy to upload all the sites to your github org.

docker run --rm -it --env-file=env.txt -v data:/data ropensci/docs deploy

In env.txt you can also set GIT_USER and GIT_EMAIL variables to commit as a specific git user.

Cleanup

Stop the webserver (if any) and remove the data volume:

docker stop httpd && docker rm httpd
docker volume rm data

Jenkins CI Server

Checkout jenkins.md for how to setup a Jenkins server based on docker compose.

docs's People

Contributors

jeroen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docs's Issues

If there's no favicon files/no logo, use rOpenSci logo?

That's something I was hoping to tell authors to do in the repos, via rodev::use_ro_favicon() but it might be easier to solve it centrally via your docs builder @jeroen: if there's no pkgdown folder with at least one image called favicon (see https://github.com/ropenscilabs/rodev/tree/master/pkgdown/favicon) then could you create it before building the website? E.g. https://docs.ropensci.org/cld2/ has no favicon at the moment whereas https://docs.ropensci.org/magick/ does

Likewise, if there's no logo.png in man/figures, before building the website one could be created (cf https://github.com/ropenscilabs/rodev/tree/master/man/figures) so that pkgdown would use it? If there's a logo, pkgdown uses it when creating the Twitter/OpenGraph metadata (note that this could change slightly in the future i.e. a different filename for the logo for Twitter/OpenGraph r-lib/pkgdown#936) so Twitter cards would feature the rOpenSci logo instead of nothing.

run_dont_run or not?

Could a package maintainer choose whether the website is built with run_dont_run equal to TRUE or FALSE?

'ropensci' universe build error

Hi,

'ropensci' universe is showing an error after building the mctq package. It's not linking the build to the CRAN release.

The error message says:

A package 'mctq exists on CRAN but description does not link to: https://github.com/ropensci/mctq. This could be another source.

But if you go to the mctq CRAN page, you see that this is not the case.

I just got CRAN approval. Maybe this is why. Or maybe the system look for an exact format (https://github.com/ropensci/mctq != https://github.com/ropensci/mctq/).

image

Unsuccessful build for rcites

The pkgdown website for rcites hasn't been successfully built for 2 months now (https://dev.ropensci.org/blue/organizations/jenkins/rcites/activity ๐ŸŒฉ๏ธ ). I guess this is because a token is needed (but then I'm not sure why the build was successful before). My question is, what can I do to make the build successful? Is there a way to add credentials on Jenkins? Or, should I rather use Travis to deploy the website?

Just for the records, I was not sure where to report this, but reading section 1.8.1 of the devguide cleared up my doubt ๐Ÿ˜ƒ .

404

Does the 404 page have to be provided by GitHub or could we customize it?

Update references in DESCRIPTION and readme files

We should update references from ropensci.github.io/{pkg} to docs.ropensci.org/{pkg} in the readme and description files.

packages <- jsonlite::fromJSON("https://ropensci.github.io/roregistry/registry.json")$packages
packages <- subset(packages, grepl('https://github.com/ropensci/', url))
packages$hasdocs <- sapply(packages$name, function(pkg){
  url <- sprintf('https://docs.ropensci.org/%s/pkgdown.yml', pkg)
  message("checking: ", url)
  req <- curl::curl_fetch_memory(url)
  return(req$status == 200)
})
packages$hasurl <- sapply(packages$name, function(pkg){
  url <- sprintf('https://github.com/ropensci/%s/raw/master/DESCRIPTION', pkg)
  message("checking: ", url)
  req <- curl::curl_fetch_memory(url)
  grepl("docs.ropensci.org", rawToChar(req$content), fixed = TRUE)
})
subset(packages, hasdocs == T & hasurl == F)$name

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.