Skip to content

Commit

Permalink
remove child chunks and simplify pkgdown
Browse files Browse the repository at this point in the history
  • Loading branch information
jhelvy committed Dec 16, 2024
1 parent 4583035 commit 50e927d
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 230 deletions.
74 changes: 65 additions & 9 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,87 @@ status](https://www.r-pkg.org/badges/version/surveydown)](https://CRAN.R-project
## What is surveydown?

```{r child="man/rmdchunks/concept.Rmd"}
```
**surveydown** is a flexible, open-source platform for making surveys with [R](https://www.r-project.org/), [Quarto](https://quarto.org/), [Shiny](https://shiny.posit.co/), and [Supabase](https://supabase.com/).

<div align="center">
<img src='https://github.com/surveydown-dev/surveydown/blob/main/man/figures/technologies.png?raw=true' width="550px" alt="image showing the three technologies used in the surveydown platform along with their logos: quarto (for designing surveys), shiny (for rendering the survey), and supabase (for storing data)"/>
</div>

<br>

Here's how it works:

1. Design your survey as a [Quarto](https://quarto.org/) document using markdown and R code.
2. Render your survey into a [shiny](https://shiny.posit.co/) app that can be hosted online and sent to respondents.
3. Store survey responses in a PostgreSQL database - we recommend [Supabase](https://supabase.com/) as a free, secure, and easy to use option.

The {surveydown} R package provides functions to bring this all together.

**See the [complete documentation](https://surveydown.org) to get started making your own surveydown survey!**

## Why surveydown?

```{r child="man/rmdchunks/motivation.Rmd"}
```
Most survey platforms (e.g., Google forms, Qualtrics, etc.) use graphic interfaces or spreadsheets to define survey content, making version control, collaboration, and reproducibility difficult or impossible. The surveydown package was designed to address these problems. As an open-source, markdown-based platform, all survey content is defined using **plain text** (markdown and R code) in two files:

- `survey.qmd`: A Quarto document that contains the survey content (pages, questions, etc).
- `app.R`: An R script defining a shiny app that contains global settings (libraries, database configuration, etc.) and server configuration options (e.g., conditional skipping / display, etc.).

This approach makes your survey easy to reproduce, share, and version control with common tools like Git. And since all survey data is stored in a PostgreSQL database, you have total control over where your survey data lives. We provide direct support for [Supabase](https://supabase.com/) as a free, secure, and easy to use option.

In case you're interested in the background behind the project, this [blog post](https://www.jhelvy.com/blog/2023-04-06-markdown-surveys/) provides something of an origin story. Note that the design discussed in the post is now quite outdated with what ultimately became surveydown.

## Installation

### Install R & Quarto

```{r child="man/rmdchunks/install_R_Quarto.Rmd"}
```
You need both:

- Install [R](https://CRAN.R-project.org/)
- Install [Quarto](https://quarto.org/)

We also recommend working with an IDE that has good support for R, Quarto, and Shiny.

[RStudio](https://posit.co/products/open-source/rstudio/) is great, and we also like [VSCode](https://github.com/microsoft/vscode) and [Positron](https://github.com/posit-dev/positron).

### Install the {surveydown} R package

```{r child="man/rmdchunks/install_surveydown.Rmd"}
You can install {surveydown} from CRAN in your R console:

```{r}
#| eval: false
install.packages("surveydown")
```

## Roadmap
or you can install the development version from [GitHub](https://github.com/surveydown-dev/surveydown):

```{r}
#| eval: false
# install.packages("pak")
pak::pak('surveydown-dev/surveydown')
```

Load the package with:

```{r}
#| eval: false
```{r child="man/rmdchunks/todo.Rmd"}
library(surveydown)
```

You can also check which version you have installed:

```{r}
#| eval: false
surveydown::sd_version()
```

## Roadmap

See our [todo](https://github.com/surveydown-dev/todo) repo for a running list of things we're working on / have already added to the project.

## License

See the [License](https://github.com/surveydown-dev/surveydown/blob/master/LICENSE.md).
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ with [R](https://www.r-project.org/), [Quarto](https://quarto.org/),

<div align="center">

<center>
<img src='https://github.com/surveydown-dev/surveydown/blob/main/man/figures/technologies.png?raw=true' width="550px" alt="image showing the three technologies used in the surveydown platform along with their logos: quarto (for designing surveys), shiny (for rendering the survey), and supabase (for storing data)"/>
</center>

</div>

Expand Down
19 changes: 0 additions & 19 deletions man/rmdchunks/concept.Rmd

This file was deleted.

8 changes: 0 additions & 8 deletions man/rmdchunks/install_R_Quarto.Rmd

This file was deleted.

32 changes: 0 additions & 32 deletions man/rmdchunks/install_surveydown.Rmd

This file was deleted.

8 changes: 0 additions & 8 deletions man/rmdchunks/motivation.Rmd

This file was deleted.

1 change: 0 additions & 1 deletion man/rmdchunks/todo.Rmd

This file was deleted.

17 changes: 9 additions & 8 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
url: https://pkg.surveydown.org/
navbar:
structure:
left: [docs, reference, articles, tutorials, news]
right: [github]
components:
docs:
text: Documentation
href: https://www.surveydown.org/

home:
title: Build markdown-based surveys with quarto shiny documents

title: Markdown-Based Surveys Using R, Quarto, and Shiny
template:
bootstrap: 5
light-switch: true
Expand All @@ -15,18 +22,15 @@ template:
image:
src: https://pkg.surveydown.org/reference/figures/logo.png
alt: "Logo for the surveydown package"

reference:
- title: Survey Data
contents:
- sd_database
- sd_get_data

- title: Control Logic
contents:
- sd_show_if
- sd_skip_if

- title: Server
contents:
- sd_server
Expand All @@ -37,7 +41,6 @@ reference:
- sd_copy_value
- sd_get_url_pars
- sd_is_answered

- title: Survey UI
contents:
- sd_question
Expand All @@ -50,7 +53,6 @@ reference:
- sd_display_question
- sd_display_value
- sd_ui

- title: Utilities
contents:
- sd_create_survey
Expand All @@ -59,7 +61,6 @@ reference:
- sd_setup
- sd_add_page
- sd_add_question

- title: Version Control
contents:
- sd_version
143 changes: 0 additions & 143 deletions vignettes/surveydown.Rmd

This file was deleted.

0 comments on commit 50e927d

Please sign in to comment.