Add docstrings
This commit is contained in:
@@ -78,6 +78,11 @@ source, template_path = Loader(engine).load_template_source(path)
|
||||
%>${source | n, decode.utf8}</%def>
|
||||
|
||||
<%def name="require_module(module_name, class_name)">
|
||||
<%doc>
|
||||
Loads Javascript onto your page synchronously.
|
||||
Uses RequireJS in development and a plain script tag in production.
|
||||
Use this form of require_module for all new code.
|
||||
</%doc>
|
||||
% if not settings.REQUIRE_DEBUG:
|
||||
<script type="text/javascript" src="${staticfiles_storage.url(module_name + '.js') + '?raw'}"></script>
|
||||
% endif
|
||||
@@ -91,6 +96,11 @@ source, template_path = Loader(engine).load_template_source(path)
|
||||
</%def>
|
||||
|
||||
<%def name="require_module_async(module_name, class_name)">
|
||||
<%doc>
|
||||
Legacy mode of require_module that operates asynchronously, required for certain edge cases
|
||||
(notably where Javascript is required outside of a <%block name="js_extra" or "headextra").
|
||||
Do not use for any new code; instead create a factory and use require_module above.
|
||||
</%doc>
|
||||
<script type="text/javascript">
|
||||
(function (require) {
|
||||
% if settings.REQUIRE_DEBUG:
|
||||
|
||||
Reference in New Issue
Block a user