MyNixOS website logo
Description

Shiny Module for a Markdown Input with Result Preview.

An R-Shiny module containing a "markdownInput". This input allows the user to write some markdown code and to preview the result. This input has been inspired by the "comment" window of <https://github.com/>.

Package "markdownInput"

This directory contains the "markdownInput" package for the R programming language. This package is a R-Shiny module providing a Shiny input to write some markdown code and to preview the result. This input has been inspired by the "comment" window of https://github.com/.

Installation

To install this package, the easiest is to directly install the package from GitHub:

In your R console:

install.package("devtools")
devtools::install_github("juliendiot42/markdownInput")

Once the package is installed, start using it:

In your R console:

library(markdownInput)
help(package=markdownInput)

Example

Once you have downloaded the package, you can run an example app:

In your R console:

markdownInput::runExample()

Usage

UI

In the UI part of your app you should call the markdownInput function.

For example:

ui <- fluidPage(titlePanel("Markdown input"),
                 sidebarLayout(
                   # inputs:
                   sidebarPanel(
                     markdownInput(
                       "mdInputID",
                       label = "Write your text",
                       value = "Write some _markdown_ **here:**"
                       )
                   ),

                   # outputs:
                   mainPanel(
                   h3("Raw value of the input:"),
                   verbatimTextOutput("rawResult"))
                 ))

Server

You can access to the input's value in the server side by calling the module:

server <- function(input, output, session) {
    # myText is a reactive variable containing the raw markdown text
    myText <- callModule(moduleMarkdownInput, "mdInputID")

    # show "myText"
    output$rawResult <- renderPrint({
        print(myText())
    })
}

Issues

When encountering a problem with the package, you can report issues on GitHub directly here.

Contributing

You can contribute in various ways:

  • report an issue (online, see the above section);

  • suggest improvements (in the same way as issues);

  • propose a pull request (after creating a new branch).

Citation

I invest some time and effort to create this package. Please cite it when using it:

In your R console:

citation("markdownInput")

See also citation() for citing R itself.

References

  • shinyAce: Vincent Nijs, Forest Fang, Trestle Technology, LLC and Jeff Allen (2019). shinyAce: Ace Editor Bindings for Shiny.

  • shiny: Winston Chang, Joe Cheng, JJ Allaire, Yihui Xie and Jonathan McPherson (2018). shiny: Web Application Framework for R.

  • markdown: JJ Allaire, Jeffrey Horner, Yihui Xie, Vicent Marti and Natacha Porte (2018). markdown: 'Markdown' Rendering for R.

Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows