| |
@@ -2,8 +2,11 @@
|
| |
|
| |
from hubs.widgets import validators
|
| |
from hubs.widgets.base import Widget
|
| |
+ from hubs.widgets.caching import CachedFunction
|
| |
from hubs.widgets.view import RootWidgetView
|
| |
|
| |
+ from markdown import markdown
|
| |
+
|
| |
|
| |
class Sticky(Widget):
|
| |
|
| |
@@ -11,9 +14,12 @@
|
| |
label = "Sticky Note"
|
| |
position = "both"
|
| |
display_css = "card-info"
|
| |
+ is_large = True
|
| |
parameters = [
|
| |
dict(
|
| |
name="text",
|
| |
+ render_tag="textarea",
|
| |
+ render_attributes={"rows": "30"},
|
| |
label="Text",
|
| |
default="Lorem ipsum dolor...",
|
| |
validator=validators.Text,
|
| |
@@ -24,7 +30,18 @@
|
| |
class BaseView(RootWidgetView):
|
| |
|
| |
def get_context(self, instance, *args, **kwargs):
|
| |
- # TODO -- render with markdown
|
| |
+ md = ParseMarkdown(instance)
|
| |
return dict(
|
| |
- text=instance.config["text"],
|
| |
- )
|
| |
+ text=md()
|
| |
+ )
|
| |
+
|
| |
+
|
| |
+ class ParseMarkdown(CachedFunction):
|
| |
+
|
| |
+ def execute(self):
|
| |
+ text = self.instance.config["text"]
|
| |
+ return markdown(text, extensions=['markdown.extensions.extra',
|
| |
+ 'markdown.extensions.sane_lists'])
|
| |
+
|
| |
+ def should_invalidate(self, message):
|
| |
+ return False
|
| |
The first commit (129869f) is part of PR #407
The second commit (443932c) removes pattern lab's CSS as discussed in the meeting on 2017-10-17. The relevant style sheets from that are being merged into fedora-bootstrap.