
I'm going start my very first blog, documenting my everyday struggle to switch my old imperative mind to the lazy functional setting, with a focus on FRP. Although you can find a lot of articles that provide help to get started with general blogging, it might be useful to pick a blog in which presenting Haskell code is easy (e.g. like hpaste that does the syntax coloring for you), and where users can give feedback, providing code, also with syntax coloring preferably. It would also be nice to allow hyperlinking every function in the code to the standard Haskell library docs or to the docs on Hackage. Googling for "how to start a Haskell blog" just revealed a lot of Haskell blogs. Could you share your experiences with me about starting a blog? BTW: I'm on Windows. Thanks a lot, Peter Verswyvelen

On Sat, Aug 22, 2009 at 6:35 AM, Peter Verswyvelen
I'm going start my very first blog, documenting my everyday struggle to switch my old imperative mind to the lazy functional setting, with a focus on FRP. Although you can find a lot of articles that provide help to get started with general blogging, it might be useful to pick a blog in which presenting Haskell code is easy (e.g. like hpaste that does the syntax coloring for you), and where users can give feedback, providing code, also with syntax coloring preferably. It would also be nice to allow hyperlinking every function in the code to the standard Haskell library docs or to the docs on Hackage. Googling for "how to start a Haskell blog" just revealed a lot of Haskell blogs. Could you share your experiences with me about starting a blog? BTW: I'm on Windows. Thanks a lot, Peter Verswyvelen
Being a lazy person, I would just use Gitit. There are a lot of advantages to doing so. You get the highlighting-kate syntax-hilighting for your Haskell code (and your Scheme code and your...); you get a server; you get various plugins like interwiki links to all the Wikipedias and Wikias or graphviz image generation; you get RSS feeds for pages*, such as your Front Page so you can in effect have your Front Page be a blog just by writing articles and adding to the Front Page a link to them; you get sane markup (either Markup, Markdown, or literate Haskell), which *won't* mangle, spindle, and fold whatever you write**; you get a nice Git or Darcs repo of your writings which you can share or backup; etc. About the only disadvantages to this lightweight blogging approach are that the wiki might not look 'blog-like' unless you edit the CSS/HTML, and Gitit currently doesn't allow anonymous page creation or edits of the Discussion pages. (I'm fairly sure Gitit is supposed to work on Windows, also.) * HEAD only ** sad to say, not something that can be assumed; more than once I've seen Haskell-related blog posts or comments get mangled by the blogging software -- gwern

Thanks. At first sight gitit requires that I setup my own server.
Although this has advantages and I did that in the past, I prefer to use a
public server (actually my internet provider's license forbids hosting a
server)
Does one exist for gitit?
Also Gitit is an unfortunate name since "Git It" has become a saying
apparently, so googling for it give me all the wrong hits ;-)
Bing guided me towards http://www.johnmacfarlane.net, but I guess that site
is just a showcase for the author?
On Sat, Aug 22, 2009 at 12:51 PM, Gwern Branwen
I'm going start my very first blog, documenting my everyday struggle to switch my old imperative mind to the lazy functional setting, with a focus on FRP. Although you can find a lot of articles that provide help to get started with general blogging, it might be useful to pick a blog in which
On Sat, Aug 22, 2009 at 6:35 AM, Peter Verswyvelen
wrote: presenting Haskell code is easy (e.g. like hpaste that does the syntax coloring for you), and where users can give feedback, providing code, also with syntax coloring preferably. It would also be nice to allow hyperlinking every function in the code to the standard Haskell library docs or to the docs on Hackage. Googling for "how to start a Haskell blog" just revealed a lot of Haskell blogs. Could you share your experiences with me about starting a blog? BTW: I'm on Windows. Thanks a lot, Peter Verswyvelen
Being a lazy person, I would just use Gitit. There are a lot of advantages to doing so.
You get the highlighting-kate syntax-hilighting for your Haskell code (and your Scheme code and your...); you get a server; you get various plugins like interwiki links to all the Wikipedias and Wikias or graphviz image generation; you get RSS feeds for pages*, such as your Front Page so you can in effect have your Front Page be a blog just by writing articles and adding to the Front Page a link to them; you get sane markup (either Markup, Markdown, or literate Haskell), which *won't* mangle, spindle, and fold whatever you write**; you get a nice Git or Darcs repo of your writings which you can share or backup; etc.
About the only disadvantages to this lightweight blogging approach are that the wiki might not look 'blog-like' unless you edit the CSS/HTML, and Gitit currently doesn't allow anonymous page creation or edits of the Discussion pages. (I'm fairly sure Gitit is supposed to work on Windows, also.)
* HEAD only ** sad to say, not something that can be assumed; more than once I've seen Haskell-related blog posts or comments get mangled by the blogging software
-- gwern

