File tree 5 files changed +48
-1
lines changed
5 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 15
15
datasets and variable CF attributes.
16
16
* Improved axis labeling in 2D histogram visualization in the Panel demo.
17
17
18
+ * Added support for the xcube Viewer's `Markdown` component so it can be used in
19
+ server-side viewer extensions. See new package `xcube.webapi.viewer.components`
20
+ exporting class `Markdown` which has a single `text` property that takes
21
+ the markdown text.
22
+
18
23
### Other changes
19
24
20
25
* Reformatted code base according to the default settings used by
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2018-2025 by xcube team and contributors
2
+ # Permissions are hereby granted under the terms of the MIT License:
3
+ # https://opensource.org/licenses/MIT.
4
+
5
+
6
+ import unittest
7
+
8
+ from xcube .webapi .viewer .components import Markdown
9
+
10
+
11
+ class ViewerComponentsTest (unittest .TestCase ):
12
+ # noinspection PyMethodMayBeStatic
13
+ def test_markdown (self ):
14
+ markdown = Markdown (text = "_Hello_ **world**!" )
15
+ self .assertEqual (
16
+ {"type" : "Markdown" , "text" : "_Hello_ **world**!" },
17
+ markdown .to_dict (),
18
+ )
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2018-2025 by xcube team and contributors
2
+ # Permissions are hereby granted under the terms of the MIT License:
3
+ # https://opensource.org/licenses/MIT.
4
+
5
+ from .markdown import Markdown
6
+
7
+ __all__ = [
8
+ "Markdown" ,
9
+ ]
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2018-2025 by xcube team and contributors
2
+ # Permissions are hereby granted under the terms of the MIT License:
3
+ # https://opensource.org/licenses/MIT.
4
+
5
+ from dataclasses import dataclass
6
+
7
+ from chartlets import Component
8
+
9
+
10
+ @dataclass (frozen = True )
11
+ class Markdown (Component ):
12
+ """A div-element in which the given markdown text is rendered."""
13
+
14
+ text : str | None = None
15
+ """The markdown text."""
Original file line number Diff line number Diff line change @@ -101,4 +101,4 @@ def prepend_sys_path(path: Path | str | None):
101
101
finally :
102
102
if prev_sys_path :
103
103
sys .path = prev_sys_path
104
- LOG .info (f "Restored sys.path" )
104
+ LOG .info ("Restored sys.path" )
You can’t perform that action at this time.
0 commit comments