Skip to content

Commit

Permalink
Speed up docs-to-html
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Jan 29, 2024
1 parent d2bb44f commit 1876d23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions unison-cli/src/Unison/Codebase/Editor/HandleInput.hs
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,8 @@ loop e = do
Cli.respond $ Output.MarkdownOut (Text.intercalate "\n---\n" mdText)
DocsToHtmlI namespacePath' sourceDirectory -> do
Cli.Env {codebase, sandboxedRuntime} <- ask
rootBranch <- Cli.getRootBranch
absPath <- Path.unabsolute <$> Cli.resolvePath' namespacePath'
_evalErrs <- liftIO $ (Backend.docsInBranchToHtmlFiles sandboxedRuntime codebase rootBranch absPath sourceDirectory)
branch <- liftIO $ Codebase.getBranchAtPath codebase absPath
_evalErrs <- liftIO $ (Backend.docsInBranchToHtmlFiles sandboxedRuntime codebase branch sourceDirectory)
pure ()
AliasTermI src' dest' -> do
Cli.Env {codebase} <- ask
Expand Down
4 changes: 1 addition & 3 deletions unison-share-api/src/Unison/Server/Backend.hs
Original file line number Diff line number Diff line change
Expand Up @@ -911,13 +911,11 @@ docsInBranchToHtmlFiles ::
Rt.Runtime Symbol ->
Codebase IO Symbol Ann ->
Branch IO ->
Path ->
FilePath ->
-- Returns any doc evaluation errors which may have occurred.
-- Note that all docs will still be rendered even if there are errors.
IO [Rt.Error]
docsInBranchToHtmlFiles runtime codebase root currentPath directory = do
let currentBranch = Branch.getAt' currentPath root
docsInBranchToHtmlFiles runtime codebase currentBranch directory = do
let allTerms = (R.toList . Branch.deepTerms . Branch.head) currentBranch
-- ignores docs inside lib namespace, recursively
let notLib (_, name) = "lib" `notElem` Name.segments name
Expand Down

0 comments on commit 1876d23

Please sign in to comment.