scripths 0.1.0.1 → 0.1.0.2
raw patch · 5 files changed
+10/−8 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- app/Main.hs +1/−1
- scripths.cabal +1/−1
- src/ScriptHs/Render.hs +1/−3
- test/Test/Render.hs +3/−3
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for scripths +## 0.1.0.2 -- 2026-02-28++* Make blocks out of single lines of code as well.+ ## 0.1.0.1 -- 2026-02-24 * Fix code new ine behaviour for code fencing.
app/Main.hs view
@@ -38,7 +38,7 @@ outputFile (x : xs) = if "--output=" `isPrefixOf` x then Just (drop (length "--output=") x)- else outputFile (tail xs)+ else outputFile (drop 1 xs) usage :: IO () usage = do
scripths.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: scripths-version: 0.1.0.1+version: 0.1.0.2 synopsis: GHCi scripts for standalone execution and Markdown documentation. description: GHCi scripts for standalone execution (with dependency resolution) and Markdown documentation (produces inline output). homepage: https://www.datahaskell.org/
src/ScriptHs/Render.hs view
@@ -101,9 +101,7 @@ renderBlock (SingleLine (GhciCommand t)) = [t] renderBlock (SingleLine (Pragma t)) = [t] renderBlock (SingleLine (Import t)) = [t]-renderBlock (SingleLine (HaskellLine t))- | isIOorTH t = wrapMulti [t]- | otherwise = [t]+renderBlock (SingleLine (HaskellLine t)) = wrapMulti [t] renderBlock (MultiLine ls) | allIOorTH ls = concatMap (\l -> wrapMulti [lineText l]) ls | otherwise = wrapMulti (map lineText ls)
test/Test/Render.hs view
@@ -16,7 +16,7 @@ "Single lines" [ testCase "plain expression stays unwrapped" $ do let result = toGhciScript [HaskellLine "print 42"]- assertNotWrapped result+ assertWrapped result ["print 42"] , testCase "import stays unwrapped" $ do let result = toGhciScript [Import "import Data.Text"] assertNotWrapped result@@ -55,8 +55,8 @@ ] let blocks = splitBlocks result assertBool- ("expected 1 block, got " ++ show (length blocks) ++ ": " ++ show blocks)- (length blocks == 1)+ ("expected 3 blocks, got " ++ show (length blocks) ++ ": " ++ show blocks)+ (length blocks == 3) ] , testGroup "Multi-line blocks"