Skip to content
/ faq Public

This is package is to create a FAQ (Frequently Asked Questions) page for Shiny application with desired data.frame.

License

Notifications You must be signed in to change notification settings

jienagu/faq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9745645 · Mar 6, 2023

History

34 Commits
Jan 24, 2021
Jan 24, 2021
Jan 24, 2021
Jul 13, 2020
Jul 6, 2020
Jan 24, 2021
Jul 6, 2020
Jan 24, 2021
Jan 24, 2021
Jul 6, 2020
Jul 6, 2020
Jan 24, 2021
Jul 6, 2020
Mar 6, 2023
Jan 24, 2021
Jul 6, 2020
Jan 24, 2021
Jan 24, 2021

Repository files navigation

faq

CRAN_Status_Badge Rdoc Download

This is package is to create a FAQ (Frequently Asked Questions) page for Shiny application with desired data.frame.

Live podcast tutorial on 25:33 : https://shinydevseries.com/post/episode-16-jmclellan/

Installation

from CRAN

install.packages("faq")

Dev version

devtools::install_github("jienagu/faq")

Introduction

Simply create a data frame with question column and answer column. Then put this data frame into faq() function, we will get a nice FAQ page.

library(faq)
df <- data.frame(
  question = c("Question1", "Question2", "Question3"),
  answer = c("answer for question1", 
             "question2 answer", 
             "answer3")
)
faq::faq(data = df, elementId = "faq", faqtitle = "Frequently Asked Questions")

demo_gif

NEWS

faq 0.1.1

  • Add expand_all_button_text (customizing text on expand all button) and collapse_all_button_text (customizing text on collapse all button) arguments

  • Add content_background_color arguments for customizing answer background color

See example:

library(faq)
df <- data.frame(
  question = c("Question1", "Question2", "Question3"),
  answer = c("answer for question1", 
             "question2 answer", 
             "answer3")
)
faq::faq(data = df, elementId = "faq", faqtitle = "Frequently Asked Questions",
         expand_all_button_text = "+ montrer tout", 
         collapse_all_button_text = "- cacher tout",
         content_background_color = "#f0f0f0")

All questions and answers are rendered as innerHTML() so we can embed any html tag including images. See example

df <- data.frame(
  question = c("Question1", "Question2", "Question3"),
  answer = c("Répondre <b>key word</b>", 
             "Répondre 2 <img src=\"https://media.giphy.com/media/oF5oUYTOhvFnO/giphy.gif\">", 
             "Répondre 3")
)
faq::faq(data = df, elementId = "faq", faqtitle = "Questions fréquemment posées",
         expand_all_button_text = "+ montrer tout", 
         collapse_all_button_text = "- cacher tout",
         content_background_color = "white")

Inserting an image in answer:

library(faq)
df <- data.frame(
  question = c("Question1", "Question2", "Question3"),
  answer = c("Répondre <b>key word</b>",
             "Répondre 2 <img src=\"https://raw.githubusercontent.com/jienagu/faq/master/faq_logo.png\">",
             "Répondre 3")
)
faq::faq(data = df, elementId = "faq", faqtitle = "FAQ")

About

This is package is to create a FAQ (Frequently Asked Questions) page for Shiny application with desired data.frame.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published