Skip to content

Commit

Permalink
Now mostly reading entire CLHS structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tass0sm committed Mar 14, 2021
1 parent def8176 commit ad160a0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
2 changes: 2 additions & 0 deletions src-exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ main = do
outputTexinfo "./out.texi" newGraph
putStrLn "Finished Output"

-- putStrLn $ exportAsIs sGraph

-- (subcommand:args) <- getArgs
-- case subcommand of
-- "analyze" -> analyzeMain args
Expand Down
4 changes: 0 additions & 4 deletions src/Graphdoc/Analysis/HTML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,3 @@ analyzeHTML topdir = do

fileEdgeList <- getEveryFileEdge files
return (docMap, edges $ fileEdgeList)




1 change: 0 additions & 1 deletion src/Graphdoc/Conversion/Texinfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ convertToTexinfo :: DocGraph -> DocGraph
convertToTexinfo (docMap, docGraph) =
let nodeConverter = liftConverter convertPandoc
newMap = Map.map nodeConverter docMap
newGraph = gmap (-<.> "texi") docGraph
in (newMap, docGraph)
14 changes: 5 additions & 9 deletions src/Graphdoc/Output/Texinfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ findVertexWithBaseName path (_, docGraph) =

simplifiedGraph :: DocGraph -> Unlabelled.AdjacencyMap FilePath
simplifiedGraph (_, docGraph) =
let isTopEdge = ("TOP" == ) . (\(s, _, _) -> s)
labelledTopEdges = filter isTopEdge $ edgeList docGraph
unlabelledTopEdges = map (\(_, a, b) -> (b, a)) labelledTopEdges
in Unlabelled.edges unlabelledTopEdges
let isUpEdge = ("UP" == ) . (\(s, _, _) -> s)
labelledUpEdges = filter isUpEdge $ edgeList docGraph
unlabelledUpEdges = map (\(_, a, b) -> (b, a)) labelledUpEdges
in Unlabelled.edges unlabelledUpEdges

flattenGraph :: DocGraph -> [(Int, FilePath)]
flattenGraph graph =
let rootNode = findVertexWithBaseName "index" graph
let rootNode = findVertexWithBaseName "Chapter-Index" graph
simpleGraph = simplifiedGraph graph
in dfsWithDepth [rootNode] simpleGraph

Expand Down Expand Up @@ -69,7 +69,3 @@ outputTexinfo destination graph@(docMap, _) =
docText = simpleConverter totalDoc
in withFile destination WriteMode
(\h -> TIO.hPutStr h docText)




0 comments on commit ad160a0

Please sign in to comment.