-
Notifications
You must be signed in to change notification settings - Fork 188
Updating documentation website
The documentation website (https://docs.quanteda.io) should be built from the latest version of quanteda on CRAN, to avoid confusion caused by different function specifications between the CRAN and Github versions. To ensure this, we separated the website to the gh_pages
branch, which should only be rebuilt between updating CRAN and accepting new pull requests.
Building a website is simply to run pkgdown::build_site()
. Once the website has been built, make a commit and push files in /docs
to the gh-pages
branch. This can be done by git subtree push --prefix docs origin gh-pages
.
Updating website is easy but note that website will be inaccessible between step 4 to shortly after step 5 (downtime will be around 5 min)
- Make sure that you are on the CRAN version by commit IDs
- Build website by
pkgdown::build_site()
- Stage all the files in
/docs
and make a commit - Delete the old website branch by
git push origin --delete gh-pages
- Push files to website branch by
git subtree push --prefix docs origin gh-pages
- Check if the version number in the reference is the same as the latest CRAN version
- Done
- Checkout the latest CRAN version by
git checkout -b [branch name] [commit ID]
as a separate branch. Branch name can be anything but should be likeCRAN-v1.0.0
; commit IDs are available in the release page - On the new branch, extract files that you want to update from the master by
git checkout --patch master [file1] [file2]
. Files are, for example,R/corpus-methods-base.R
andR/corpus_segment.R
- Build website by
pkgdown::build_site()
or reference bypkgdown::build_reference()
- Stage all the files in
/docs
and make a commit - Delete the old website branch by
git push origin --delete gh-pages
- Push files to website branch by
git subtree push --prefix docs origin gh-pages
- Check if the version number in the reference is the same as the latest CRAN version
- Done
This is a new feature of pkgdown website that utilizes DocSearch. Currently only the Github version of pkgdown supports DocSearch. According the developer, we can customize:
- Look and feel (https://community.algolia.com/docsearch/documentation/)
- Indexing (https://github.com/algolia/docsearch-configs/blob/master/configs/quanteda.json)
Since indexing is done by the DocSearch crawler every 24 hours, we need to request changes in settings through a pull request. pkgdown's website also uses this the service and its setting file is also on in the folder.