| Title: | 'Ace' and 'Monaco' Editors Bindings for 'shiny' Application |
|---|---|
| Description: | 'Ace' and 'Monaco' editor bindings to enable a rich text widget within 'shiny' application and provide more features, e.g. text comparison, spell checking and an extra 'SAS' code highlight mode. |
| Authors: | zearoby [aut, cre] |
| Maintainer: | zearoby <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-05-26 06:12:18 UTC |
| Source: | https://github.com/zearoby/shinyeditor |
Render an Ace diff editor on an application page.
aceDiffEditor( valueA, valueB, mode = "ace/mode/text", enableSpellCheck = FALSE, ..., width = NULL, height = NULL, elementId = NULL )aceDiffEditor( valueA, valueB, mode = "ace/mode/text", enableSpellCheck = FALSE, ..., width = NULL, height = NULL, elementId = NULL )
valueA |
character: Set text to first editor when initializing |
valueB |
character: Set text to second editor when initializing |
mode |
character: The Ace |
enableSpellCheck |
logical: Enable check typo of spelling |
... |
For more |
width |
integer, character: Width in pixels (optional, defaults to automatic sizing) |
height |
integer, character: Height in pixels (optional, defaults to automatic sizing) |
elementId |
character: An element id for the widget (a random character by default) |
Widget for shiny application
if(interactive()){ shinyEditor::aceDiffEditor(valueA = "text1", valueB = "text2") }if(interactive()){ shinyEditor::aceDiffEditor(valueA = "text1", valueB = "text2") }
Output and render functions for using aceDiffEditor within Shiny applications and interactive Rmd documents.
aceDiffEditorOutput(outputId, width = "100%", height = "400px") renderAceDiffEditor(expr, env = parent.frame(), quoted = FALSE)aceDiffEditorOutput(outputId, width = "100%", height = "400px") renderAceDiffEditor(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width, height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a aceDiffEditor |
env |
The environment in which to evaluate |
quoted |
Is |
htmlwidgets::shinyWidgetOutput
htmlwidgets::shinyRenderWidget
Render an Ace editor on an application page.
aceEditor( value, enableBasicAutocompletion = TRUE, enableSnippets = TRUE, enableLiveAutocompletion = TRUE, enableSpellCheck = FALSE, fontFamily = "Consolas", fontSize = 16, highlightActiveLine = TRUE, mode = "ace/mode/text", newLineMode = "auto", placeholder = NULL, printMarginColumn = 120, readOnly = FALSE, scrollPastEnd = 0.5, showInvisibles = TRUE, showLineNumbers = TRUE, showPrintMargin = TRUE, showStatusBar = TRUE, tabSize = 4, theme = "ace/theme/xcode", useSoftTabs = TRUE, wrap = FALSE, ..., width = NULL, height = NULL, elementId = NULL )aceEditor( value, enableBasicAutocompletion = TRUE, enableSnippets = TRUE, enableLiveAutocompletion = TRUE, enableSpellCheck = FALSE, fontFamily = "Consolas", fontSize = 16, highlightActiveLine = TRUE, mode = "ace/mode/text", newLineMode = "auto", placeholder = NULL, printMarginColumn = 120, readOnly = FALSE, scrollPastEnd = 0.5, showInvisibles = TRUE, showLineNumbers = TRUE, showPrintMargin = TRUE, showStatusBar = TRUE, tabSize = 4, theme = "ace/theme/xcode", useSoftTabs = TRUE, wrap = FALSE, ..., width = NULL, height = NULL, elementId = NULL )
value |
character: Set text to editor when initializing |
enableBasicAutocompletion |
logical: Enable basic code automatically completion when editing |
enableSnippets |
logical: Enable code snippets automatically completion when editing |
enableLiveAutocompletion |
logical: Enable live code automatically completion when editing |
enableSpellCheck |
logical: Enable check typo of spelling |
fontFamily |
character: System font name |
fontSize |
integer: Font size |
highlightActiveLine |
logical: Highlight the current line |
mode |
character: The Ace |
newLineMode |
character: Set the end of line character Valid values: windows, unix, auto |
placeholder |
character: A string to use a placeholder when the editor has no content |
printMarginColumn |
integer: The print margin column width |
readOnly |
logical: Set editor to readOnly |
scrollPastEnd |
integer: Scroll past end Valid values: 0 to 1, TRUE, FALSE |
showInvisibles |
logical: Show invisible characters |
showLineNumbers |
logical: Show line number area |
showPrintMargin |
logical: Show print margin |
showStatusBar |
logical: Show statusBar |
tabSize |
integer: Tab size |
theme |
character: The Ace |
useSoftTabs |
logical: Replace tabs by spaces |
wrap |
logical: If set to |
... |
For more |
width |
integer, character: Width in pixels (optional, defaults to automatic sizing) |
height |
integer, character: Height in pixels (optional, defaults to automatic sizing) |
elementId |
character: An element id for the widget (a random character by default) |
Widget for shiny application
if(interactive()){ shinyEditor::aceEditor(value = "text") }if(interactive()){ shinyEditor::aceEditor(value = "text") }
Output and render functions for using aceEditor within Shiny applications and interactive Rmd documents.
aceEditorOutput(outputId, width = "100%", height = "400px") renderAceEditor(expr, env = parent.frame(), quoted = FALSE)aceEditorOutput(outputId, width = "100%", height = "400px") renderAceEditor(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width, height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a aceEditor |
env |
The environment in which to evaluate |
quoted |
Is |
htmlwidgets::shinyWidgetOutput
htmlwidgets::shinyRenderWidget
Add completer to editor.completers. Please refer to https://ace.c9.io/api/interfaces/ace.Ace.Completer.html
appendAceCompleter( outputId, id, completer, session = shiny::getDefaultReactiveDomain() )appendAceCompleter( outputId, id, completer, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The element id of the first editor |
id |
list: Completer id |
completer |
list: Completer list |
session |
environment: The Shiny session object for the editor (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::appendAceCompleter( outputId = "editor", id = "custom_completer", completer = list( list(value = "function", caption = "function", meta = "keyword"), list(value = "if", caption = "if", meta = "keyword"), list(value = "else", caption = "else", meta = "keyword"), list(value = "for", caption = "for", meta = "keyword"), list(value = "while", caption = "while", meta = "keyword"), list(value = "console.log()", caption = "console.log", meta = "function"), list(value = "myCustomFunction()", caption = "myCustomFunction", meta = "custom") ) ) }if(interactive()){ shinyEditor::appendAceCompleter( outputId = "editor", id = "custom_completer", completer = list( list(value = "function", caption = "function", meta = "keyword"), list(value = "if", caption = "if", meta = "keyword"), list(value = "else", caption = "else", meta = "keyword"), list(value = "for", caption = "for", meta = "keyword"), list(value = "while", caption = "while", meta = "keyword"), list(value = "console.log()", caption = "console.log", meta = "function"), list(value = "myCustomFunction()", caption = "myCustomFunction", meta = "custom") ) ) }
Check outputId is character and exist in shiny session
check_output_id(outputId)check_output_id(outputId)
outputId |
character: The id of the table to be manipulated |
Create diff view for exist editors
createAceDiffView( editorAId, editorBId, sessionA = shiny::getDefaultReactiveDomain(), sessionB = shiny::getDefaultReactiveDomain() )createAceDiffView( editorAId, editorBId, sessionA = shiny::getDefaultReactiveDomain(), sessionB = shiny::getDefaultReactiveDomain() )
editorAId |
character: The element id of the first editor |
editorBId |
character: The element id of the second editor |
sessionA |
environment: The Shiny session object for the first editor (from the server function of the Shiny app). |
sessionB |
environment: The Shiny session object for the second editor (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::createAceDiffView(editorAId = "editor1", editorBId = "editor2") }if(interactive()){ shinyEditor::createAceDiffView(editorAId = "editor1", editorBId = "editor2") }
Create monaco diff view for exist editors in an exist widget
createMonacoDiffView( editorAId, editorBId, elementId, sessionA = shiny::getDefaultReactiveDomain(), sessionB = shiny::getDefaultReactiveDomain() )createMonacoDiffView( editorAId, editorBId, elementId, sessionA = shiny::getDefaultReactiveDomain(), sessionB = shiny::getDefaultReactiveDomain() )
editorAId |
character: The element id of the first editor |
editorBId |
character: The element id of the second editor |
elementId |
character: The element id of the exist widget to show monacoDiffEditor |
sessionA |
environment: The Shiny session object for the first editor (from the server function of the Shiny app) |
sessionB |
environment: The Shiny session object for the second editor (from the server function of the Shiny app) |
No return value, called for side effects
if(interactive()){ shinyEditor::createMonacoDiffView(editorAId = "editor1", editorBId = "editor2") }if(interactive()){ shinyEditor::createMonacoDiffView(editorAId = "editor1", editorBId = "editor2") }
Get cursor position in aceEditor
getAceCursorPosition(outputId, session = shiny::getDefaultReactiveDomain())getAceCursorPosition(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
List of cursor position
if(interactive()){ shinyEditor::getAceCursorPosition(outputId = "editor") }if(interactive()){ shinyEditor::getAceCursorPosition(outputId = "editor") }
Gets all of the available modes available in the installed version
of ace editor. Modes are often the programming or markup language which will
be used in the editor and determine things like syntax highlighting and
code folding.
getAceModes()getAceModes()
List of all modes in Ace editor
Get selected text in aceEditor
getAceSelectedText(outputId, session = shiny::getDefaultReactiveDomain())getAceSelectedText(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
Character of selected text
if(interactive()){ shinyEditor::getAceSelectedText(outputId = "editor") }if(interactive()){ shinyEditor::getAceSelectedText(outputId = "editor") }
Get selection range in aceEditor
getAceSelectionRange(outputId, session = shiny::getDefaultReactiveDomain())getAceSelectionRange(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
List of selection range
if(interactive()){ shinyEditor::getAceSelectionRange(outputId = "editor") }if(interactive()){ shinyEditor::getAceSelectionRange(outputId = "editor") }
Gets all of the available themes available in the installed version
of ace editor. Themes determine the styling and colors used in the editor.
getAceThemes()getAceThemes()
List of all themes in Ace editor
Get value in aceEditor
getAceValue(outputId, session = shiny::getDefaultReactiveDomain())getAceValue(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
Character of editor text
if(interactive()){ shinyEditor::getAceValue(outputId = "editor") }if(interactive()){ shinyEditor::getAceValue(outputId = "editor") }
Get cursor position in monacoEditor
getMonacoCursorPosition(outputId, session = shiny::getDefaultReactiveDomain())getMonacoCursorPosition(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
List of cursor position
if(interactive()){ shinyEditor::getMonacoCursorPosition(outputId = "editor") }if(interactive()){ shinyEditor::getMonacoCursorPosition(outputId = "editor") }
Gets all of the available modes available in the installed version
of ace editor. Modes are often the programming or markup language which will
be used in the editor and determine things like syntax highlighting and
code folding.
getMonacoLanguages()getMonacoLanguages()
List of all languages in Monaco editor
Get selected text in monacoEditor
getMonacoSelectedText(outputId, session = shiny::getDefaultReactiveDomain())getMonacoSelectedText(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
Character of selected text
if(interactive()){ shinyEditor::getMonacoSelectedText(outputId = "editor") }if(interactive()){ shinyEditor::getMonacoSelectedText(outputId = "editor") }
Get selection range in monacoEditor
getMonacoSelectionRange(outputId, session = shiny::getDefaultReactiveDomain())getMonacoSelectionRange(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
List of selection range
if(interactive()){ shinyEditor::getMonacoSelectionRange(outputId = "editor") }if(interactive()){ shinyEditor::getMonacoSelectionRange(outputId = "editor") }
Gets all of the available themes available in the installed version
of monaco editor. Themes determine the styling and colors used in the editor.
getMonacoThemes()getMonacoThemes()
List of all themes in Monaco editor
Get value in monacoEditor
getMonacoValue(outputId, session = shiny::getDefaultReactiveDomain())getMonacoValue(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
Character of editor text
if(interactive()){ shinyEditor::getMonacoValue(outputId = "editor") }if(interactive()){ shinyEditor::getMonacoValue(outputId = "editor") }
Get status of shinyEditor package.
getPackageStatus()getPackageStatus()
List of package name, package version, package date, Ace editor version, Monaco editor version
shinyEditor::getPackageStatus()shinyEditor::getPackageStatus()
Get system font families
getSystemFontFamilies()getSystemFontFamilies()
List of system font families
Render an Ace diff editor on an application page.
monacoDiffEditor( valueA, valueB, language = "plaintext", ignoreTrimWhitespace = FALSE, ..., width = NULL, height = NULL, elementId = NULL )monacoDiffEditor( valueA, valueB, language = "plaintext", ignoreTrimWhitespace = FALSE, ..., width = NULL, height = NULL, elementId = NULL )
valueA |
character: Set text to first editor when initializing |
valueB |
character: Set text to second editor when initializing |
language |
character: The initial language of the auto created model in the editor. To not automatically create a model, use model: null |
ignoreTrimWhitespace |
logical: Compute the diff by ignoring leading/trailing whitespace Defaults to false |
... |
For more arguments, please refer to https://microsoft.github.io/monaco-editor/typedoc/interfaces/editor_editor_api.editor.IDiffEditorOptions.html |
width |
integer, character: Width in pixels (optional, defaults to automatic sizing) |
height |
integer, character: Height in pixels (optional, defaults to automatic sizing) |
elementId |
character: An element id for the widget (a random character by default) |
Widget for shiny application
if(interactive()){ shinyEditor::monacoDiffEditor(valueA = "text1", valueB = "text2") }if(interactive()){ shinyEditor::monacoDiffEditor(valueA = "text1", valueB = "text2") }
Output and render functions for using monacoDiffEditor within Shiny applications and interactive Rmd documents.
monacoDiffEditorOutput(outputId, width = "100%", height = "400px") renderMonacoDiffEditor(expr, env = parent.frame(), quoted = FALSE)monacoDiffEditorOutput(outputId, width = "100%", height = "400px") renderMonacoDiffEditor(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width, height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a monacoDiffEditor |
env |
The environment in which to evaluate |
quoted |
Is |
htmlwidgets::shinyWidgetOutput
htmlwidgets::shinyRenderWidget
Render an Monaco editor on an application page.
monacoEditor( value, enableSpellCheck = FALSE, fontFamily = "Consolas", fontSize = 16, insertSpaces = TRUE, language = "plaintext", lineNumbers = "on", placeholder = NULL, readOnly = FALSE, renderWhitespace = "boundary", rulers = list(80, 100, 120), scrollBeyondLastLine = TRUE, showStatusBar = TRUE, tabSize = 4, theme = "vs", wordWrap = "off", automaticLayout = TRUE, ..., width = NULL, height = NULL, elementId = NULL )monacoEditor( value, enableSpellCheck = FALSE, fontFamily = "Consolas", fontSize = 16, insertSpaces = TRUE, language = "plaintext", lineNumbers = "on", placeholder = NULL, readOnly = FALSE, renderWhitespace = "boundary", rulers = list(80, 100, 120), scrollBeyondLastLine = TRUE, showStatusBar = TRUE, tabSize = 4, theme = "vs", wordWrap = "off", automaticLayout = TRUE, ..., width = NULL, height = NULL, elementId = NULL )
value |
character: Set text to editor when initializing |
enableSpellCheck |
logical: Enable check typo of spelling |
fontFamily |
character: The font family |
fontSize |
integer: The font size |
insertSpaces |
logical: Insert spaces when pressing Tab. This setting is overridden based on the file contents when detectIndentation is on. Defaults to true. |
language |
character: The initial language of the auto created model in the editor. To not automatically create a model, use model: null. |
lineNumbers |
character, integer: Control the rendering of line numbers. If it is a function, it will be invoked when rendering a line number and the return value will be rendered. Otherwise, if it is a truthy, line numbers will be rendered normally (equivalent of using an identity function). Otherwise, line numbers will not be rendered. Defaults to on. |
placeholder |
character: Sets a placeholder for the editor. If set, the placeholder is shown if the editor is empty. |
readOnly |
logical: Should the editor be read only. See also domReadOnly. Defaults to false. |
renderWhitespace |
character: Enable rendering of whitespace. Defaults to 'selection'. Valid values: "all" | "none" | "boundary" | "selection" | "trailing" |
rulers |
list: Render vertical lines at the specified columns. Defaults to empty list. |
scrollBeyondLastLine |
logical: Enable that scrolling can go one screen size after the last line. Defaults to true. |
showStatusBar |
logical: Show statusBar |
tabSize |
integer: The number of spaces a tab is equal to. This setting is overridden based on the file contents when detectIndentation is on. Defaults to 4. |
theme |
character: Initial theme to be used for rendering. The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black', 'hc-light. You can create custom themes via monaco.editor.defineTheme. To switch a theme, use monaco.editor.setTheme. NOTE: The theme might be overwritten if the OS is in high contrast mode, unless autoDetectHighContrast is set to false. |
wordWrap |
character: Control the wrapping of the editor. When wordWrap = "off", the lines will never wrap. When wordWrap = "on", the lines will wrap at the viewport width. When wordWrap = "wordWrapColumn", the lines will wrap at wordWrapColumn. When wordWrap = "bounded", the lines will wrap at min(viewport width, wordWrapColumn). Defaults to "off". Valid values: "off" | "on" | "wordWrapColumn" | "bounded" |
automaticLayout |
logical: Enable that the editor will install a ResizeObserver to check if its container dom node size has changed. Defaults to TRUE. |
... |
For more arguments, please refer to https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor_editor_api.editor.IStandaloneEditorConstructionOptions.html |
width |
integer, character: Width in pixels (optional, defaults to automatic sizing) |
height |
integer, character: Height in pixels (optional, defaults to automatic sizing) |
elementId |
character: An element id for the widget (a random character by default) |
Widget for shiny application
if(interactive()){ shinyEditor::monacoEditor(value = "text") }if(interactive()){ shinyEditor::monacoEditor(value = "text") }
Output and render functions for using monacoEditor within Shiny applications and interactive Rmd documents.
monacoEditorOutput(outputId, width = "100%", height = "400px") renderMonacoEditor(expr, env = parent.frame(), quoted = FALSE)monacoEditorOutput(outputId, width = "100%", height = "400px") renderMonacoEditor(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width, height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a monacoEditor |
env |
The environment in which to evaluate |
quoted |
Is |
htmlwidgets::shinyWidgetOutput
htmlwidgets::shinyRenderWidget
Fires upon aceEditor initialisation
onAceEditorReady(outputId, session = shiny::getDefaultReactiveDomain())onAceEditorReady(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
TRUE
if(interactive()){ shinyEditor::onAceEditorReady(outputId = "editor") }if(interactive()){ shinyEditor::onAceEditorReady(outputId = "editor") }
Fires upon monacoEditor initialisation
onMonacoEditorReady(outputId, session = shiny::getDefaultReactiveDomain())onMonacoEditorReady(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
TRUE
if(interactive()){ shinyEditor::onMonacoEditorReady(outputId = "editor") }if(interactive()){ shinyEditor::onMonacoEditorReady(outputId = "editor") }
Remove completer in editor.completers. Please refer to https://ace.c9.io/api/interfaces/ace.Ace.Completer.html
removeAceCompleter(outputId, id, session = shiny::getDefaultReactiveDomain())removeAceCompleter(outputId, id, session = shiny::getDefaultReactiveDomain())
outputId |
character: The element id of the first editor |
id |
list: Completer id |
session |
environment: The Shiny session object for the editor (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::removeAceCompleter(outputId = "editor", id = "custom_completer") }if(interactive()){ shinyEditor::removeAceCompleter(outputId = "editor", id = "custom_completer") }
Remove ace diff view for exist editors
removeAceDiffView(outputId, session = shiny::getDefaultReactiveDomain())removeAceDiffView(outputId, session = shiny::getDefaultReactiveDomain())
outputId |
character: The element id of the first editor |
session |
environment: The Shiny session object for the editor (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::removeAceDiffView(outputId = "editor") }if(interactive()){ shinyEditor::removeAceDiffView(outputId = "editor") }
Remove monaco diff view for exist editors
removeMonacoDiffView(elementId)removeMonacoDiffView(elementId)
elementId |
character: The element id of the monacoDiffEditor |
No return value, called for side effects
if(interactive()){ shinyEditor::removeMonacoDiffView(elementId = "editor1") }if(interactive()){ shinyEditor::removeMonacoDiffView(elementId = "editor1") }
Enable or disable code completion in aceEditor
setAceEnableAutocompletion( outputId, enable, session = shiny::getDefaultReactiveDomain() )setAceEnableAutocompletion( outputId, enable, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
enable |
logical: TRUE or FALSE |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceEnableAutocompletion(outputId = "editor", enable = TRUE) }if(interactive()){ shinyEditor::setAceEnableAutocompletion(outputId = "editor", enable = TRUE) }
Enable or disable spell check
setAceEnableSpellCheck( outputId, enable = TRUE, session = shiny::getDefaultReactiveDomain() )setAceEnableSpellCheck( outputId, enable = TRUE, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
enable |
logical: Set spell check TRUE or FALSE |
session |
environment: The Shiny session object for the editor (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceEnableSpellCheck(outputId = "editor", enable = TRUE) }if(interactive()){ shinyEditor::setAceEnableSpellCheck(outputId = "editor", enable = TRUE) }
Determines whether or not the current line should be highlighted.
setAceHighlightActiveLine( outputId, visible, session = shiny::getDefaultReactiveDomain() )setAceHighlightActiveLine( outputId, visible, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
visible |
logical: TRUE or FALSE |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceHighlightActiveLine(outputId = "editor", visible = TRUE) }if(interactive()){ shinyEditor::setAceHighlightActiveLine(outputId = "editor", visible = TRUE) }
Show or hide line number area in aceEditor
setAceLineNumbersVisible( outputId, visible, session = shiny::getDefaultReactiveDomain() )setAceLineNumbersVisible( outputId, visible, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
visible |
logical: TRUE or FALSE |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceLineNumbersVisible(outputId = "editor", visible = TRUE) }if(interactive()){ shinyEditor::setAceLineNumbersVisible(outputId = "editor", visible = TRUE) }
Set a new mode for the EditSession.
setAceMode(outputId, mode, session = shiny::getDefaultReactiveDomain())setAceMode(outputId, mode, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
mode |
character: The mode of the code language |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceMode(outputId = "editor", mode = "r") }if(interactive()){ shinyEditor::setAceMode(outputId = "editor", mode = "r") }
Set the new line mode to aceEditor
setAceNewLineMode( outputId, newLineMode, session = shiny::getDefaultReactiveDomain() )setAceNewLineMode( outputId, newLineMode, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
newLineMode |
character: The new line mode in aceEditor Valid values: windows, unix, auto |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceNewLineMode(outputId = "editor", newLineMode = "windows") }if(interactive()){ shinyEditor::setAceNewLineMode(outputId = "editor", newLineMode = "windows") }
Set an option to aceEditor
setAceOption( outputId, name, value, session = shiny::getDefaultReactiveDomain() )setAceOption( outputId, name, value, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
name |
character: Option name. Refer to https://ace.c9.io/api/interfaces/ace.Ace.EditorOptions.html |
value |
character, integer, logical: Option value. Refer to https://ace.c9.io/api/interfaces/ace.Ace.EditorOptions.html |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceOption(outputId = "editor", name = "tabSize", value = 3) }if(interactive()){ shinyEditor::setAceOption(outputId = "editor", name = "tabSize", value = 3) }
Set options to aceEditor
setAceOptions(outputId, options, session = shiny::getDefaultReactiveDomain())setAceOptions(outputId, options, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
options |
list: Editor options. Refer to https://ace.c9.io/api/interfaces/ace.Ace.EditorOptions.html |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceOptions(outputId = "editor", options = list()) }if(interactive()){ shinyEditor::setAceOptions(outputId = "editor", options = list()) }
If readOnly is true, then the editor is set to read-only mode, and none of the content can change.
setAceReadOnly(outputId, readOnly, session = shiny::getDefaultReactiveDomain())setAceReadOnly(outputId, readOnly, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
readOnly |
logical: TRUE or FALSE |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceReadOnly(outputId = "editor", readOnly = TRUE) }if(interactive()){ shinyEditor::setAceReadOnly(outputId = "editor", readOnly = TRUE) }
Show or hide invisible characters in aceEditor
setAceShowInvisibles( outputId, visible, session = shiny::getDefaultReactiveDomain() )setAceShowInvisibles( outputId, visible, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
visible |
logical: TRUE or FALSE |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceShowInvisibles(outputId = "editor", visible = TRUE) }if(interactive()){ shinyEditor::setAceShowInvisibles(outputId = "editor", visible = TRUE) }
Show or hide the statusBar of aceEditor
setAceStatusBarVisible( outputId, visible, session = shiny::getDefaultReactiveDomain() )setAceStatusBarVisible( outputId, visible, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
visible |
logical: TRUE or FALSE |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceStatusBarVisible(outputId = "editor", visible = TRUE) }if(interactive()){ shinyEditor::setAceStatusBarVisible(outputId = "editor", visible = TRUE) }
Set a new theme for the editor. theme should exist, like ace/theme/github
setAceTheme(outputId, theme, session = shiny::getDefaultReactiveDomain())setAceTheme(outputId, theme, session = shiny::getDefaultReactiveDomain())
outputId |
character: The id of the editor |
theme |
character: The theme of the aceEditor |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceTheme(outputId = "editor", theme = "ace/theme/github") }if(interactive()){ shinyEditor::setAceTheme(outputId = "editor", theme = "ace/theme/github") }
Replace all the lines in the current Document with the value of text.
setAceValue( outputId, value, clearChangedHistory = FALSE, session = shiny::getDefaultReactiveDomain() )setAceValue( outputId, value, clearChangedHistory = FALSE, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
value |
character: The text of the editor |
clearChangedHistory |
logical: Clear undo/redo history |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setAceValue(outputId = "editor", value = "text") }if(interactive()){ shinyEditor::setAceValue(outputId = "editor", value = "text") }
Enable or disable spell check
setMonacoEnableSpellCheck( outputId, enable = TRUE, session = shiny::getDefaultReactiveDomain() )setMonacoEnableSpellCheck( outputId, enable = TRUE, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
enable |
logical: Set spell check TRUE or FALSE |
session |
environment: The Shiny session object for the editor (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setMonacoEnableSpellCheck(outputId = "editor", enable = TRUE) }if(interactive()){ shinyEditor::setMonacoEnableSpellCheck(outputId = "editor", enable = TRUE) }
Set language to monaco editor
setMonacoLanguage( outputId, language, session = shiny::getDefaultReactiveDomain() )setMonacoLanguage( outputId, language, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
language |
character: The highlight of code |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setMonacoLanguage(outputId = "editor", language = "text") }if(interactive()){ shinyEditor::setMonacoLanguage(outputId = "editor", language = "text") }
Set a new theme for the editor. theme should exist, like vs-dark
setMonacoTheme(theme)setMonacoTheme(theme)
theme |
character: The theme of the monacoEditor |
No return value, called for side effects
if(interactive()){ shinyEditor::setMonacoTheme(theme = "vs") }if(interactive()){ shinyEditor::setMonacoTheme(theme = "vs") }
Replace all the lines in the current Document with the value of text.
setMonacoValue( outputId, value, clearChangedHistory = FALSE, session = shiny::getDefaultReactiveDomain() )setMonacoValue( outputId, value, clearChangedHistory = FALSE, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
value |
character: The text of the editor |
clearChangedHistory |
logical: Clear undo/redo history |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::setMonacoValue(outputId = "editor", value = "text") }if(interactive()){ shinyEditor::setMonacoValue(outputId = "editor", value = "text") }
Update an option to monacoEditor
updateMonacoOption( outputId, name, value, session = shiny::getDefaultReactiveDomain() )updateMonacoOption( outputId, name, value, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
name |
character: Option name. Refer to https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor_editor_api.editor.IEditorOptions.html |
value |
character, integer, logical: Option value. Refer to https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor_editor_api.editor.IEditorOptions.html |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::updateMonacoOption(outputId = "editor", name = "tabSize", value = 3) }if(interactive()){ shinyEditor::updateMonacoOption(outputId = "editor", name = "tabSize", value = 3) }
Update options to monacoEditor
updateMonacoOptions( outputId, options, session = shiny::getDefaultReactiveDomain() )updateMonacoOptions( outputId, options, session = shiny::getDefaultReactiveDomain() )
outputId |
character: The id of the editor |
options |
list: monaco editor options. Refer to https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor_editor_api.editor.IEditorOptions.html |
session |
environment: The Shiny session object (from the server function of the Shiny app). |
No return value, called for side effects
if(interactive()){ shinyEditor::updateMonacoOptions(outputId = "editor", options = list()) }if(interactive()){ shinyEditor::updateMonacoOptions(outputId = "editor", options = list()) }