HtmlTextEditor Module

class epyk.core.html.HtmlTextEditor.Cell(page: PageModel, vals: Union[list, str], language: str, width: tuple, height: tuple, html_code: Optional[str], options: Optional[dict], profile: Optional[Union[bool, dict]])
action(icon: str, js_funcs: Union[list, str], tooltip: Optional[str] = None)

Add a bespoke action to the action panel.

Parameters:
  • icon – The font awesome icon

  • js_funcs – The Javascript functions

  • tooltip – Optional. Text to be displayed when mouse is hover

run(js_funcs: Union[list, str], icon: str = 'play', tooltip: Optional[str] = None)

Emtpy run button.

This function will just add the icon on the actions panel.

Parameters:
  • icon – The font awesome icon

  • js_funcs – Optional. The Javascript functions

  • tooltip – Optional. Text to be displayed when mouse is hover

save(js_funcs: Union[list, str], icon: str = 'save', tooltip: Optional[str] = None)

Emtpy save button.

This function will just add the icon on the actions panel.

Parameters:
  • icon – The font awesome icon

  • js_funcs – Optional. The Javascript functions

  • tooltip – Optional. Text to be displayed when mouse is hover

class epyk.core.html.HtmlTextEditor.Code(page: PageModel, vals: str, color: str, width: tuple, height: tuple, html_code: Optional[str], options: Optional[dict], helper: str, profile: Optional[Union[bool, dict]])
property addon

The add-on directory in the distribution contains a number of reusable components that implement extra editor functionality.

Related Pages:

build(data: Optional[str] = None, options: Optional[dict] = None, profile: Optional[Union[bool, dict]] = None, component_id: Optional[str] = None)

This is a specific version of the common build as the function is not applied to the dom ID but the HTML code set as a proper global variable on the JavaScript side.

Parameters:
  • data – Optional. The component input data

  • options – Optional. Specific Python options available for this component.

  • profile – Optional. A flag to set the component performance storage.

  • component_id – Optional.

property dom: CodeMirror

Return all the Javascript functions defined for an HTML Component.

Those functions will use plain javascript by default.

Returns:

A Javascript Dom object

property editorId

Return the Javascript variable of the bespoke.

property js: CM

A lot of CodeMirror features are only available through its API.

Thus, you need to write code (or use add-ons) if you want to expose them to your users.

Related Pages:

loading(status: bool = True, label: str = 'Loading....')

Loading component on a chart.

Usage:

cd = page.ui.codes.code("javascript", "", height="500px")
cd.loading(label='<span>Problem with service link. Please try again later <a href="#" onClick="alert()">click here</a></span>'),
cd.build('''
  function testAlert(){
      alert("ok")
  }'''),
cd.loading(False)
Parameters:
  • status – Optional. Specific the status of the display of the loading component

  • label – Optional. Message to be displayed

property options: OptionsCode

Property to set all the possible object for a button.

placeholder(text: str)

Adds a placeholder option that can be used to make content appear in the editor when it is empty and not focused.

Parameters:

text – The text displayed if empty editor

property style: Code

Property to the Style property of the component.

class epyk.core.html.HtmlTextEditor.Console(page: PageModel, data: Union[str, list], width: tuple, height: tuple, html_code: Optional[str], helper: Optional[str], options: Optional[dict], profile: Optional[Union[bool, dict]])
property dom: Console

Return all the Javascript functions defined for an HTML Component.

Those functions will use plain javascript by default.

Returns:

A Javascript Dom object

property options: OptionsConsole

Property to the component options.

Options can either impact the Python side or the Javascript builder.

Python can pass some options to the JavaScript layer.

class epyk.core.html.HtmlTextEditor.Editor(page: PageModel, vals, language, width, height, html_code, options, profile)
action(icon: str, js_funcs: Union[list, str], tooltip: Optional[str] = None)

Add a bespoke action to the action panel.

Parameters:
  • icon – The font awesome icon

  • js_funcs – The Javascript functions

  • tooltip – Optional. Text to be displayed when mouse is hover

clear(js_funcs: Union[list, str], icon: str = 'remove', tooltip: Optional[str] = None)

Add an event action to the console object.

Parameters:
  • icon – The font awesome icon

  • js_funcs – Optional. The Javascript functions

  • tooltip – Optional. Text to be displayed when mouse is hover

copy(js_funcs: Union[list, str], icon: str = 'capture', tooltip: Optional[str] = None)

Copy the content of the editor component to the clipboard.

Parameters:
  • icon – The font awesome icon

  • js_funcs – Optional. The Javascript functions

  • tooltip – Optional. Text to be displayed when mouse is hover

property dom: Editor

Return all the Javascript functions defined for an HTML Component.

Those functions will use plain javascript by default.

Returns:

A Javascript Dom object

run(js_funcs: Union[list, str], icon: str = 'play', tooltip: Optional[str] = None)

Emtpy run button.

This function will just add the icon on the actions panel.

Parameters:
  • icon – The font awesome icon

  • js_funcs – Optional. The Javascript functions

  • tooltip – Optional. Text to be displayed when mouse is hover

save(js_funcs: Union[list, str], icon: str = 'save', tooltip: Optional[str] = None)

Emtpy save button.

This function will just add the icon on the actions panel.

Parameters:
  • icon – The font awesome icon

  • js_funcs – Optional. The Javascript functions

  • tooltip – Optional. Text to be displayed when mouse is hover

toggle(js_funcs: Union[list, str], icons: tuple = ('show', 'hide'), tooltip: Optional[str] = None)

Add an event action to the console object.

Parameters:
  • icons – The font awesome icon

  • js_funcs – Optional. The Javascript functions

  • tooltip – Optional. Text to be displayed when mouse is hover

class epyk.core.html.HtmlTextEditor.MarkdownReader(page: PageModel, vals: Union[str, list], width: tuple, height: tuple, html_code: Optional[str], options: Optional[dict], profile: Optional[Union[bool, dict]])
property dom: JsHtmlRich

Return all the Javascript functions defined for an HTML Component.

Those functions will use plain javascript available for a DOM element by default.

Usage:

div = page.ui.div(htmlCode="testDiv")
print(div.dom.content)
Returns:

A Javascript Dom object.

property options: OptionsText

Property to set all the input TimePicker component properties.

Related Pages:

tooltips(data: dict)

Add automatically tooltips to the words.

Parameters:

data – The list of word to be automatically changed

class epyk.core.html.HtmlTextEditor.Tags(page: PageModel, vals: list, title: str, icon: str, size: tuple, width: tuple, height: tuple, html_code: Optional[str], profile: Optional[Union[bool, dict]])
jsAdd(data)
Parameters:

data

jsEmpty()
property val