File tree Expand file tree Collapse file tree 5 files changed +7
-4
lines changed Expand file tree Collapse file tree 5 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ import Control.Lens
9
9
import Data.Attoparsec.Text qualified as A
10
10
import Data.Text qualified as T
11
11
import Data.Text.IO qualified as TIO
12
- import System.FilePath qualified as File
12
+ import System.Directory qualified as D
13
+ import System.FilePath qualified as F
13
14
14
15
changeMatlabMarkdownDelimeters :: T. Text -> T. Text
15
16
changeMatlabMarkdownDelimeters = T. replace " \n $$ " " \n ```math\n " . T. replace " $$ \n " " \n ``` \n " . T. replace " \n $" " \n $`" . T. replace " $\n " " `$\n "
@@ -37,10 +38,12 @@ parseVersion = do
37
38
generateMatlabAnswersDB :: FilePath -> Node -> IO ()
38
39
generateMatlabAnswersDB outputDirPath node =
39
40
let (intro, groups) = groupByProblems node
40
- toDoc = Node Nothing DOCUMENT
41
- writeMD name nodes = TIO. writeFile (outputDirPath File. </> (name <> " .md" )) (CMark. nodeToCommonmark [] Nothing (toDoc nodes))
41
+ toDocText = CMark. nodeToCommonmark [] Nothing . Node Nothing DOCUMENT
42
+ writeMD name nodes = do
43
+ D. createDirectory $ outputDirPath F. </> name
44
+ TIO. writeFile (outputDirPath F. </> name F. </> " a.md" ) (toDocText nodes)
42
45
in do
43
- writeMD " cover" intro
46
+ TIO. writeFile (outputDirPath F. </> " cover.md " ) (toDocText intro)
44
47
mapM_ (uncurry writeMD) groups
45
48
46
49
readMatlabMD :: FilePath -> IO Node
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments