本文へスキップ

Markdown

保持型の Markdown を描画し、ストリーミング内容向けの差分更新にも対応します。

デモを読み込み中…

#インポート

go get github.com/egoist/quickgui/extensions/markdown github.com/egoist/quickgui/extensions/editor
import (
	"github.com/egoist/quickgui/extensions/editor"
	"github.com/egoist/quickgui/extensions/markdown"
	"github.com/egoist/quickgui/go/ui"
)

#使い方

func MarkdownExample(source string, streaming bool) *ui.Element {
	return markdown.View(markdown.Props{
		Value: source,
		Streaming: streaming,
		CodeBlockComponent: editor.HighlightedCodeBlock,
	}).Width("100%")
}

#API リファレンス

項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。

markdown.View

ソースを見る
markdown.View(props Props) *ui.Element
StyleStyleBuilder—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

StyleBuilder
ソースを見る
Childrenany—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

any
ソースを見る
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
ソースを見る
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnInputfunc(*native.Event)—

Receives edits from the text control. Write the new text into the controlled value.

func(*native.Event)
ソースを見る
OnSubmitfunc(*native.Event)—

Called when the control submits its current value.

func(*native.Event)
ソースを見る
OnDismissfunc(*native.Event)—

Reports toast identifiers dismissed by the core.

func(*native.Event)
ソースを見る
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnPresentationChangefunc(*native.Event)—

Callback for presentation change. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnSelectfunc(*native.Event)—

Reports the menu entry selected by the core.

func(*native.Event)
ソースを見る
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnMouseMovefunc(*native.Event)—

Callback for mouse move. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnWheelfunc(*native.Event)—

Callback for wheel. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnPinchfunc(*native.Event)—

Callback for pinch. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnRotatefunc(*native.Event)—

Callback for rotate. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnSmartMagnifyfunc(*native.Event)—

Callback for smart magnify. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnPressurefunc(*native.Event)—

Callback for pressure. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnActionfunc(*native.Event)—

Callback for action. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnDragStartfunc(*native.Event)—

Callback for drag start. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnDragEndfunc(*native.Event)—

Callback for drag end. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnDropfunc(*native.Event)—

Callback for drop. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnFilesDroppedfunc(*native.Event)—

Callback for files dropped. The signature below lists the event payload.

func(*native.Event)
ソースを見る
OnComponentChangefunc(*native.Event)—

Receives the component change payload, including values for coordinated controls.

func(*native.Event)
ソースを見る
OnCommitfunc(*native.Event)—

Reports one explicit commit boundary and its final value details.

func(*native.Event)
ソースを見る
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
ソースを見る
Valueany—

The current controlled value. Update application state from the change callback to accept a new value.

any
ソースを見る
Placeholderstring—

Hint displayed while the text value is empty.

string
ソースを見る
Multilinebool—

Allows multiple lines in the core text editor.

bool
ソースを見る
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
ソースを見る
Selectedany—

Exposes the selected state of this item.

any
ソースを見る
Groupany—

Names this element as a group for descendant interaction-state styling.

any
ソースを見る
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
ソースを見る
FocusableWhenDisabledany—

Allows a disabled button to remain keyboard focusable while activation stays disabled.

any
ソースを見る
HitSlopany—

Expands the pointer hit area without changing the visual bounds.

any
ソースを見る
HitSlopTopany—

Extra pointer hit area above the visual bounds.

any
ソースを見る
HitSlopRightany—

Extra pointer hit area to the right of the visual bounds.

any
ソースを見る
HitSlopBottomany—

Extra pointer hit area below the visual bounds.

any
ソースを見る
HitSlopLeftany—

Extra pointer hit area to the left of the visual bounds.

any
ソースを見る
Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
ソースを見る
Passwordany—

Conceals the entered text while preserving the editor’s value.

any
ソースを見る
EstimatedItemHeightany—

Initial logical row-height estimate used by virtualization.

any
ソースを見る
Overscanany—

Extra rows mounted before and after the visible range.

any
ソースを見る
OverscanPixelsany—

Extra logical distance mounted before and after the visible range.

any
ソースを見る
ItemHeightsany—

Exact row heights supplied without waiting for layout measurement.

any
ソースを見る
ListAlignmentstring—

Pins short list content to the top or bottom.

string
ソースを見る
FollowModestring—

Chooses ordinary scrolling or tail-following behavior.

string
ソースを見る
ObjectFitstring—

How image content fits its declared box.

string
ソースを見る
ShaderParametersany—

Up to sixteen numeric values packed into fixed shader parameter vectors.

any
ソースを見る
Invalidany—

Projects invalid state to the field and its parts.

any
ソースを見る
Roleany—

Accessibility role override. Prefer the component’s built-in semantics.

any
ソースを見る
TabIndexany—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

any
ソースを見る
Overlayany—

Places this content in the overlay paint plane.

any
ソースを見る
FocusTrapany—

Keeps keyboard focus within the active modal surface.

any
ソースを見る
RestorePreviousFocusany—

Restores the previously focused element when the surface closes.

any
ソースを見る
AutoFocusany—

Requests initial keyboard focus when the element mounts.

any
ソースを見る
AriaModalany—

Exposes the modal state of the surface to accessibility.

any
ソースを見る
DismissOnEscapeany—

Allows Escape to dismiss the surface.

any
ソースを見る
DismissOnPointerOutsideany—

Allows a pointer press outside the surface to dismiss it.

any
ソースを見る
TooltipTextany—

Text displayed by the element’s tooltip.

any
ソースを見る
TooltipPlacementany—

Preferred side and alignment of the tooltip.

any
ソースを見る
TooltipDelayany—

Delay before the tooltip opens.

any
ソースを見る
TooltipGapany—

Space between the tooltip and its trigger.

any
ソースを見る
TooltipViewportMarginany—

Minimum space between the tooltip and the window edges.

any
ソースを見る
AnchorTargetany—

Identity of the element used to position the surface.

any
ソースを見る
AnchorPlacementany—

Preferred side and alignment relative to the anchor.

any
ソースを見る
AnchorGapany—

Space between the anchor and its surface, in logical pixels.

any
ソースを見る
ViewportMarginany—

Minimum space reserved around the surface within the viewport.

any
ソースを見る
Keymapany—

Keyboard bindings used by the editor.

any
ソースを見る
Draggableany—

Enables the element as a drag source.

any
ソースを見る
DropKindsany—

Kinds of drop payload this target accepts.

any
ソースを見る
Streamingany—

Configures streaming for this part. The declared type and source define the accepted value.

any
ソースを見る
CodeBlockComponentany—

A component reference receives each parsed fence's value and language.

any
ソースを見る
CodeBlockMaxHeightany—

Configures code block max height for this part. The declared type and source define the accepted value.

any
ソースを見る
ThemeTheme—

Configures theme for this part. The declared type and source define the accepted value.

Theme
ソースを見る