Asset tag renderer¶
Bases:
djangocodemirror.manifest.CodeMirrorManifest
A manifest extend to render Codemirror assets tags HTML.
Render HTML for a CodeMirror instance.
Since a CodeMirror instance have to be attached to a HTML element, this method requires a HTML element identifier with or without the
#
prefix, it depends from template insettings.CODEMIRROR_FIELD_INIT_JS
(default one require to not prefix with#
).Parameters: - config_name (string) – A registred config name.
- varname (string) – A Javascript variable name.
- element_id (string) – An HTML element identifier (without
leading
#
) to attach to a CodeMirror instance.
Returns: HTML to instanciate CodeMirror for a field input.
Return type: string
Render HTML tags for Javascript assets.
Returns: HTML for CSS assets from every registered config. Return type: string
Render HTML tags for Javascript assets.
Returns: HTML for Javascript assets from every registered config. Return type: string
Register config name from field widgets
Parameters: *args – Fields that contains widget djangocodemirror.widget.CodeMirrorWidget
.Returns: List of registered config names from fields. Return type: list
Render HTML tag for a given path.
Parameters: - path (string) – Relative path from static directory.
- tag_template (string) – Template string for HTML tag.
Returns: HTML tag with url from given path.
Return type: string
Given a Field or BoundField, return widget instance.
- Todo:
- Raise an exception if given field object does not have a widget.
Parameters: field (Field or BoundField) – A field instance. Returns: Retrieved widget from given field. Return type: django.forms.widgets.Widget