From f2a73374e76e5da8ce893cae0cff6ab21209b152 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 1 Aug 2015 11:13:38 +0200 Subject: Rework metadata Simplify syntax (no leading dot), only pulled from root node, add extraction function. --- src/Main.lhs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Main.lhs') diff --git a/src/Main.lhs b/src/Main.lhs index 00123d5..5cc7c64 100644 --- a/src/Main.lhs +++ b/src/Main.lhs @@ -4,9 +4,10 @@ User interface .. class:: nodoc > module Main (main) where +> import System.IO (hPrint, stderr) > import Codec.Pesto.Parse (parse) > import Codec.Pesto.Graph (extract, toGraph, firstNodeId, resolveReferences) -> import Codec.Pesto.Lint (lint) +> import Codec.Pesto.Lint (lint, extractMetadata) > import Codec.Pesto.Dot (toDot) The pesto to dot converter can be run with ``cabal run pesto``. It expects a @@ -28,7 +29,8 @@ add linting information to graph > doc = (head . extract . snd . unzip) stream > nodes = zip [firstNodeId..] doc > edges = toGraph nodes ++ resolveReferences nodes -> --print $ lint nodes edges +> hPrint stderr $ extractMetadata nodes edges +> hPrint stderr $ lint nodes edges > putStrLn $ toDot nodes edges > malformedRecipe = print -- cgit v1.2.3