Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Non-English Tag
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Haisheng Wu  
View profile  
 More options Apr 17 2011, 8:08 am
From: Haisheng Wu <fre...@gmail.com>
Date: Sun, 17 Apr 2011 05:08:43 -0700 (PDT)
Local: Sun, Apr 17 2011 8:08 am
Subject: Re: Non-English Tag
Thanks Lubomír Sedlář. The "work around" works for me.

Another question comes up:
`(++".html")` turns out to be something duplicated impl with
`(setExtension "html")`

Are we able to glue Routes together as Arrows or Monad like what
Compiler in Hakyll?
I mean something like below:
~~~~~~
route $ do customeRoute myRoute
  >>= (setExtension "html")
~~~~~~

thanks.

On Apr 17, 6:11 am, Haisheng Wu <fre...@gmail.com> wrote:

> Thanks and sounds good for only few tags!

> On Apr 17, 5:13 am, Lubomír Sedlář <lubomir.sed...@gmail.com> wrote:

> > Hello,
> > I faced something like this — I use hakyll to generate website in Czech
> > and tags with some special characters (like ěščřžýáíé) caused problems.
> > The solution I used was to define custom route that stripped those
> > characters. Maybe you could use similar approach.

> > > match "tags/*" $ do
> > >     route $ customRoute tagToRoute
> > >     ...
> > > tagToRoute :: Identifier -> FilePath
> > > tagToRoute = (++".html") . map toLower . stripDiacritics . toFilePath

> > > stripDiacritics :: String -> String
> > > stripDiacritics str = foldl (\s (f,t) -> replace f t s) str diacritics

> > > replace :: Eq a => a -> a -> [a] -> [a]
> > > replace _ _ [] = []
> > > replace f r (x:xs)
> > >   | f == x    = r : replace f r xs
> > >   | otherwise = x : replace f r xs

> > > diacritics :: [(Char, Char)]
> > > diacritics = [ ('ě', 'e'), ('š', 's'), ('č', 'c'), ('ř', 'r'),
> > >                ('ž', 'z'), ('ý', 'y'), ('á', 'a'), ('í', 'i'),
> > >                ('é', 'e')]

> > Haisheng Wu píše v So 16. 04. 2011 v 19:34 -0700:

> > > What if I need non-English tags, for instance Chinese tags, what I
> > > should do to make it work?
> > > I'm a haskell newbie..

> > > I took a quick try, seems the only problem is that while auto
> > > generating html file for each tag,
> > > it did not put the Chinese characters as file name.
> > > While I manually fix the generated html file name, it works well.

> > > Any ideas?

> > > Thanks in advance!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.