A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add new info/about page

+372 -82
+3
package.yaml
··· 4 4 5 5 default-extensions: 6 6 - ExtendedDefaultRules 7 + - NoImplicitPrelude 7 8 - OverloadedStrings 8 9 9 10 ··· 11 12 - base >= 4.7 && < 5 12 13 - binary == 0.8.* 13 14 - bytestring == 0.10.* 15 + - cmark == 0.5.* 14 16 - directory == 1.3.* 15 17 - flow == 1.* 16 18 - http-types == 0.9.* 17 19 - process == 1.4.* 20 + - protolude == 0.1.* 18 21 - shikensu == 0.3.* 19 22 - text == 1.* 20 23 - wai == 3.2.*
+22
src/App/Navigation/View.elm
··· 24 24 (List.map (itemViewWithActiveLink currentHref) items) 25 25 26 26 27 + outsideOutgoing : String -> List ( Label, String ) -> Html Msg 28 + outsideOutgoing activeHref items = 29 + div 30 + [ cssClass OutsideNavigation ] 31 + (List.map (itemViewOutgoing activeHref) items) 32 + 33 + 27 34 inside : List ( Label, String ) -> Html Msg 28 35 inside items = 29 36 div ··· 97 104 [] 98 105 [ itemLabel ] 99 106 ] 107 + 108 + 109 + itemViewOutgoing : String -> ( Label, String ) -> Html Msg 110 + itemViewOutgoing activeHref ( itemLabel, itemHref ) = 111 + a 112 + [ href itemHref 113 + , if itemHref == activeHref then 114 + cssClass ActiveLink 115 + else 116 + cssClass NonActiveLink 117 + ] 118 + [ span 119 + [] 120 + [ itemLabel ] 121 + ]
-4
src/App/Routing/Logic.elm
··· 30 30 pageToParentHref : Page -> String 31 31 pageToParentHref page = 32 32 case page of 33 - About -> 34 - "/about" 35 - 36 33 Equalizer -> 37 34 "/equalizer" 38 35 ··· 64 61 , map (Queue Queue.History) (s "queue" </> s "history") 65 62 66 63 -- Other 67 - , map About (s "about") 68 64 , map Equalizer (s "equalizer") 69 65 , map Settings (s "settings") 70 66 , map Index top
+1 -2
src/App/Routing/Types.elm
··· 14 14 15 15 16 16 type Page 17 - = About 18 - | Equalizer 17 + = Equalizer 19 18 | ErrorScreen String 20 19 | Index 21 20 | Queue Queue.Page
+1 -1
src/App/Sources/View.elm
··· 451 451 [] 452 452 , text "You can find the instructions over " 453 453 , a 454 - [ href "https://gist.github.com/icidasset/c1883d594574a958ae4b4a5a91db1070#cors" 454 + [ href "/about#CORS" 455 455 , target "blank" 456 456 ] 457 457 [ text "here" ]
+2 -13
src/App/View.elm
··· 90 90 ] 91 91 ] 92 92 93 - About -> 94 - unauthenticated 95 - [ p 96 - [] 97 - [ strong [] [ text "Ongaku Ryoho." ] 98 - , br [] [] 99 - , text "A music player that connects to your cloud/distributed storage." 100 - ] 101 - ] 102 - model 103 - 104 93 -- # Needs authentication 105 94 -- 106 95 Equalizer -> ··· 216 205 217 206 unauthenticatedNavigation : Page -> Html Msg 218 207 unauthenticatedNavigation currentPage = 219 - Navigation.outside 220 - currentPage 208 + Navigation.outsideOutgoing 209 + "/" 221 210 [ ( Material.Icons.Action.home colors.base05 16, "/" ) 222 211 , ( Material.Icons.Action.info colors.base05 16, "/about" ) 223 212 ]
src/Static/Favicons/android-chrome-192x192.png

This is a binary file and will not be displayed.

src/Static/Favicons/android-chrome-512x512.png

This is a binary file and will not be displayed.

src/Static/Favicons/apple-touch-icon.png

This is a binary file and will not be displayed.

