[Haskell-cafe] Re: ANN: yst 0.2.1
This sounds great! I really like using yaml for web development. However, my last use case was for a non-techie, so I created a little desktop application for editing the yamlbase, if you excuse the neologism. I think it worked quite well, because the user was then presented with a friendly looking system ( I even wrote a little calendar widget :) without having to spend the precious moneys on dynamic hosting. In the end, everyone was very happy. Actually, it was written in Ruby, and Shoes, and the data part was a lot less powerful than the yst query language there - but I think that an analogous tool would be useful; a GUI which creates yst scripts, would make yst a very powerful tool for non-techies. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ANN: yst 0.2.1
Thanks. I'll put a note to this effect in the README. John +++ Jinjing Wang [Aug 03 09 18:17 ]: It's possible to serve the generated site with maid, in case apache is not available: cabal update cabal install maid yst create testsite cd testsite yst cd site maid now goto http://localhost:3000/ On Mon, Aug 3, 2009 at 9:05 AM, John MacFarlanej...@berkeley.edu wrote: I'm pleased to announce the release of yst, now available on HackageDB. yst generates static websites from YAML or CSV data files and StringTemplates. This approach combines the speed, security, and ease of deployment of a static website with the flexibility and maintainability of a dynamic site that separates presentation and data. The easiest way to get a feel for yst is to try it: cabal update cabal install yst yst create testsite cd testsite yst yst attempts to fill a niche between two kinds of site creation tools. On the one hand you have simple static site generators like webgen, webby, nanoc, and my old custom system using make and pandoc. On the other hand, you have dynamic web frameworks like rails and django. For my own smallish websites, I found that the dynamic frameworks were overkill. Nobody but me was going to edit the pages, and I didn't want the trouble of writing and deploying a dynamic site, setting up a web server, and administering a database. A static site would be faster, easier to deploy, and more secure. But the dynamic frameworks offered one thing that the static site generators did not: an easy way to separate data from presentation. This was becoming increasingly important to me as I found myself constantly updating the same information (say, publication data for a paper) in multiple places (say, a LaTeX CV and a differently formatted web listing of papers). What I wanted was a site generation tool that used YAML text files as a database and allowed different kinds of documents to be produced from the same data. I couldn't find anything that did just what I wanted, so I wrote yst. By way of illustration, here are the build instructions for HTML and LaTeX versions of a CV, plus a web page with a list of papers: - url: cv.html title: CV template: cv.st data_common: cvdata contact: from contact.yaml jobsbyemployer: from jobs.yaml order by start group by employer degrees: from degrees.yaml order by year desc awards: from awards.yaml order by year desc group by title papers: from papers.yaml order by year desc where (not (type = 'review')) reviews: from papers.yaml order by year desc where type = 'review' talks: from talks.yaml where date '2009-09-01' order by date desc group by title dissertations: from dissertations.yaml order by role then year group by role theses: from theses.yaml order by year then student courses: from courses.yaml order by number group by title data: : *cvdata html: yes - url: cv.tex title: CV inmenu: no template: cv.st layout: layout.tex.st data: : *cvdata html: yes - url: papers.html title: Papers template: papers.st data: papersbyyear: from papers.yaml order by year desc then title group by year yst's query language is limited, and there are lots of things you can do with a full-fledged database that you can't do with yst. But yst is ideal, I think, for small to medium data-driven sites that are maintained by a single person who likes working with plain text. It scratched my itch, anyway, and I release it in case anyone else has the same itch. Code, documentation, and bug reports: http://github.com/jgm/yst/tree/master John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- jinjing ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: ANN: yst 0.2.1
Hey John, I noticed that your code is using the Syck library for Yaml. How were you able to get it to deal with Unicode characters? I just wrote a new yaml library based on libyaml if you want to give it a shot (yaml on hackage). It doesn't support aliases, but is otherwise feature complete. Michael On Mon, Aug 3, 2009 at 7:12 PM, John MacFarlane j...@berkeley.edu wrote: Thanks. I'll put a note to this effect in the README. John +++ Jinjing Wang [Aug 03 09 18:17 ]: It's possible to serve the generated site with maid, in case apache is not available: cabal update cabal install maid yst create testsite cd testsite yst cd site maid now goto http://localhost:3000/ On Mon, Aug 3, 2009 at 9:05 AM, John MacFarlanej...@berkeley.edu wrote: I'm pleased to announce the release of yst, now available on HackageDB. yst generates static websites from YAML or CSV data files and StringTemplates. This approach combines the speed, security, and ease of deployment of a static website with the flexibility and maintainability of a dynamic site that separates presentation and data. The easiest way to get a feel for yst is to try it: cabal update cabal install yst yst create testsite cd testsite yst yst attempts to fill a niche between two kinds of site creation tools. On the one hand you have simple static site generators like webgen, webby, nanoc, and my old custom system using make and pandoc. On the other hand, you have dynamic web frameworks like rails and django. For my own smallish websites, I found that the dynamic frameworks were overkill. Nobody but me was going to edit the pages, and I didn't want the trouble of writing and deploying a dynamic site, setting up a web server, and administering a database. A static site would be faster, easier to deploy, and more secure. But the dynamic frameworks offered one thing that the static site generators did not: an easy way to separate data from presentation. This was becoming increasingly important to me as I found myself constantly updating the same information (say, publication data for a paper) in multiple places (say, a LaTeX CV and a differently formatted web listing of papers). What I wanted was a site generation tool that used YAML text files as a database and allowed different kinds of documents to be produced from the same data. I couldn't find anything that did just what I wanted, so I wrote yst. By way of illustration, here are the build instructions for HTML and LaTeX versions of a CV, plus a web page with a list of papers: - url: cv.html title: CV template: cv.st data_common: cvdata contact: from contact.yaml jobsbyemployer: from jobs.yaml order by start group by employer degrees: from degrees.yaml order by year desc awards: from awards.yaml order by year desc group by title papers: from papers.yaml order by year desc where (not (type = 'review')) reviews: from papers.yaml order by year desc where type = 'review' talks: from talks.yaml where date '2009-09-01' order by date desc group by title dissertations: from dissertations.yaml order by role then year group by role theses: from theses.yaml order by year then student courses: from courses.yaml order by number group by title data: : *cvdata html: yes - url: cv.tex title: CV inmenu: no template: cv.st layout: layout.tex.st data: : *cvdata html: yes - url: papers.html title: Papers template: papers.st data: papersbyyear: from papers.yaml order by year desc then title group by year yst's query language is limited, and there are lots of things you can do with a full-fledged database that you can't do with yst. But yst is ideal, I think, for small to medium data-driven sites that are maintained by a single person who likes working with plain text. It scratched my itch, anyway, and I release it in case anyone else has the same itch. Code, documentation, and bug reports: http://github.com/jgm/yst/tree/master John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- jinjing ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ANN: yst 0.2.1
+++ Michael Snoyman [Aug 03 09 22:20 ]: Hey John, I noticed that your code is using the Syck library for Yaml. How were you able to get it to deal with Unicode characters? I just wrote a new yaml library based on libyaml if you want to give it a shot (yaml on hackage). It doesn't support aliases, but is otherwise feature complete. Michael Oh, rats, I hadn't realized that Syck had that limitation! I think I can work around it, but I'll have to look into it. I wasn't able to install your yaml library: % cabal install yaml Resolving dependencies... Configuring yaml-0.0.0... Preprocessing library yaml-0.0.0... dist/build/Text/Libyaml.chs.h:2:31: error: ../../../c/helper.h: No such file or directory c2hs: Error during preprocessing custom header file cabal: Error: some packages failed to install: yaml-0.0.0 failed during the building phase. The exception was: exit: ExitFailure 1 I have debian libyaml-dev installed. Any ideas? Also, how hard would it be to support aliases in your package? I use them. John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ANN: yst 0.2.1
+++ John MacFarlane [Aug 03 09 13:23 ]: +++ Michael Snoyman [Aug 03 09 22:20 ]: Hey John, I noticed that your code is using the Syck library for Yaml. How were you able to get it to deal with Unicode characters? I just wrote a new yaml library based on libyaml if you want to give it a shot (yaml on hackage). It doesn't support aliases, but is otherwise feature complete. Michael Oh, rats, I hadn't realized that Syck had that limitation! I think I can work around it, but I'll have to look into it. Okay, I've found a workaround -- use Syck to parse a bytestring, then do my own decoding on string buffers in the resulting parse tree. Unicode in data files now works well. (Code now on github -- will be released soon.) John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe