Input, validate and return DOIs in a shiny app.

doiEntryApp()

doiEntryUI(id, translator = NULL, width = "100%", height = "200px")

doiEntryServer(
  id,
  example_dois = doi_examples(),
  char_limit = 900L,
  translator = NULL,
  lang = shiny::reactive("en"),
  millis = 500L
)

doi_entry_translator()

Arguments

id

The id string to be namespaced (optional).

translator

A shiny.i18n::Translator object or NULL for english-only defaults. Strings inside the module UI are marked as translateable. You can pass a translator object included in the package, or can create your own translator using shiny.i18n::Translator. This must not be a reactive, it is only set at shiny startup. To update the language reactively during a shiny session, see lang.

width

The width of the input, e.g. '400px', or '100%'; see validateCssUnit().

height

The height of the input, e.g. '400px', or '100%'; see validateCssUnit().

example_dois

A vector created by, or convertable to doi(), to be used as as examples. To initiate the UI with the example, pass them to doiEntryUI().

char_limit

Integer scalar, giving the maximum number of characters. To protect shiny against overlong strings, you can limit the maximum length of strings allowed. This limit is still enforced server-side, not client-side, so the protection is not bullet-proof.

lang

a reactive variable, returning a character scalar. Must be one of the languages in translator. Defaults to shiny::reactive("en"), in which case no server side translation is triggered.

millis

The debounce/throttle time window. You may optionally pass a no-arg function or reactive expression instead, e.g. to let the end-user control the time window.

Value

An object of class biblids_doi as returned by doi().

a shiny.i18n::Translator object.

Functions

  • doiEntryApp: Test app

  • doiEntryUI: Module UI

  • doiEntryServer: Module server

  • doi_entry_translator: Translator Translations shipping with the package, including en, de.

    To find the keys you need to include in your own translations, look at biblids::doi_entry_translator()$translations().

See also