且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Django Wagtail中使用编辑源代码按钮扩展Hallojs

更新时间:2023-11-24 14:41:16

使用 insert_editor_css 钩子为编辑器提供额外的CSS文件。

Use the insert_editor_css hook to provide additional CSS files to the editor.

@hooks.register('insert_editor_css')
def editor_css():
    return format_html(
        '<link rel="stylesheet" href="{}">',
        static('demo/css/editor-overrides.css')
    )

在您的hallohtml插件JS中,将 icon-hallohtml 分配给该按钮,并使用以下CSS将其与H字符进行样式: p>

In your hallohtml plugin JS, assign icon-hallohtml to the button and use the following CSS to style it with an H character:

.hallotoolbar .halloformat .ui-button-text .icon-hallohtml:before {
    content:'H';
}