• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

yogsototh/hl: Haskell web site

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

yogsototh/hl

开源软件地址(OpenSource Url):

https://github.com/yogsototh/hl

开源编程语言(OpenSource Language):

HTML 98.0%

开源软件介绍(OpenSource Introduction):

This project has two homes. It is ok to work in github, still, for a better decentralized web please consider contributing (issues, PR, etc...) throught:

https://gitlab.esy.fun/yogsototh/hl


haskell-lang

Haskell web site.

Editing pages

If you're just here to contribute a content change, read this section.

All pages that are produced by markdown are here. To contribute changes simply fork this repo and open a pull request. It will be merged and redeployed in short order.

If you want to edit a page which has some custom code in it, you'll want to see the next sections for building and running instructions. Maybe also take a look at architecture.

If you want to include Haskell code samples in markdown, use:

``` haskell
main = putStrLn "Hello, World!"
```

If you want to include Haskell code samples in Haskell code pages, use:

haskellPre "main = print 123"
haskellCode "peyton `simon` jones"

Pre for <pre> block, code for <code> span snippet.

Building

Clone the repo:

$ git clone [email protected]:chrisdone/hl.git

You need one of these GHC versions:

  • GHC 7.6
  • GHC 7.8

Create an hsenv:

$ cd hl
$ hsenv
$ source .hsenv/bin/activate

You need the right package set. Add the following to your .hsenv/cabal/config, replacing the Hackage reference:

  • If you have GHC 7.6:

      remote-repo: stackage:http://www.stackage.org/stackage/1ba546f8f281c02d135ec3babd86516f726b4453
    
  • If you have GHC 7.8:

      remote-repo: stackage:http://www.stackage.org/stackage/160b97ce7459820d4de720d6a867b85297ab4351
    

Now just run:

$ sh scripts/pull-build

To do the above cabal update, submodule, install, etc.

Done!

Running

It runs at: http://localhost:1990/

Manually running the binary:

$ dist/build/hl/hl

Running from inside GHCi:

> :l DevelMain
> DevelMain.update

Run this every time you want to update the web handler in-place, as in this demo.

If you use Emacs, you can just bind it to a key:

(define-key html-mode-map [f12] 'haskell-process-reload-devel-main)

Just hit f12 to recompile and restart.

Architecture

It uses Yesod and an MVC organization.

Templates are written in senza, a convenience wrapper to blaze-html. There is presently no database.

Style

I use this style for code. You don't have to use this style, I can reformat patches as they come in.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap