Skip to content

Instantly share code, notes, and snippets.

@tonymorris
Last active October 30, 2019 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonymorris/3651d1d9fc57ebe334d29443ef60d421 to your computer and use it in GitHub Desktop.
Save tonymorris/3651d1d9fc57ebe334d29443ef60d421 to your computer and use it in GitHub Desktop.
-- testBlocks == testBlocks2
testBlocks ::
Blocks String
testBlocks =
Blocks
[
StyledBlock
(
ParagraphBlock
(
Paragraph
[
StyledParagraphSegment
(
TextInlineParagraphSegment
(
TextInline
"abc"
(
TextInlineDecorations
[
Strong
]
)
)
)
mempty
, StyledParagraphSegment
(
LinkParagraphSegment
(
Link
"http://link"
(
TextInline
"def"
(
TextInlineDecorations
[
Underline
]
)
)
(
mempty &
linkStyleColour ?~ sRGB24 255 16 224 &
linkStyleDecoration ?~ TextInlineDecorations [Strong] &
linkStyleOnclick ?~ (("this.style.display", "'none'") :| [("document.getElementById('hint-6708360081984318810').style.display", "'inline-block'")])
)
)
)
(
mempty &
paragraphSegmentForegroundColour ?~ sRGB24 255 0 0 &
paragraphSegmentFont ?~ "NotoSansJP"
)
]
)
)
(
mempty & blockStyleFontSize ?~ XXLarge
)
, StyledBlock
(
ImageBlock
(
Image
"the image alt"
"https://i.imgur.com/ENmqgPd.png"
)
)
(
mempty & blockStyleAlignment ?~ Right
)
, StyledBlock
(
HorizontalRuleBlock
(
HorizontalRule
(Just Dotted)
(Just (sRGB24 255 16 224))
Nothing
Nothing
Nothing
Nothing
)
)
(
mempty & blockStyleAlignment ?~ Right
)
, StyledBlock
(
BulletListBlock
(
BulletList
[
Blocks
[
StyledBlock
(
ImageBlock
(
Image
"the other image alt"
"https://i.imgur.com/ENmqgPd.png"
)
)
mempty
]
]
)
)
(
mempty & blockStyleAlignment ?~ Right
)
]
testBlocks2 ::
Blocks String
testBlocks2 =
Blocks
[
p
& blockStyleFontSize ?~ XXLarge
& _Paragraph_ . _Wrapped .~
[
txt "abc"
& _TextInline_ . textInlineDecorations %~: Strong
, lnk "http://link" "def"
& _Link_ . textInline . textInlineDecorations %~: Underline
& _Link_ . linkStyleColour ?~ sRGB24 255 16 224
& _Link_ . linkStyleDecoration %~? Strong
& _Link_ . linkStyleOnclick ?~ (("this.style.display", "'none'") :| [("document.getElementById('hint-6708360081984318810').style.display", "'inline-block'")])
& paragraphSegmentForegroundColour ?~ sRGB24 255 0 0
& paragraphSegmentFont ?~ "NotoSansJP"
]
, img
"the image alt"
"https://i.imgur.com/ENmqgPd.png"
& blockStyleAlignment ?~ Right
, hr & _HorizontalRule_ . hrColour ?~ sRGB24 255 16 224
& _HorizontalRule_ . hrStyle ?~ Dotted
& blockStyleAlignment ?~ Right
, ul1
[
img
"the other image alt"
"https://i.imgur.com/ENmqgPd.png"
]
& blockStyleAlignment ?~ Right
]
{-
<div style="font-size:xx-large">
<p>
<span>
<span style="font-weight:strong">abc</span>
</span>
<span style="color:#ff0000;font-family:NotoSansJP">
<a href="http://link" onclick="document.getElementById('hint-6708360081984318810').style.display:'inline-block';this.style.display:'none'" style="color:#ff10e0;text-decoration:underline">
<span style="text-decoration:underline">def</span>
</a>
</span>
</p>
</div>
<div style="display:flex;flex-direction:row;justify-content:right">
<img alt="the image alt" src="https&colon;&sol;&sol;i&period;imgur&period;com&sol;ENmqgPd&period;png"></img>
</div>
<div style="display:flex;flex-direction:row;justify-content:right">
<hr style="border:dotted #ff10e0"></hr>
</div>
<div style="display:flex;flex-direction:row;justify-content:right">
<ul>
<li>
<div>
<img alt="the other image alt" src="https&colon;&sol;&sol;i&period;imgur&period;com&sol;ENmqgPd&period;png"></img>
</div>
</li>
</ul>
</div>
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment