Last active
December 16, 2015 10:39
-
-
Save hashmal/5421879 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(=> html) [ :body unquote split snd-fst -> header -> body "<html>" puts | |
"<head>" puts header ([length? 0 >] while) [ uncons :title= unquote = (!?) [ | |
"<title>" print uncons print "</title>" puts ] ] << "</head>" puts "<body>" | |
puts body ([length? 0 >] while) [ uncons -> w w :h1 unquote = (if) [ [ "<h1>" | |
print uncons print "</h1>" puts ] [ w type? :List = (if) [ [ "<p>" print w | |
print "</p>" puts << ] [ w :h2 unquote = (!?) [ "<h2>" print << uncons print | |
"</h2>" puts ] ] ] ] ] ] << "</body>" puts "</html>" puts ] | |
------------------------------------------------------------------------------ | |
(html) | |
[ | |
title= "Hello, world!" | |
body | |
---- | |
h1 "Hello" | |
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. | |
Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec | |
consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget | |
libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut | |
porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a | |
non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut | |
gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor." | |
"Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim | |
sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero | |
in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam | |
pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis | |
parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. | |
Mauris vitae nisi at sem facilisis semper ac in est." | |
h2 "World" | |
"Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique | |
vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies." | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output is: