-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move argToHtml to DocGen4.Output.Arg
- Loading branch information
Showing
2 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import DocGen4.Output.Base | ||
|
||
namespace DocGen4 | ||
namespace Output | ||
|
||
open scoped DocGen4.Jsx | ||
|
||
/-- | ||
Render an `Arg` as HTML, adding opacity effects etc. depending on what | ||
type of binder it has. | ||
-/ | ||
def argToHtml (arg : Process.Arg) : HtmlM Html := do | ||
let node ← infoFormatToHtml arg.binder | ||
let inner := <span class="fn">[node]</span> | ||
let html := Html.element "span" false #[("class", "decl_args")] #[inner] | ||
if arg.implicit then | ||
return <span class="impl_arg">{html}</span> | ||
else | ||
return html | ||
|
||
end Output | ||
end DocGen4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters