This repository contains the source documents for the articles, help messages, and blog posts used on voteview.com. We welcome user contributions!
To contribute, follow these simple steps:
- Fork our repository or clone the "example" branch.
- Rename the
docs/blank
folder to a short stub name suitable for your contribution. - Inside, rename
blank.Rmd
to match the folder name, and use it as a template for your article. - Open
article.Rproj
and runcompiler.R
to verify your article compiles correctly. - Open a pull request merging your local branch into
voteview/articles/master
- Wait for automatic integration testing to verify your pull request, and for us to approve it.
When running compiler.R
from the command line, there are certain flags that can be used to induce specified behaviour:
-d
,--dryrun
: When run with this flag, the compiler will not update any articles, it will simply notify you which articles would be updated.-f filename
,--force filename
: When run with this flag, the compiler will update the article whose Rmd is located atfilename
. This will ignore the default update/cache settings.
Each article supports a variety of front matter to customize the display of the article and the operation of the compiler.
tag: blog, help, data
. Tags determine which category the article fits into. Theblog
tag will be entered into the listing found on the Data page of the website. Other tags are currently not used directly; thus, articles missing theblog
tag will not be linked by default.title
. Contains the article's titleauthor
. Contains the article's author namedescription
. Contains a short description of the article's content, used for both the article listing and page metadataoriginal_date: YYYY-MM-DD
. The date the article was originally written, which will be used in header of the resulting article.date: YYYY-MM-DD
. Typically this is used to inject a dynamic date into the article reflecting the most recent update.update_delta: n
. How often the article should be updated, wheren
is a number of days. Use9999
or similar for static articles. If noupdate_delta
is provided, the default is 7 days.
Each article should contain a section near the top describing external dependencies. The template for this section is:
# We use pacman to load and install dependencies.
library(pacman)
# Please list your article's dependencies here, comma separated:
p_load(tidyverse, ggplot2)
pacman is used to manage dependencies because it is broadly compatible with our CI system and server; if a dependency is not installed, the p_load
command will install it as necessary.
The structure of this repository is as follows:
compiler.R
: Script that handles RMarkdown compilation and output for articles, as well as JSON metadata generationdocs/
: Folder containing subfolders for each article.docs/<article>/
: All files required to compile an article should go in this folder; working directory reflects this.docs/<article>/<article>.Rmd
: Main Rmd file to compile an article.output_template/template_stub.html
: Template HTML stub, which is used with RMarkdown to generate our HTML output.articles.Rproj
: R Project file for this repository..travis.yml
: Configuration info for Travis CI..gitignore
: Github file ignore informationREADME.md
: This file
We welcome user contributions which meet the following requirements:
- Articles must be written in English
- Articles must use Voteview data or NOMINATE estimation to produce either a new, derived dataset or examine a problem of political, journalistic, or social interest.
- Code must be non-destructive, must not modify files outside the article's folder, and must contain clearly documented and easily understood functionality.
- Articles must be submitted as a GitHub pull request to this repository.
- Articles must be submitted by their authors.
We reserve the right to reject submissions for any reason, with or without feedback.
The content of this repository is available under the MIT license. By submitting a contribution to this repository, you are granting Voteview / UCLA certain irrevocable non-exclusive rights to display your contribution on voteview.com or related sites, or to promote or advertise your contribution in connection with the site. We will preserve and display author metadata that you submit along with your article.