1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-14 08:27:03 +03:00

Show import with public keyword in the html doc (#2456)

- Closes #2455
This commit is contained in:
Jan Mas Rovira 2023-10-23 17:08:27 +02:00 committed by GitHub
parent c6b3b95db3
commit f58c4a6d17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -431,7 +431,7 @@ goStatement = \case
StatementOpenModule t -> goOpen t
StatementFunctionDef t -> goFunctionDef t
StatementSyntax s -> goSyntax s
StatementImport {} -> mempty
StatementImport s -> goImport s
StatementModule m -> goLocalModule m
StatementProjectionDef {} -> mempty
where
@ -507,6 +507,11 @@ goLocalModule def = fmap (fromMaybe mempty) . runFail $ do
<$> mconcatMap goStatement (def ^. moduleBody)
return (header' <> body')
goImport :: forall r. (Members '[Reader HtmlOptions] r) => Import 'Scoped -> Sem r Html
goImport op
| Just Public <- op ^? importOpen . _Just . openPublic = noDefHeader <$> ppCodeHtml defaultOptions op
| otherwise = mempty
goOpen :: forall r. (Members '[Reader HtmlOptions] r) => OpenModule 'Scoped -> Sem r Html
goOpen op
| Public <- op ^. openModuleParams . openPublic = noDefHeader <$> ppCodeHtml defaultOptions op