style
This commit is contained in:
		
							parent
							
								
									6cd0b9f663
								
							
						
					
					
						commit
						87ee5df0fe
					
				
							
								
								
									
										9
									
								
								site.hs
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								site.hs
									
									
									
									
									
								
							| 
						 | 
					@ -3,7 +3,7 @@
 | 
				
			||||||
-- | The main deployment script.
 | 
					-- | The main deployment script.
 | 
				
			||||||
module Main where
 | 
					module Main where
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import Control.Monad ((>=>), unless, when, join)
 | 
					import Control.Monad ((>=>), join, unless, when)
 | 
				
			||||||
import Control.Monad.Extra (whenM)
 | 
					import Control.Monad.Extra (whenM)
 | 
				
			||||||
import Control.Monad.Trans.State.Lazy
 | 
					import Control.Monad.Trans.State.Lazy
 | 
				
			||||||
import qualified Data.Aeson as AE
 | 
					import qualified Data.Aeson as AE
 | 
				
			||||||
| 
						 | 
					@ -184,12 +184,11 @@ addTOC pi doc meta@(Y.Object meta') =
 | 
				
			||||||
  let go n = do
 | 
					  let go n = do
 | 
				
			||||||
        toc <-
 | 
					        toc <-
 | 
				
			||||||
          io . runIOorExplode $ writeHtml5String htmlWriteOpts $
 | 
					          io . runIOorExplode $ writeHtml5String htmlWriteOpts $
 | 
				
			||||||
          withPandocBlocks
 | 
					          withPandocBlocks (pure . toTableOfContents (tocWriteOpts n)) doc
 | 
				
			||||||
            (pure . toTableOfContents (tocWriteOpts n))
 | 
					 | 
				
			||||||
            doc
 | 
					 | 
				
			||||||
        pure . Y.Object $ KM.insert "toc" (Y.String toc) meta'
 | 
					        pure . Y.Object $ KM.insert "toc" (Y.String toc) meta'
 | 
				
			||||||
   in case ( pi ^? pageMeta . key "toc" . _Bool
 | 
					   in case ( pi ^? pageMeta . key "toc" . _Bool
 | 
				
			||||||
           , join $ pi ^? pageMeta . key "toc" . _Number . to Data.Scientific.toBoundedInteger) of
 | 
					           , join $ pi ^? pageMeta . key "toc" . _Number .
 | 
				
			||||||
 | 
					             to Data.Scientific.toBoundedInteger) of
 | 
				
			||||||
        (Just False, _) -> pure meta
 | 
					        (Just False, _) -> pure meta
 | 
				
			||||||
        (_, Nothing) -> go (3 :: Int)
 | 
					        (_, Nothing) -> go (3 :: Int)
 | 
				
			||||||
        (_, Just n) -> go n
 | 
					        (_, Just n) -> go n
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue