Skip to content

Commit

Permalink
bump ver
Browse files Browse the repository at this point in the history
  • Loading branch information
rniii committed Aug 6, 2024
1 parent 3ace394 commit 3181ce9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion maid-build.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: maid-build
version: 0.1.0
version: 0.1.1
synopsis: Markdown-based task runner
description:
Maid is a task runner like make which uses readable markdown files for its commands
Expand Down
2 changes: 1 addition & 1 deletion src/Maid.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}

module Maid (run, module Maid.Parser) where
module Maid (run) where

import Maid.Parser (Task (..), parseTasks)

Expand Down
12 changes: 6 additions & 6 deletions src/Maid/Parser.hs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}

module Maid.Parser (parseTasks, Task(..)) where
module Maid.Parser (parseTasks, Task (..), parseMarkdown, Block(..), findTaskSection) where

import Control.Applicative (liftA2)
import Data.Char (isSpace)
import Data.Text (Text)
import qualified Data.Text as T

parseTasks :: Text -> [Task]
parseTasks = findTasks . parseMarkdown
parseTasks = findTaskSection . parseMarkdown

findTasks :: [Block] -> [Task]
findTasks (Heading h _ : Paragraph p : rest)
findTaskSection :: [Block] -> [Task]
findTaskSection (Heading h _ : Paragraph p : rest)
| ["<!--", "maid-tasks", "-->"] == T.words p =
tasks inner
where
Expand All @@ -23,8 +23,8 @@ findTasks (Heading h _ : Paragraph p : rest)
Task name "" (getLang lang) code : tasks rest
tasks (_ : rest) = tasks rest
tasks [] = []
findTasks (_ : rest) = findTasks rest
findTasks [] = []
findTaskSection (_ : rest) = findTaskSection rest
findTaskSection [] = []

getLang :: Text -> Text
getLang t | T.all isSpace t = "sh"
Expand Down

0 comments on commit 3181ce9

Please sign in to comment.