-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell meets Zettelkasten, for your plain-text delight. -- -- neuron is a system for managing your plain-text Zettelkasten notes. @package neuron @version 0.2.0.0 -- | Neuron git repo version -- -- This module is loaded in ghcid and cabal new-repl. However, nix-build -- will have it overwritten by the then `git describe` (see default.nix). module Neuron.Version.RepoVersion version :: Text module Neuron.Zettelkasten.Config -- | Config type for neuron.dhall -- -- See guide for description of the fields. data Config Config :: Maybe Text -> Maybe Text -> Bool -> Text -> Maybe Text -> Text -> Config [author] :: Config -> Maybe Text [editUrl] :: Config -> Maybe Text [mathJaxSupport] :: Config -> Bool [minVersion] :: Config -> Text [siteBaseUrl] :: Config -> Maybe Text [siteTitle] :: Config -> Text -- | Read the optional neuron.dhall config file from the -- zettelksaten getConfig :: Action Config instance GHC.Generics.Generic Neuron.Zettelkasten.Config.Config instance Dhall.FromDhall Neuron.Zettelkasten.Config.Config module Neuron.Zettelkasten.ID -- | Short Zettel ID encoding Day and a numeric index (on that day). -- -- Based on -- https://old.reddit.com/r/Zettelkasten/comments/fa09zw/shorter_zettel_ids/ newtype ZettelID ZettelID :: Text -> ZettelID [unZettelID] :: ZettelID -> Text -- | Represent the connection between zettels data Connection -- | A folgezettel points to a zettel that is conceptually a part of the -- parent zettel. Folgezettel :: Connection -- | Any other ordinary connection (eg: "See also") OrdinaryConnection :: Connection type ZettelConnection = (Connection, ZettelID) zettelIDDate :: ZettelID -> Day parseZettelID :: Text -> ZettelID -- | Extract ZettelID from the zettel's filename or path. mkZettelID :: Path Rel File -> ZettelID zettelNextIdForToday :: Path b Dir -> IO ZettelID zettelIDSourceFileName :: ZettelID -> Text instance GHC.Enum.Bounded Neuron.Zettelkasten.ID.Connection instance GHC.Enum.Enum Neuron.Zettelkasten.ID.Connection instance GHC.Show.Show Neuron.Zettelkasten.ID.Connection instance GHC.Classes.Ord Neuron.Zettelkasten.ID.Connection instance GHC.Classes.Eq Neuron.Zettelkasten.ID.Connection instance Data.Aeson.Types.ToJSON.ToJSON Neuron.Zettelkasten.ID.ZettelID instance GHC.Classes.Ord Neuron.Zettelkasten.ID.ZettelID instance GHC.Show.Show Neuron.Zettelkasten.ID.ZettelID instance GHC.Classes.Eq Neuron.Zettelkasten.ID.ZettelID instance Lucid.Base.ToHtml Neuron.Zettelkasten.ID.ZettelID module Neuron.Zettelkasten.Markdown neuronMMarkExts :: Config -> [Extension] module Neuron.Zettelkasten.Meta -- | YAML metadata in a zettel markdown file data Meta Meta :: Text -> Maybe [Text] -> Meta [title] :: Meta -> Text [tags] :: Meta -> Maybe [Text] getMeta :: MMark -> Maybe Meta instance Data.Aeson.Types.FromJSON.FromJSON Neuron.Zettelkasten.Meta.Meta instance GHC.Generics.Generic Neuron.Zettelkasten.Meta.Meta instance GHC.Show.Show Neuron.Zettelkasten.Meta.Meta instance GHC.Classes.Eq Neuron.Zettelkasten.Meta.Meta module Neuron.Zettelkasten.Type data Zettel Zettel :: ZettelID -> Text -> MMark -> Zettel [zettelID] :: Zettel -> ZettelID [zettelTitle] :: Zettel -> Text [zettelContent] :: Zettel -> MMark hasTag :: Text -> Zettel -> Bool instance GHC.Classes.Eq Neuron.Zettelkasten.Type.Zettel instance GHC.Classes.Ord Neuron.Zettelkasten.Type.Zettel instance GHC.Show.Show Neuron.Zettelkasten.Type.Zettel -- | Zettel store datastructure module Neuron.Zettelkasten.Store type ZettelStore = Map ZettelID Zettel -- | Load all zettel files mkZettelStore :: [Path Rel File] -> Action ZettelStore lookupStore :: ZettelID -> ZettelStore -> Zettel -- | Queries to the Zettel store module Neuron.Zettelkasten.Query data Query ByTag :: Text -> Query data Match Match :: ZettelID -> Text -> [Text] -> Match [matchID] :: Match -> ZettelID [matchTitle] :: Match -> Text [matchTags] :: Match -> [Text] matchQuery :: Match -> Query -> Bool extractMatch :: Zettel -> Maybe Match runQuery :: ZettelStore -> [Query] -> [Match] instance GHC.Show.Show Neuron.Zettelkasten.Query.Query instance GHC.Classes.Eq Neuron.Zettelkasten.Query.Query instance Data.Aeson.Types.ToJSON.ToJSON Neuron.Zettelkasten.Query.Match -- | Special Zettel links in Markdown module Neuron.Zettelkasten.Link.Action data LinkTheme LinkTheme_Default :: LinkTheme LinkTheme_Simple :: LinkTheme LinkTheme_WithDate :: LinkTheme data LinkAction LinkAction_ConnectZettel :: Connection -> LinkAction -- | Render a list (or should it be tree?) of links to queries zettels -- TODO: Should this automatically establish a connection in graph?? LinkAction_QueryZettels :: Connection -> LinkTheme -> [Query] -> LinkAction linkActionFromUri :: URI -> Maybe LinkAction queryFromUri :: URI -> [Query] linkThemeFromUri :: URI -> Maybe LinkTheme data MarkdownLink MarkdownLink :: Text -> URI -> MarkdownLink [markdownLinkText] :: MarkdownLink -> Text [markdownLinkUri] :: MarkdownLink -> URI linkActionConnections :: ZettelStore -> MarkdownLink -> [ZettelConnection] -- | Extract all links from the Markdown document extractLinks :: MMark -> [MarkdownLink] instance GHC.Classes.Ord Neuron.Zettelkasten.Link.Action.MarkdownLink instance GHC.Classes.Eq Neuron.Zettelkasten.Link.Action.MarkdownLink instance GHC.Show.Show Neuron.Zettelkasten.Link.Action.LinkAction instance GHC.Classes.Eq Neuron.Zettelkasten.Link.Action.LinkAction instance GHC.Classes.Ord Neuron.Zettelkasten.Link.Action.LinkTheme instance GHC.Show.Show Neuron.Zettelkasten.Link.Action.LinkTheme instance GHC.Classes.Eq Neuron.Zettelkasten.Link.Action.LinkTheme module Neuron.Zettelkasten.Graph -- | The Zettelkasten graph type ZettelGraph = AdjacencyMap [Connection] ZettelID -- | Build the Zettelkasten graph from the given list of note files. mkZettelGraph :: ZettelStore -> ZettelGraph -- | Return the backlinks to the given zettel backlinks :: ZettelID -> ZettelGraph -> [ZettelID] topSort :: ZettelGraph -> Either (NonEmpty ZettelID) [ZettelID] zettelClusters :: ZettelGraph -> [NonEmpty ZettelID] -- | Compute the dfsForest from the given zettels. dfsForestFrom :: [ZettelID] -> ZettelGraph -> Forest ZettelID -- | Compute the dfsForest ending in the given zettel. -- -- Return the forest flipped, such that the given zettel is the root. dfsForestBackwards :: ZettelID -> ZettelGraph -> Forest ZettelID -- | If the input is a tree with the given root node, return its children -- (as forest). Otherwise return the input as is. obviateRootUnlessForest :: (Show a, Eq a) => a -> [Tree a] -> [Tree a] -- | Zettel site's routes module Neuron.Zettelkasten.Route data Route store graph a [Route_IndexRedirect] :: Route ZettelStore ZettelGraph () [Route_ZIndex] :: Route ZettelStore ZettelGraph () [Route_Zettel] :: ZettelID -> Route ZettelStore ZettelGraph () -- | Return short name corresponding to the route routeName :: Route store graph a -> Text -- | Return full title for a route routeTitle :: Config -> store -> Route store graph a -> Text -- | Return the title for a route routeTitle' :: store -> Route store graph a -> Text routeOpenGraph :: Config -> store -> Route store graph a -> OpenGraph instance Rib.Route.IsRoute (Neuron.Zettelkasten.Route.Route store graph) -- | Special Zettel links in Markdown module Neuron.Zettelkasten.Link.View linkActionRender :: Monad m => ZettelStore -> MarkdownLink -> LinkAction -> HtmlT m () renderZettelLink :: forall m. Monad m => LinkTheme -> ZettelStore -> ZettelID -> HtmlT m () -- | Render a normal looking zettel link with a custom body. renderZettelLinkSimpleWith :: forall m a. (Monad m, ToHtml a) => Text -> Text -> a -> HtmlT m () -- | Special Zettel links in Markdown module Neuron.Zettelkasten.Link -- | MMark extension to transform z:/ links in Markdown linkActionExt :: ZettelStore -> Extension module Paths_neuron version :: Version getBinDir :: IO FilePath getLibDir :: IO FilePath getDynLibDir :: IO FilePath getDataDir :: IO FilePath getLibexecDir :: IO FilePath getDataFileName :: FilePath -> IO FilePath getSysconfDir :: IO FilePath module Neuron.Version -- | Neuron cabal library version neuronVersion :: Text -- | Neuron full version (cabal library version + git revision) neuronVersionFull :: Text -- | Check if neuronVersion is older than the given version olderThan :: Text -> Bool -- | HTML & CSS module Neuron.Zettelkasten.View renderRouteHead :: Monad m => Config -> Route store graph a -> store -> HtmlT m () renderRouteBody :: Monad m => Config -> Route store graph a -> (store, graph) -> HtmlT m () renderIndex :: Monad m => (ZettelStore, ZettelGraph) -> HtmlT m () renderZettel :: forall m. Monad m => Config -> (ZettelStore, ZettelGraph) -> ZettelID -> HtmlT m () renderTags :: Monad m => [Text] -> HtmlT m () -- | Font awesome element fa :: Monad m => Text -> HtmlT m () renderForest :: Monad m => Bool -> Maybe Int -> LinkTheme -> ZettelStore -> ZettelGraph -> [Tree ZettelID] -> HtmlT m () style :: Css -- | Main module for using neuron as a library, instead of as a CLI tool. module Neuron.Zettelkasten data App App :: FilePath -> Command -> App [notesDir] :: App -> FilePath [cmd] :: App -> Command data NewCommand NewCommand :: Text -> Bool -> NewCommand [title] :: NewCommand -> Text [edit] :: NewCommand -> Bool -- | optparse-applicative parser for neuron CLI commandParser :: Parser App run :: Action () -> IO () runWith :: Action () -> App -> IO () -- | Generate the Zettelkasten site generateSite :: (Route ZettelStore ZettelGraph () -> (ZettelStore, ZettelGraph) -> Action ()) -> [Path Rel File] -> Action (ZettelStore, ZettelGraph) -- | Create a new zettel file and open it in editor if requested -- -- As well as print the path to the created file. newZettelFile :: Path b Dir -> NewCommand -> IO () instance GHC.Show.Show Neuron.Zettelkasten.App instance GHC.Classes.Eq Neuron.Zettelkasten.App instance GHC.Show.Show Neuron.Zettelkasten.Command instance GHC.Classes.Eq Neuron.Zettelkasten.Command instance GHC.Show.Show Neuron.Zettelkasten.NewCommand instance GHC.Classes.Eq Neuron.Zettelkasten.NewCommand