Skip to content

Commit 4b2f015

Browse files
authored
Merge pull request #79 from plotly/fix-docstring
Doc String fix
2 parents ecb3344 + 6183308 commit 4b2f015

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

src/app/dashapp.jl

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ mutable struct DashApp
3434
devtools ::DevTools
3535
callbacks ::Dict{Symbol, Callback}
3636
inline_scripts ::Vector{String}
37-
38-
DashApp(root_path, is_interactive, config, index_string, title = "Dash") =
37+
38+
DashApp(root_path, is_interactive, config, index_string, title = "Dash") =
3939
new(root_path, is_interactive, config, index_string, title, nothing, DevTools(dash_env(Bool, "debug", false)), Dict{Symbol, Callback}(), String[])
40-
40+
4141
end
4242

4343
#only name, index_string and layout are available to set
@@ -70,7 +70,7 @@ get_layout(app::DashApp) = app.layout
7070

7171
function check_index_string(index_string::AbstractString)
7272
validate_index(
73-
"index_string", index_string,
73+
"index_string", index_string,
7474
[
7575
"{%app_entry%}"=>r"{%app_entry%}",
7676
"{%config%}"=>r"{%config%}",
@@ -136,7 +136,7 @@ Available dev_tools environment variables:
136136
hash requests before failing and displaying a pop up. Default 8.
137137
env: ``DASH_HOT_RELOAD_MAX_RETRY``
138138
"""
139-
function enable_dev_tools!(app::DashApp; debug = nothing,
139+
function enable_dev_tools!(app::DashApp; debug = nothing,
140140
dev_tools_ui = nothing,
141141
dev_tools_props_check = nothing,
142142
dev_tools_serve_dev_bundles = nothing,
@@ -168,22 +168,22 @@ get_setting(app::DashApp, name::Symbol) = getproperty(app.config, name)
168168
get_assets_path(app::DashApp) = joinpath(app.root_path, get_setting(app, :assets_folder))
169169

170170
"""
171-
dash(name::String;
171+
dash(;
172172
external_stylesheets,
173173
external_scripts,
174-
url_base_pathname,
174+
url_base_pathname,
175175
requests_pathname_prefix,
176176
routes_pathname_prefix,
177177
assets_folder,
178178
assets_url_path,
179-
assets_ignore,
179+
assets_ignore,
180180
serve_locally,
181181
suppress_callback_exceptions,
182-
eager_loading ,
183-
meta_tags,
184-
index_string,
185-
assets_external_path,
186-
include_assets_files,
182+
eager_loading ,
183+
meta_tags,
184+
index_string,
185+
assets_external_path,
186+
include_assets_files,
187187
show_undo_redo,
188188
compress
189189
)
@@ -202,35 +202,35 @@ If a parameter can be set by an environment variable, that is listed as:
202202
``requests_pathname_prefix * assets_url_path * "/" * asset_path``
203203
where ``asset_path`` is the path to a file inside ``assets_folder``.
204204
Default ``'assets'`.
205-
205+
206206
- `assets_ignore::String` - [EXPERIMENTAL] A regex, as a string to pass to ``Regex``, for
207207
assets to omit from immediate loading. Ignored files will still be
208208
served if specifically requested. You cannot use this to prevent access
209-
to sensitive files.
209+
to sensitive files.
210210
:type assets_ignore: string
211211
212212
- `assets_external_path::String` - [EXPERIMENTAL] an absolute URL from which to load assets.
213213
Use with ``serve_locally=false``. Dash can still find js and css to
214214
automatically load if you also keep local copies in your assets
215215
folder that Dash can index, but external serving can improve
216-
performance and reduce load on the Dash server.
217-
env: `DASH_ASSETS_EXTERNAL_PATH`
216+
performance and reduce load on the Dash server.
217+
env: `DASH_ASSETS_EXTERNAL_PATH`
218218
219219
- `include_assets_files::Bool` - [EXPERIMENTAL] Default ``true``, set to ``false`` to prevent
220220
immediate loading of any assets. Assets will still be served if
221221
specifically requested. You cannot use this to prevent access
222-
to sensitive files.
223-
env: `DASH_INCLUDE_ASSETS_FILES`
222+
to sensitive files.
223+
env: `DASH_INCLUDE_ASSETS_FILES`
224224
225225
- `url_base_pathname::String`: A local URL prefix to use app-wide.
226226
Default ``nothing``. Both `requests_pathname_prefix` and
227227
`routes_pathname_prefix` default to `url_base_pathname`.
228-
env: `DASH_URL_BASE_PATHNAME`
228+
env: `DASH_URL_BASE_PATHNAME`
229229
230230
- `requests_pathname_prefix::String`: A local URL prefix for file requests.
231231
Defaults to `url_base_pathname`, and must end with
232232
`routes_pathname_prefix`
233-
env: `DASH_REQUESTS_PATHNAME_PREFIX`
233+
env: `DASH_REQUESTS_PATHNAME_PREFIX`
234234
235235
- `routes_pathname_prefix::String`: A local URL prefix for JSON requests.
236236
Defaults to ``url_base_pathname``, and must start and end
@@ -240,77 +240,77 @@ If a parameter can be set by an environment variable, that is listed as:
240240
- `serve_locally`: [EXPERIMENTAL] If `true` (default), assets and dependencies (Dash and Component js and css) will be served from local URLs. If `false` Dash will use CDN links where available.
241241
(Dash and Component js and css) will be served from local URLs.
242242
If ``false`` we will use CDN links where available.
243-
243+
244244
- `meta_tags::Vector{Dict{String, String}}`: html <meta> tags to be added to the index page.
245245
Each dict should have the attributes and values for one tag, eg:
246246
``Dict("name"=>"description", "content" => "My App")``
247-
247+
248248
- `index_string::String`: Override the standard Dash index page.
249249
Must contain the correct insertion markers to interpolate various
250250
content into it depending on the app config and components used.
251251
See https://dash.plotly.com/external-resources for details.
252-
252+
253253
- `external_scripts::Vector`: Additional JS files to load with the page.
254254
Each entry can be a String (the URL) or a Dict{String, String} with ``src`` (the URL)
255255
and optionally other ``<script>`` tag attributes such as ``integrity``
256-
and ``crossorigin``.
256+
and ``crossorigin``.
257257
258258
- `external_stylesheets::Vector`: Additional CSS files to load with the page.
259259
Each entry can be a String (the URL) or a Dict{String, String} with ``href`` (the URL)
260260
and optionally other ``<link>`` tag attributes such as ``rel``,
261-
``integrity`` and ``crossorigin``.
261+
``integrity`` and ``crossorigin``.
262262
263263
- `suppress_callback_exceptions::Bool`: Default ``false``: check callbacks to
264264
ensure referenced IDs exist and props are valid. Set to ``true``
265265
if your layout is dynamic, to bypass these checks.
266266
env: `DASH_SUPPRESS_CALLBACK_EXCEPTIONS`
267-
267+
268268
- `show_undo_redo::Bool`: Default ``false``, set to ``true`` to enable undo
269269
and redo buttons for stepping through the history of the app state.
270270
271-
- `compress::Bool`: Default ``true``, controls whether gzip is used to compress
271+
- `compress::Bool`: Default ``true``, controls whether gzip is used to compress
272272
files and data served by HTTP.jl when supported by the client. Set to
273273
``false`` to disable compression completely.
274274
"""
275275
function dash(;
276276
external_stylesheets = ExternalSrcType[],
277277
external_scripts = ExternalSrcType[],
278-
url_base_pathname = dash_env("url_base_pathname"),
278+
url_base_pathname = dash_env("url_base_pathname"),
279279
requests_pathname_prefix = dash_env("requests_pathname_prefix"),
280280
routes_pathname_prefix = dash_env("routes_pathname_prefix"),
281281
assets_folder = "assets",
282282
assets_url_path = "assets",
283-
assets_ignore = "",
283+
assets_ignore = "",
284284
serve_locally = true,
285285
suppress_callback_exceptions = dash_env(Bool, "suppress_callback_exceptions", false),
286-
eager_loading = false,
287-
meta_tags = Dict{Symbol, String}[],
288-
index_string = default_index,
289-
assets_external_path = dash_env("assets_external_path"),
290-
include_assets_files = dash_env(Bool, "include_assets_files", true),
286+
eager_loading = false,
287+
meta_tags = Dict{Symbol, String}[],
288+
index_string = default_index,
289+
assets_external_path = dash_env("assets_external_path"),
290+
include_assets_files = dash_env(Bool, "include_assets_files", true),
291291
show_undo_redo = false,
292292
compress = true
293293

294294
)
295-
296-
check_index_string(index_string)
295+
296+
check_index_string(index_string)
297297
config = DashConfig(
298298
external_stylesheets,
299299
external_scripts,
300300
pathname_configs(
301-
url_base_pathname,
301+
url_base_pathname,
302302
requests_pathname_prefix,
303303
routes_pathname_prefix
304304
)...,
305305
assets_folder,
306306
lstrip(assets_url_path, '/'),
307-
assets_ignore,
308-
serve_locally,
309-
suppress_callback_exceptions,
310-
eager_loading,
311-
meta_tags,
312-
assets_external_path,
313-
include_assets_files,
307+
assets_ignore,
308+
serve_locally,
309+
suppress_callback_exceptions,
310+
eager_loading,
311+
meta_tags,
312+
assets_external_path,
313+
include_assets_files,
314314
show_undo_redo,
315315
compress
316316
)

0 commit comments

Comments
 (0)