+1 -1
src/Static/Favicons/browserconfig.xml
··· 2 2 <browserconfig> 3 3 <msapplication> 4 4 <tile> 5 - <square150x150logo src="/favicons/mstile-150x150.png?v=69k2bWaL75"/> 5 + <square150x150logo src="/favicons/mstile-150x150.png?v=almjmW9Pop"/> 6 6 <TileColor>#5f8993</TileColor> 7 7 </tile> 8 8 </msapplication>
+3 -3
src/Static/Favicons/manifest.json
··· 1 1 { 2 - "name": "Ongaku Ryoho", 2 + "name": "", 3 3 "icons": [ 4 4 { 5 - "src": "/favicons/android-chrome-192x192.png?v=69k2bWaL75", 5 + "src": "/favicons/android-chrome-192x192.png?v=almjmW9Pop", 6 6 "sizes": "192x192", 7 7 "type": "image/png" 8 8 }, 9 9 { 10 - "src": "/favicons/android-chrome-512x512.png?v=69k2bWaL75", 10 + "src": "/favicons/android-chrome-512x512.png?v=almjmW9Pop", 11 11 "sizes": "512x512", 12 12 "type": "image/png" 13 13 }
src/Static/Favicons/mstile-144x144.png

This is a binary file and will not be displayed.

src/Static/Favicons/mstile-150x150.png

This is a binary file and will not be displayed.

src/Static/Favicons/mstile-310x150.png

This is a binary file and will not be displayed.

src/Static/Favicons/mstile-310x310.png

This is a binary file and will not be displayed.

src/Static/Favicons/mstile-70x70.png

This is a binary file and will not be displayed.

+1 -34
src/Static/Favicons/safari-pinned-tab.svg
··· 1 - <?xml version="1.0" standalone="no"?> 2 - <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" 3 - "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> 4 - <svg version="1.0" xmlns="http://www.w3.org/2000/svg" 5 - width="16.000000pt" height="16.000000pt" viewBox="0 0 16.000000 16.000000" 6 - preserveAspectRatio="xMidYMid meet"> 7 - <metadata> 8 - Created by potrace 1.11, written by Peter Selinger 2001-2013 9 - </metadata> 10 - <g transform="translate(0.000000,16.000000) scale(0.003125,-0.003125)" 11 - fill="#000000" stroke="none"> 12 - <path d="M2345 4790 c-281 -30 -518 -98 -770 -220 -574 -279 -1020 -821 -1180 13 - -1436 -54 -207 -69 -331 -69 -574 0 -243 15 -367 69 -574 159 -612 600 -1151 14 - 1170 -1431 221 -108 396 -165 645 -207 180 -31 520 -31 700 0 503 86 922 306 15 - 1265 664 140 146 324 397 342 466 3 14 -42 172 -122 430 -71 224 -134 428 16 - -142 455 l-15 47 -264 0 -264 0 -5 -22 c-2 -13 -41 -230 -85 -483 -44 -253 17 - -83 -470 -85 -482 -5 -21 -11 -23 -61 -23 -56 0 -56 0 -51 28 3 15 87 498 188 18 - 1075 l184 1047 388 0 389 0 -43 78 c-221 403 -569 738 -974 937 -221 108 -400 19 - 166 -640 206 -136 23 -441 33 -570 19z m443 -1226 c160 -41 294 -151 370 -305 20 - 166 -336 132 -914 -77 -1330 -64 -126 -127 -215 -221 -310 -219 -221 -560 21 - -310 -837 -218 -305 101 -481 478 -443 952 32 392 165 725 379 950 146 153 22 - 306 240 501 272 97 16 240 11 328 -11z"/> 23 - <path d="M2525 3474 c-194 -26 -334 -92 -461 -219 -249 -248 -399 -720 -364 24 - -1150 18 -216 74 -365 180 -478 97 -105 216 -151 386 -150 192 1 347 62 489 25 - 195 95 89 150 162 214 286 197 385 237 927 90 1231 -68 141 -187 239 -324 269 26 - -60 13 -168 21 -210 16z"/> 27 - <path d="M3890 3440 c0 -5 -36 -213 -80 -462 -44 -249 -80 -457 -80 -462 0 -5 28 - 141 -6 333 -3 298 4 340 7 412 26 106 28 209 79 268 130 56 51 57 62 27 246 29 - -25 153 -60 291 -109 419 -38 101 -38 101 -77 108 -61 11 -694 10 -694 -2z"/> 30 - <path d="M4748 2540 c-91 -57 -280 -120 -362 -120 -18 0 -26 -4 -23 -12 2 -7 31 - 55 -175 116 -373 61 -198 114 -367 117 -375 7 -20 21 7 68 131 72 195 119 428 32 - 132 653 4 69 5 126 3 126 -2 0 -25 -14 -51 -30z"/> 33 - </g> 34 - </svg> 1 + <svg version="1" xmlns="http://www.w3.org/2000/svg" width="682.667" height="682.667" viewBox="0 0 512.000000 512.000000"><path d="M232.5 33.2c-30.4 3-63.3 14-90.8 30.1-30.3 17.9-60.5 48.1-78.4 78.4C17.2 220.1 22.4 317 76.6 390.1c9.9 13.3 32 35.4 45.3 45.3 39.1 29 86 44.6 134.1 44.6 48.1 0 95-15.6 134.1-44.6 13.4-9.9 35.4-32 45.3-45.3 9-12.1 16.6-24.7 16.6-27.4 0-1.5-17.1-57.4-26.6-87l-1.6-4.7H371l-.5 2.2c-.3 1.3-4.1 22.8-8.5 47.8-4.4 25-8.3 46.7-8.6 48.3-.5 2.5-.9 2.7-6.1 2.7-5.5 0-5.5 0-5-2.8.3-1.5 8.8-49.8 18.9-107.4L379.5 157l38.8-.2 38.7-.3-6.5-11.5c-18.3-32.2-48.6-63.1-80.2-81.7-41.5-24.4-89.8-35-137.8-30.1zm36.2 120.9c27.2 3 43.8 17.7 52.9 46.9 6.3 20.1 5.8 56.8-1 83.9-13.4 53-45.5 86.2-86.9 90-30.3 2.8-52.6-8.9-65.2-34.3-17-34.4-13.6-90.1 8.1-131.4 14.2-27 33.2-44.1 57.4-51.7 4.7-1.4 11.9-3 16-3.4 4.1-.5 7.9-.9 8.3-1 .4 0 5.1.4 10.4 1z"/><path d="M245.8 165.5c-41.4 7.8-70.4 49.9-75.9 110.4-1.3 14.4 0 33.3 3 45.2 8.2 32.1 32.4 48 64.7 42.5 21.2-3.6 38.3-15 52.1-34.7 16.5-23.8 26.6-63.1 24.9-97.5-1.6-34.5-14.4-56.7-37.2-64.3-8.2-2.7-21.9-3.4-31.6-1.6zM389 167.7c0 .5-3.6 21.1-8 45.8-4.4 24.8-8 45.6-8 46.4 0 1.1 5.7 1.2 33.3.8 29.5-.4 34.1-.7 41.4-2.6 10.4-2.6 21.1-7.9 27-13.4l4.6-4.2-.7-8.5c-.4-4.7-1.8-14-3.1-20.7-2.6-12.8-10.6-38.7-13-41.9-1.3-1.8-3.6-1.9-37.4-2.2-19.9-.2-36.1.1-36.1.5zM476.5 256.6c-7 5.4-23.4 11.5-35 12.9-4.5.6-5.5 1-5.1 2.4.9 2.7 16.4 52.8 20.3 65l3.5 11.5 2.9-6.8c9.6-22.4 16.9-57.5 16.9-80.8 0-6.2-.4-6.6-3.5-4.2z"/></svg>
+7 -7
src/Static/Html/Proxy.html
··· 8 8 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" /> 9 9 10 10 <!-- Favicons & Mobile --> 11 - <link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png?v=69k2bWaL75" /> 12 - <link rel="icon" type="image/png" href="/favicons/favicon-32x32.png?v=69k2bWaL75" sizes="32x32" /> 13 - <link rel="icon" type="image/png" href="/favicons/favicon-16x16.png?v=69k2bWaL75" sizes="16x16" /> 14 - <link rel="manifest" href="/favicons/manifest.json?v=69k2bWaL75" /> 15 - <link rel="mask-icon" href="/favicons/safari-pinned-tab.svg?v=69k2bWaL75" color="#5f8993" /> 16 - <link rel="shortcut icon" href="/favicons/favicon.ico?v=69k2bWaL75" /> 17 - <meta name="msapplication-config" content="/favicons/browserconfig.xml?v=69k2bWaL75" /> 11 + <link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png?v=almjmW9Pop" /> 12 + <link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png?v=almjmW9Pop" /> 13 + <link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png?v=almjmW9Pop" /> 14 + <link rel="manifest" href="/favicons/manifest.json?v=almjmW9Pop" /> 15 + <link rel="mask-icon" href="/favicons/safari-pinned-tab.svg?v=almjmW9Pop" color="#5f8993" /> 16 + <link rel="shortcut icon" href="/favicons/favicon.ico?v=almjmW9Pop" /> 17 + <meta name="msapplication-config" content="/favicons/browserconfig.xml?v=almjmW9Pop" /> 18 18 <meta name="theme-color" content="#ffffff" /> 19 19 <meta name="apple-mobile-web-app-capable" content="yes" /> 20 20 <meta name="apple-mobile-web-app-status-bar-style" content="black" />
+20
src/Static/Images/icon-black.svg
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <svg width="70px" height="70px" viewBox="0 0 70 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 3 + <!-- Generator: Sketch 46 (44423) - http://www.bohemiancoding.com/sketch --> 4 + <title>Icon</title> 5 + <desc>Created with Sketch.</desc> 6 + <defs> 7 + <circle id="path-1" cx="35" cy="35" r="35"></circle> 8 + </defs> 9 + <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> 10 + <g id="Icon"> 11 + <g id="OR"> 12 + <mask id="mask-2" fill="white"> 13 + <use xlink:href="#path-1"></use> 14 + </mask> 15 + <use id="Mask" fill="#41323f" xlink:href="#path-1"></use> 16 + <path d="M30.1640001,53.576 C22.6280001,53.576 19.7000001,46.808 19.7000001,40.04 C19.7000001,30.872 24.5480001,18.824 35.8760001,18.824 C43.5080001,18.824 46.1480001,25.208 46.1480001,32.12 C46.1480001,41.432 41.4920001,53.576 30.1640001,53.576 Z M30.4040001,51.848 C40.3880001,51.848 44.3240001,40.472 44.3240001,32.072 C44.3240001,26.024 42.0680001,20.552 35.6360001,20.552 C25.6520001,20.552 21.5720001,31.832 21.5720001,40.232 C21.5720001,46.424 23.8760001,51.848 30.4040001,51.848 Z M73.604,27.224 C73.604,33.032 69.092,36.584 63.14,37.112 L68.084,53 L66.164,53 L61.22,37.208 L52.964,37.208 L50.18,53 L48.404,53 L54.308,19.4 L65.108,19.4 C71.348,19.4 73.604,23.48 73.604,27.224 Z M61.268,35.624 C66.644,35.624 71.732,33.224 71.732,27.224 C71.732,24.392 70.292,20.984 65.108,20.984 L55.844,20.984 L53.252,35.624 L61.268,35.624 Z" fill="#FFFFFF" mask="url(#mask-2)"></path> 17 + </g> 18 + </g> 19 + </g> 20 + </svg>
+98
src/Static/Info/Info.css
··· 1 + html { 2 + font-size: 14px; 3 + line-height: 1.6; 4 + -ms-text-size-adjust: 100%; 5 + -webkit-text-size-adjust: 100%; 6 + } 7 + 8 + @media screen and (min-width: 768px) { 9 + html { 10 + font-size: 16px; 11 + } 12 + } 13 + 14 + body { 15 + color: #322230; 16 + font-family: Overpass, sans-serif; 17 + margin: 0 1.125rem 4.5rem; 18 + 19 + -webkit-font-smoothing: antialiased; 20 + -moz-osx-font-smoothing: grayscale; 21 + font-smooth: always; 22 + } 23 + 24 + 25 + .container { 26 + margin: 0 auto; 27 + max-width: 650px; 28 + } 29 + 30 + 31 + 32 + /** 33 + * Logo 34 + */ 35 + 36 + 37 + .logo { 38 + margin: 4.125rem auto 3rem; 39 + opacity: 0.225; 40 + } 41 + 42 + 43 + .logo img { 44 + display: block; 45 + width: 64px; 46 + } 47 + 48 + 49 + 50 + /** 51 + * Content 52 + */ 53 + 54 + 55 + h1, h2, h3, h4, h5, h6 { 56 + font-family: 'Playfair Display', serif; 57 + letter-spacing: -0.005em; 58 + 59 + -webkit-font-smoothing: subpixel-antialiased; 60 + -moz-osx-font-smoothing: unset; 61 + font-smooth: never; 62 + } 63 + 64 + h2 { 65 + margin: 2.625rem 0 1.125rem; 66 + } 67 + 68 + h3 { 69 + font-weight: 600; 70 + margin: 1.5rem 0 0.75rem 71 + } 72 + 73 + p { 74 + font-size: 0.95em; 75 + } 76 + 77 + blockquote { 78 + border-left: 4px solid rgb(254, 196, 24); 79 + margin-left: 0; 80 + padding-left: 0.75rem; 81 + } 82 + 83 + a { 84 + color: inherit; 85 + } 86 + 87 + pre { 88 + border: 2px solid rgba(50, 34, 48, 0.15); 89 + border-radius: 3px; 90 + font-size: 0.9rem; 91 + overflow-x: auto; 92 + overflow-y: hidden; 93 + padding: 1.5rem; 94 + } 95 + 96 + code { 97 + font-family: "Hack", monospace; 98 + }
+74
src/Static/Info/Info.md
··· 1 + > A music player that connects to your cloud/distributed storage. 2 + 3 + [Return to the application](/). 4 + 5 + 6 + 7 + ## Which services does it use? 8 + 9 + Ongaku Ryoho uses two layers of services, these layers are: 10 + 11 + 1. User layer 12 + 2. Music layer 13 + 14 + 15 + ### User layer 16 + 17 + This layer will use a service to store data from a user, such as the user's favourites, their playlists and data from the processed music files. 18 + 19 + You can choose between these services: 20 + 21 + - IndexedDB 22 + - Blockstack 23 + - IPNS (IPFS) 24 + 25 + 26 + ### Music layer 27 + 28 + This layer connects with the services the user has on which music can be found. No data is written to these services. You can combine all of the following services: 29 + 30 + - Blockstack Storage 31 + - IPFS 32 + - Amazon S3 33 + 34 + 35 + 36 + ## How does it work? 37 + 38 + Ongaku Ryoho locates all the music files on the given services, extracts the metadata and then stores it via the user layer (which was explained before). 39 + 40 + 41 + <div id="CORS" /> 42 + 43 + ### CORS 44 + 45 + There's only one thing you need to do yourself so that your service will work with the application, and that's setting up [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) (Cross-Origin Resource Sharing). Here are the instructions you'll need for each service: 46 + 47 + #### IPFS 48 + 49 + ```shell 50 + ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]' 51 + ipfs config --json Gateway.HTTPHeaders.Access-Control-Allow-Origin '["*"]' 52 + ipfs config --json Gateway.HTTPHeaders.Access-Control-Allow-Headers '["X-Requested-With", "Range", "Content-Range"]' 53 + ``` 54 + 55 + #### Amazon S3 56 + 57 + ```xml 58 + <?xml version="1.0" encoding="UTF-8"?> 59 + <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> 60 + <CORSRule> 61 + <AllowedOrigin>*</AllowedOrigin> 62 + <AllowedMethod>HEAD</AllowedMethod> 63 + <AllowedMethod>GET</AllowedMethod> 64 + <MaxAgeSeconds>31536000</MaxAgeSeconds> 65 + <ExposeHeader>Accept-Ranges</ExposeHeader> 66 + <ExposeHeader>Content-Encoding</ExposeHeader> 67 + <ExposeHeader>Content-Length</ExposeHeader> 68 + <ExposeHeader>Content-Range</ExposeHeader> 69 + <AllowedHeader>If-Modified-Since</AllowedHeader> 70 + <AllowedHeader>Origin</AllowedHeader> 71 + <AllowedHeader>Range</AllowedHeader> 72 + </CORSRule> 73 + </CORSConfiguration> 74 + ```
+40
src/Static/Info/Layout.html
··· 1 + <!DOCTYPE html> 2 + <html> 3 + <head> 4 + <meta charset="utf-8" /> 5 + <title>Ongaku Ryoho – Additional information</title> 6 + 7 + <!-- Viewport --> 8 + <meta name="viewport" content="width=device-width, initial-scale=1" /> 9 + 10 + <!-- Favicons & Mobile --> 11 + <link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png?v=almjmW9Pop" /> 12 + <link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png?v=almjmW9Pop" /> 13 + <link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png?v=almjmW9Pop" /> 14 + <link rel="manifest" href="/favicons/manifest.json?v=almjmW9Pop" /> 15 + <link rel="mask-icon" href="/favicons/safari-pinned-tab.svg?v=almjmW9Pop" color="#5f8993" /> 16 + <link rel="shortcut icon" href="/favicons/favicon.ico?v=almjmW9Pop" /> 17 + <meta name="msapplication-config" content="/favicons/browserconfig.xml?v=almjmW9Pop" /> 18 + <meta name="theme-color" content="#ffffff" /> 19 + 20 + <!-- Styles --> 21 + <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Playfair+Display:700" /> 22 + <link rel="stylesheet" href="//cdn.jsdelivr.net/font-hack/2.020/css/hack-extended.min.css" /> 23 + 24 + <link rel="stylesheet" href="/fonts/fonts.css" /> 25 + <link rel="stylesheet" href="/about/about.css" /> 26 + </head> 27 + <body> 28 + 29 + 30 + <div class="container"> 31 + <div class="logo"> 32 + <img src="../images/icon-black.svg" /> 33 + </div> 34 + 35 + <placeholder /> 36 + </div> 37 + 38 + 39 + </body> 40 + </html>
+1 -1
stack.yaml
··· 1 - resolver: nightly-2017-07-06 1 + resolver: lts-9.0 2 2 3 3 packages: 4 4 - '.'
+57 -16
system/Build/Main.hs
··· 1 1 module Main where 2 2 3 3 import Flow 4 + import Protolude 5 + import Renderers 4 6 import Shikensu 5 7 import Shikensu.Contrib 6 8 import Shikensu.Contrib.IO as Shikensu 7 9 import Shikensu.Utilities (lsequence) 8 10 9 11 import qualified Control.Monad as Monad (join) 10 - import qualified Data.List as List (concatMap) 12 + import qualified Data.Char as Char 13 + import qualified Data.List as List 11 14 12 15 13 16 -- | (• ◡•)| (❍ᴥ❍ʋ) ··· 21 24 |> Monad.join 22 25 23 26 24 - process :: [String] -> IO Dictionary 27 + process :: [[Char]] -> IO Dictionary 25 28 process patterns = 26 29 Shikensu.listRelativeF "./" patterns >>= Shikensu.read 27 30 ··· 30 33 -- Sequences 31 34 32 35 33 - sequences :: IO [( String, Dictionary )] 36 + data Sequence 37 + = Blockstack 38 + | Favicons 39 + | Fonts 40 + | Images 41 + | Info 42 + | Javascript 43 + | Pages 44 + 45 + 46 + sequences :: IO [( Sequence, Dictionary )] 34 47 sequences = 35 48 lsequence 36 - [ ( "pages", process ["src/Static/Html/**/*.html"] ) 37 - , ( "images", process ["src/Static/Images/**/*.*"] ) 38 - , ( "favicons", process ["src/Static/Favicons/**/*.*"] ) 39 - , ( "fonts", process ["src/Static/Fonts/**/*.*"] ) 40 - , ( "blockstack", process ["src/Static/Blockstack/**/*"] ) 41 - , ( "js", process ["src/Js/**/*.js"] ) 49 + [ ( Pages, process ["src/Static/Html/**/*.html"] ) 50 + , ( Info, process ["src/Static/Info/**/*.*"] ) 51 + 52 + , ( Images, process ["src/Static/Images/**/*.*"] ) 53 + , ( Favicons, process ["src/Static/Favicons/**/*.*"] ) 54 + , ( Fonts, process ["src/Static/Fonts/**/*.*"] ) 55 + , ( Blockstack, process ["src/Static/Blockstack/**/*"] ) 56 + , ( Javascript, process ["src/Js/**/*.js"] ) 42 57 ] 43 58 44 59 45 - flow :: (String, Dictionary) -> Dictionary 46 - flow ("pages", dict) = 60 + 61 + -- Flows 62 + 63 + 64 + flow :: (Sequence, Dictionary) -> Dictionary 65 + flow (Pages, dict) = 47 66 dict 48 67 |> rename "Proxy.html" "200.html" 49 68 |> clone "200.html" "index.html" 50 69 51 70 52 - flow ("images", dict) = prefixDirname "images/" dict 53 - flow ("favicons", dict) = prefixDirname "favicons/" dict 54 - flow ("fonts", dict) = prefixDirname "fonts/" dict 55 - flow ("blockstack", dict) = dict 56 - flow ("js", dict) = dict 71 + flow (Info, dict) = 72 + let 73 + layout = 74 + List.find (\def -> basename def == "Layout") dict >>= content 75 + 76 + css = 77 + List.filter (\def -> extname def == ".css") dict 78 + 79 + append = 80 + \a b -> List.concat [ a, b ] 81 + in 82 + dict 83 + |> exclude "Layout.html" 84 + |> exclude "Info.css" 85 + |> renderContent markdownRenderer 86 + |> renderContent (layoutRenderer layout) 87 + |> append css 88 + |> rename "Info.md" "index.html" 89 + |> rename "Info.css" "about.css" 90 + |> prefixDirname "about/" 91 + 92 + 93 + flow (Images, dict) = prefixDirname "images/" dict 94 + flow (Favicons, dict) = prefixDirname "favicons/" dict 95 + flow (Fonts, dict) = prefixDirname "fonts/" dict 96 + flow (Blockstack, dict) = dict 97 + flow (Javascript, dict) = dict
+39
system/Build/Renderers.hs
··· 1 + module Renderers where 2 + 3 + import Flow 4 + import Protolude 5 + import Shikensu 6 + 7 + import qualified CMark 8 + import qualified Data.ByteString as ByteString 9 + import qualified Data.Text as Text 10 + import qualified Data.Text.Encoding as Text 11 + 12 + 13 + -- Layouts 14 + 15 + 16 + layoutRenderer :: Maybe ByteString -> Definition -> Maybe ByteString 17 + layoutRenderer maybeLayout def = 18 + let 19 + layout = 20 + maybeLayout 21 + |> fromMaybe ByteString.empty 22 + |> Text.decodeUtf8 23 + in 24 + content def 25 + |> fmap Text.decodeUtf8 26 + |> fmap (\text -> Text.replace "<placeholder />" text layout) 27 + |> fmap Text.encodeUtf8 28 + 29 + 30 + 31 + -- Markdown 32 + 33 + 34 + markdownRenderer :: Definition -> Maybe ByteString 35 + markdownRenderer def = 36 + content def 37 + |> fmap Text.decodeUtf8 38 + |> fmap (CMark.commonmarkToHtml [ CMark.optSmart ]) 39 + |> fmap Text.encodeUtf8
+1
system/Server/Main.hs
··· 8 8 import Network.Wai.Application.Static 9 9 import Network.Wai.Handler.Warp (run) 10 10 import Network.Wai.Middleware.Cors 11 + import Protolude 11 12 import System.Directory (doesFileExist) 12 13 13 14 import qualified Data.Binary.Builder as Builder (empty, putStringUtf8)
+1
system/Vendor/Main.hs
··· 1 1 module Main where 2 2 3 3 import Flow 4 + import Protolude 4 5 import Shikensu 5 6 import Shikensu.Contrib 6 7 import Shikensu.Contrib.IO as Shikensu