Skip to content

Commit

Permalink
Add functionality for custom languages file
Browse files Browse the repository at this point in the history
  • Loading branch information
sourrust committed Jun 11, 2015
1 parent edc8919 commit be4d822
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Hyakko.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,26 @@ printing them out in an HTML template.
> putStrLn "hyakko: no files or options given (try --help)"
> generateDocumentation opts xs = do
> dataDir <- getDataDir
> let opts' = configHyakko opts dataDir
> dirout = output opts'
> style <- hyakkoStyles opts'
> let opts' = configHyakko opts dataDir
> dirout = output opts'
> langFile = languages opts'
> style <- hyakkoStyles opts'
> langList <- decodeCustomLanguages langFile
> T.writeFile (dirout </> "hyakko.css") style
> unless (isNothing $ layout opts') $ do
> let layoutDir = fromJust $ layout opts'
> copyDirectory opts' $ dataDir </> "resources" </> layoutDir
> </> "public"
> forM_ xs $ \x -> do
> code <- T.readFile x
> let sections = parse (getLanguage x) code
> let language = maybe (getLanguage x) (getLanguage' x) langList
> sections = parse language code
> noSects = null sections
> when noSects $
> putStrLn $ "hyakko doesn't support the language extension "
> ++ takeExtension x
> unless noSects $ do
> let highlighted = highlight x sections
> let highlighted = highlight language sections
> y = mapSections sections highlighted
> generateHTML opts' x y

Expand Down

0 comments on commit be4d822

Please sign in to comment.