On Sat, Aug 22, 2009 at 9:34 AM, Peter Verswyvelen
Thanks. At first sight gitit requires that I setup my own server.
That's how the Happstack model works.
Although this has advantages and I did that in the past, I prefer to use a public server (actually my internet provider's license forbids hosting a server) Does one exist for gitit?
Nothing stops you from proxying through Apache, for example. That's how the Darcs wiki does it - Gitit listens on 127.0.0.1:5001 and Apache forwards from wiki.darcs.net:80. Or something like that.
Also Gitit is an unfortunate name since "Git It" has become a saying apparently, so googling for it give me all the wrong hits ;-)
Well, I've been pushing for any Gitit site backed by a darcs repo to be called a 'darcsit', which is very Google-search-friendly a name.
Bing guided me towards http://www.johnmacfarlane.net, but I guess that site is just a showcase for the author?
Well, what are you looking for? Gitit's obviously on Hackage, and it links to the homepage (such as it is) on Github; there are a number of running examples besides John's site, such as http://wiki.darcs.net/ or http://lhc.seize.it/ -- gwern

Hello, What I do is I write my blog posts using a literate Haskell + html. This allows me to actually run all the code and make sure it works. I can then use hscolour to transform the literal Haskell into html (with syntax highlighting). As a reader, I think you imagine that I have two distinct things: 1. some application I have written with comments, etc 2. a blog post I have written about the app, by copying and pasting the code into the blog post But, having two copies of the code in play is tricky. Instead I have a single set of source, and I generate the normal looking code and the blog post from the same source. This ensures that everything stays in-sync. So, I actually have three things going on: 1. a literate Haskell document which contains the source code, the blog post markup, and is directly executable. I can load this document directly into GHCi while I work on it -- no extra steps required. From that literate document I generate: 2. a blog post where all the source code has been highlighting via HsColour. The non-source parts are just the HTML I wrote in the literate comments. 3. a plain old Haskell code version of my codebase which includes Haskell comments, but none of the literate comments. This post: http://nhlab.blogspot.com/2008_07_01_archive.html was generated from this source: darcs get http://src.seereason.com/examples/happs-hsp-quickstart/ running 'make' will generate the html which can be copied into the blog posting form. running 'make test' will actually run the literate code. running 'make template' will produce a non-literate version of the code base in the template directory. The following 'tricks' are used: 1. use cpp and #ifdef HsColour, so that some bits of code get syntax highlighting, but aren't compiled when you actually run the literate Haskell. 2. If your application is spread across multiple modules, you can use: #ifdef HsColour #include "SimpleExample.lhs" #endif to merge all the dependent modules into a single .html file. 3. Sometimes in a blog post you want to show multiple interations of a function. But, you can't reuse the same name because you get name collisions, so you have to keep renaming the function as you talk about it: myfunc = ... myfunc' = ... myfunc'' = ... sometimes you can work around this by putting each iteration in a separate file, #ifdef HsColour #include "MyFunc1.lhs" #endif #ifdef HsColour #include "MyFunc2.lhs" #endif #ifdef HsColour #include "MyFunc3.lhs" #endif You can then run each version independently in ghci to test them, but they will all be included in the master .html file. 4. The following targets run the preprocessor and then invoke HsColour with the correct arguments for turning code parts into html while preserving the existing html in the literate comments: %.html: %.cpphs HsColour -css $< -o$@ -lit validate -w --verbose --emacs $@ %.cpphs: %.lhs cpp -traditional-cpp -DHsColour -P $< $@ 5. this target can be used to extract just the non-literate parts from the .lhs %.hs: %.lhs sed -n 's/^> \?//p' $^ > $@ 6. hide the pre-processor option In order to be able to load the .lhs files into GHCi, the preprocessor needs to run. But, that is just a side effect of this blogging system, so I don't want the pragma for running cpp to show up in the blog post itself. This turns out to be a bit tricky. The work around is to enable the cpp flag inside an HTML comment, so that the option is enabled, but the user doesn't see it: 7. other And, finally, to get the highlight code to show up highlight in blogger, I had to modify my default blogger template to include the css from emacs.css in the HsColour package. I don't claim that this is the most elegant setup. It's key benefits are that you can actually run the code in the blog post, and not worry about copy and paste errors, or updating your code and forgetting to update the blog post as well. Additionally, you can automatically extract the code and non-literate comments from the blogpost to get a nice stand alone, commented program. I like this approach, because as I blog about an application, I often see improvements, bug fixes, or other changes I want to make. By having only one copy of the code, I don't have to worry about the blog post and code base getting out of sync. - jeremy p.s. That post is old and depends on a bunch of obsolete libraries, so I would not spend anytime trying to get the Haskell code in it to actually run. At Sat, 22 Aug 2009 12:35:52 +0200, Peter Verswyvelen wrote:
[1
] [1.1 ] I'm going start my very first blog, documenting my everyday struggle to switch my old imperative mind to the lazy functional setting, with a focus on FRP. Although you can find a lot of articles that provide help to get started with general blogging, it might be useful to pick a blog in which presenting Haskell code is easy (e.g. like hpaste that does the syntax coloring for you), and where users can give feedback, providing code, also with syntax coloring preferably. It would also be nice to allow hyperlinking every function in the code to the standard Haskell library docs or to the docs on Hackage. Googling for "how to start a Haskell blog" just revealed a lot of Haskell blogs.
Could you share your experiences with me about starting a blog?
BTW: I'm on Windows.
Thanks a lot, Peter Verswyvelen [1.2
] [2
] _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Sat, Aug 22, 2009 at 3:35 AM, Peter Verswyvelen
Could you share your experiences with me about starting a blog? BTW: I'm on Windows.
I've found it hard work to post a mixture of English, Mathematics and Haskell. Neither of the most popular blogging web sites are very helpful in this regard: wordpress.com and blogger.com. I did write a little Haskell program to do some markup suitable for blogger.com but it's very limited for embedding mathematics, knowing only a handful of TeX commands, and doesn't play well with blogger's system for uploading images. Wordpress looked good at first but I found all kinds of problems with it. I guess I should force myself to catch up with the 21st century and learn how to write code to talk directly to these web sites, but I find it hard to motivate myself to be interested in writing code for all that HTML/XML/ATOM/<Insert your favourite acronym here> stuff. (I think my day job is one of the few remaining software jobs that hasn't been XMLified.) But I've seen lots of nice Haskell blogs with embedded mathematics so there must be good solutions out there. What are they? What I'd really like is to blog in PDF. -- Dan

On Sat, Aug 22, 2009 at 12:56 PM, Dan Piponi
On Sat, Aug 22, 2009 at 3:35 AM, Peter Verswyvelen
wrote: Could you share your experiences with me about starting a blog? BTW: I'm on Windows.
I've found it hard work to post a mixture of English, Mathematics and Haskell. Neither of the most popular blogging web sites are very helpful in this regard: wordpress.com and blogger.com. I did write a little Haskell program to do some markup suitable for blogger.com but it's very limited for embedding mathematics, knowing only a handful of TeX commands, and doesn't play well with blogger's system for uploading images. Wordpress looked good at first but I found all kinds of problems with it.
Gitit handles simple TeX fairly well; and it can even compile the TeX to MathML so one doesn't need JsMath to display the TeX.
I guess I should force myself to catch up with the 21st century and learn how to write code to talk directly to these web sites, but I find it hard to motivate myself to be interested in writing code for all that HTML/XML/ATOM/<Insert your favourite acronym here> stuff. (I think my day job is one of the few remaining software jobs that hasn't been XMLified.)
But I've seen lots of nice Haskell blogs with embedded mathematics so there must be good solutions out there. What are they?
What I'd really like is to blog in PDF.
Gitit can export pages to LaTeX, thanks to pandoc, which is easy to turn into PDFs. :) -- gwern

On Sat, Aug 22, 2009 at 11:35 AM, Peter Verswyvelen
I'm going start my very first blog, documenting my everyday struggle to switch my old imperative mind to the lazy functional setting, with a focus on FRP. Although you can find a lot of articles that provide help to get started with general blogging, it might be useful to pick a blog in which presenting Haskell code is easy (e.g. like hpaste that does the syntax coloring for you), and where users can give feedback, providing code, also with syntax coloring preferably. It would also be nice to allow hyperlinking every function in the code to the standard Haskell library docs or to the docs on Hackage. Googling for "how to start a Haskell blog" just revealed a lot of Haskell blogs. Could you share your experiences with me about starting a blog? BTW: I'm on Windows.
Wordpress with wp-syntax works fine for me. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe
participants (6)
-
Dan Piponi
-
Gwern Branwen
-
Jeremy Shaw
-
Magnus Therning
-
Peter Verswyvelen
-
Simon Michael