Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More hljs langs #1729

Merged
merged 5 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ disable=fixme,
superfluous-parens,
bad-continuation,
line-too-long,
bad-option-value
bad-option-value,
unspecified-encoding


# Enable the message, report, category or checker with the given id(s). You can
Expand Down
3 changes: 2 additions & 1 deletion .pylintrc39
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ disable=invalid-name,
line-too-long,
super-with-arguments,
raise-missing-from,
bad-option-value
bad-option-value,
unspecified-encoding

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- [#1679](https://github.com/plotly/dash/pull/1679) Restructure `dash`, `dash-core-components`, `dash-html-components`, and `dash-table` into a singular monorepo and move component packages into `dash`. This change makes the component modules available for import within the `dash` namespace, and simplifies the import pattern for a Dash app. From a development standpoint, all future changes to component modules will be made within the `components` directory, and relevant packages updated with the `dash-update-components` CLI command.
- [#1707](https://github.com/plotly/dash/pull/1707) Change the default value of the `compress` argument to the `dash.Dash` constructor to `False`. This change reduces CPU usage, and was made in recognition of the fact that many deployment platforms (e.g. Dash Enterprise) already apply their own compression. If deploying to an environment that does not already provide compression, the Dash 1 behavior may be restored by adding `compress=True` to the `dash.Dash` constructor.

## Dash Core Components
### Added

- [#1729](https://github.com/plotly/dash/pull/1729) Include F#, C#, and MATLAB in markdown code highlighting, for the upcoming .NET and MATLAB flavors of dash.

## Dash Table
### Added

- [#1729](https://github.com/plotly/dash/pull/1729) Include F#, C#, and MATLAB in markdown code highlighting, for the upcoming .NET and MATLAB flavors of dash.

## [1.21.0] - 2021-07-09

## Dash and Dash Renderer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import highlightjs from 'highlight.js/lib/core';
import 'highlight.js/styles/github.css';

import bash from 'highlight.js/lib/languages/bash';
import csharp from 'highlight.js/lib/languages/csharp';
import css from 'highlight.js/lib/languages/css';
import fsharp from 'highlight.js/lib/languages/fsharp';
import http from 'highlight.js/lib/languages/http';
import javascript from 'highlight.js/lib/languages/javascript';
import json from 'highlight.js/lib/languages/json';
import julia from 'highlight.js/lib/languages/julia';
import markdown from 'highlight.js/lib/languages/markdown';
import matlab from 'highlight.js/lib/languages/matlab';
import plaintext from 'highlight.js/lib/languages/plaintext';
import python from 'highlight.js/lib/languages/python';
import r from 'highlight.js/lib/languages/r';
Expand All @@ -18,12 +21,15 @@ import xml from 'highlight.js/lib/languages/xml';
import yaml from 'highlight.js/lib/languages/yaml';

highlightjs.registerLanguage('bash', bash);
highlightjs.registerLanguage('csharp', csharp);
highlightjs.registerLanguage('css', css);
highlightjs.registerLanguage('fsharp', fsharp);
highlightjs.registerLanguage('http', http);
highlightjs.registerLanguage('javascript', javascript);
highlightjs.registerLanguage('json', json);
highlightjs.registerLanguage('julia', julia);
highlightjs.registerLanguage('markdown', markdown);
highlightjs.registerLanguage('matlab', matlab);
highlightjs.registerLanguage('plaintext', plaintext);
highlightjs.registerLanguage('python', python);
highlightjs.registerLanguage('r', r);
Expand Down
6 changes: 6 additions & 0 deletions components/dash-table/src/third-party/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import highlightjs from 'highlight.js/lib/core';
import 'highlight.js/styles/github.css';

import bash from 'highlight.js/lib/languages/bash';
import csharp from 'highlight.js/lib/languages/csharp';
import css from 'highlight.js/lib/languages/css';
import fsharp from 'highlight.js/lib/languages/fsharp';
import http from 'highlight.js/lib/languages/http';
import javascript from 'highlight.js/lib/languages/javascript';
import json from 'highlight.js/lib/languages/json';
import julia from 'highlight.js/lib/languages/julia';
import markdown from 'highlight.js/lib/languages/markdown';
import matlab from 'highlight.js/lib/languages/matlab';
import plaintext from 'highlight.js/lib/languages/plaintext';
import python from 'highlight.js/lib/languages/python';
import r from 'highlight.js/lib/languages/r';
Expand All @@ -18,12 +21,15 @@ import xml from 'highlight.js/lib/languages/xml';
import yaml from 'highlight.js/lib/languages/yaml';

highlightjs.registerLanguage('bash', bash);
highlightjs.registerLanguage('csharp', csharp);
highlightjs.registerLanguage('css', css);
highlightjs.registerLanguage('fsharp', fsharp);
highlightjs.registerLanguage('http', http);
highlightjs.registerLanguage('javascript', javascript);
highlightjs.registerLanguage('json', json);
highlightjs.registerLanguage('julia', julia);
highlightjs.registerLanguage('markdown', markdown);
highlightjs.registerLanguage('matlab', matlab);
highlightjs.registerLanguage('plaintext', plaintext);
highlightjs.registerLanguage('python', python);
highlightjs.registerLanguage('r', r);
Expand Down
4 changes: 2 additions & 2 deletions dash/_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ def validate_and_group_input_args(flat_args, arg_index_grouping):
func_kwargs = args_grouping
elif isinstance(arg_index_grouping, (tuple, list)):
func_args = list(args_grouping)
func_kwargs = dict()
func_kwargs = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

else:
# Scalar input
func_args = [args_grouping]
func_kwargs = dict()
func_kwargs = {}

return func_args, func_kwargs

Expand Down
13 changes: 6 additions & 7 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,12 +1079,11 @@ def long_callback(self, *_args, **_kwargs): # pylint: disable=too-many-statemen
this should be a list of argument names as strings. Otherwise,
this should be a list of argument indices as integers.
"""
from dash._callback_context import ( # pylint: disable=import-outside-toplevel
callback_context,
)
from dash.exceptions import ( # pylint: disable=import-outside-toplevel
WildcardInLongCallback,
)
# pylint: disable-next=import-outside-toplevel
from dash._callback_context import callback_context

# pylint: disable-next=import-outside-toplevel
from dash.exceptions import WildcardInLongCallback

# Get long callback manager
callback_manager = _kwargs.pop("manager", self._long_callback_manager)
Expand Down Expand Up @@ -1140,7 +1139,7 @@ def long_callback(self, *_args, **_kwargs): # pylint: disable=too-many-statemen
id=interval_id, interval=interval_time, disabled=prevent_initial_call
)
store_id = f"_long_callback_store_{long_callback_id}"
store_component = dcc.Store(id=store_id, data=dict())
store_component = dcc.Store(id=store_id, data={})
self._extra_components.extend([interval_component, store_component])

# Compute full component plus property name for the cancel dependencies
Expand Down
2 changes: 1 addition & 1 deletion dash/dash_table/async-highlight.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dash_table/async-highlight.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dash_table/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dash_table/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dash_table/demo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dash_table/demo.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dcc/async-highlight.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dcc/async-highlight.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dcc/async-markdown.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dcc/dash_core_components.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dcc/dash_core_components.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dash/long_callback/managers/diskcache_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ def clear_cache_entry(self, key):
self.handle.delete(key)

def call_job_fn(self, key, job_fn, args):
from multiprocess import ( # pylint: disable=import-outside-toplevel,no-name-in-module,import-error
Process,
)
# pylint: disable-next=import-outside-toplevel,no-name-in-module,import-error
from multiprocess import Process

# pylint: disable-next=not-callable
proc = Process(target=job_fn, args=(key, self._make_progress_key(key), args))
proc.start()
return proc.pid
Expand Down
2 changes: 1 addition & 1 deletion dash/testing/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def wait_for_page(self, url=None, timeout=10):
except ImportError:
import ipdb as pdb_ # pylint: disable=import-outside-toplevel

pdb_.set_trace()
pdb_.set_trace() # pylint: disable=forgotten-debug-statement

def select_dcc_dropdown(self, elem_or_selector, value=None, index=None):
dropdown = self._get_element(elem_or_selector)
Expand Down
2 changes: 1 addition & 1 deletion requires-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ isort==4.3.21;python_version<"3.7"
mock==4.0.3
flake8==3.9.2
PyYAML==5.4.1
pylint==2.9.3
pylint==2.10.2
black==21.6b0
fire==0.4.0
coloredlogs==15.0.1
Expand Down