euporie.web.tabs.web

Defines a web-view tab.

Functions

get_app()

Get the current active (running) Application.

get_mime(path)

Attempt to determine the mime-type of a path.

Classes

Button(text, width, align, ...)

A clickable button widget which holds text.

Condition(func)

Turn any callable into a Filter.

DiBool([top, right, bottom, left])

A tuple of four bools with directions.

Dimension([min, max, weight, preferred])

Specified dimension (width/height) of a user control or window.

DisplayWindow(*args, **kwargs)

A window sub-class which can scroll left and right.

FocusedStyle(body[, style_focus, style_hover])

Apply a style to child containers when focused or hovered.

HSplit(children[, window_too_small, align, ...])

Several layouts, one stacked above/under the other.

MarginContainer(margin, target)

A container which renders a stand-alone margin.

ScrollbarMargin([display_arrows, ...])

Margin displaying a scrollbar.

Tab(app[, path])

Base class for interface tabs.

Text([text, style, height, min_height, ...])

A text input widget.

UPath(*args[, protocol])

VSplit(children[, window_too_small, align, ...])

Several layouts, one stacked left/right of the other.

WebTab(app, path)

Tab class for displaying files.

WebViewControl([url, link_handler])

Web view displays.

class euporie.web.tabs.web.WebTab(app: BaseApp, path: Path | None)

Bases: Tab

Tab class for displaying files.

close(cb: Callable | None = None) None

Close a tab with a callback.

Parameters:

cb – A function to call after the tab is closed.

container: AnyContainer
file_extensions: ClassVar[dict[str, None]] = {}
focus() None

Focus the webview when this tab is focused.

load_container() AnyContainer

Abcract method for loading the notebook’s main container.

load_url(url: str | Path, new_tab: bool = False, **kwargs: Any) bool

Load a new URL, or the URL in the address-bar.

mime_types: ClassVar[set[str]] = {'text/html', 'text/markdown'}
name: str | None = 'Web Viewer'
reset() None

Reset the state of the tab.

save(path: Path | None = None, cb: Callable | None = None) None

Save the current file.

property title: str

Return the tab title.

weight: int = 2
write_file(path: Path) None

Write the tab’s data to a path.

Not implement in the base tab.

Parameters:

path – An path at which to save the file