-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from qor5/listing-inline
listing rewrite
- Loading branch information
Showing
170 changed files
with
4,804 additions
and
14,032 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
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 |
---|---|---|
|
@@ -235,14 +235,14 @@ <h1 class='mb-8'>The Go HTML builder</h1> | |
|
||
<p>Consider the following code:</p> | ||
|
||
<highlightjs :language='"go"' :code='"import (\n\t\"github.com/qor5/admin/v3/docs/docsrc/examples\"\n\t\"github.com/qor5/web/v3\"\n\t. \"github.com/theplant/htmlgo\"\n)\n\nfunc result(args ...HTMLComponent) HTMLComponent {\n\tvar converted []HTMLComponent\n\tfor _, arg := range args {\n\t\tconverted = append(converted, Div(arg).Class(\"wrapped\"))\n\t}\n\n\treturn HTML(\n\t\tHead(\n\t\t\tTitle(\"XML encoding with Go\"),\n\t\t),\n\t\tBody(\n\t\t\tH1(\"XML encoding with Go\"),\n\t\t\tP().Text(\"this format can be used as an alternative markup to XML\"),\n\t\t\tA().Href(\"http://golang.org\").Text(\"Go\"),\n\t\t\tP(\n\t\t\t\tText(\"this is some\"),\n\t\t\t\tB(\"mixed\"),\n\t\t\t\tText(\"text. For more see the\"),\n\t\t\t\tA().Href(\"http://golang.org\").Text(\"Go\"),\n\t\t\t\tText(\"project\"),\n\t\t\t),\n\t\t\tP().Text(\"some text\"),\n\n\t\t\tP(converted...),\n\t\t),\n\t)\n}\n\nfunc TypeSafeBuilderExample(ctx *web.EventContext) (pr web.PageResponse, err error) {\n\tpr.Body = result(H5(\"1\"), B(\"2\"), Strong(\"3\"))\n\treturn\n}\n\nvar TypeSafeBuilderSamplePFPB = web.Page(TypeSafeBuilderExample)\n\nvar TypeSafeBuilderSamplePath = examples.URLPathByFunc(TypeSafeBuilderExample)\n"'></highlightjs> | ||
<highlightjs :language='"go"' :code='"import (\n\t\"github.com/qor5/web/v3\"\n\t. \"github.com/theplant/htmlgo\"\n)\n\nfunc result(args ...HTMLComponent) HTMLComponent {\n\tvar converted []HTMLComponent\n\tfor _, arg := range args {\n\t\tconverted = append(converted, Div(arg).Class(\"wrapped\"))\n\t}\n\n\treturn HTML(\n\t\tHead(\n\t\t\tTitle(\"XML encoding with Go\"),\n\t\t),\n\t\tBody(\n\t\t\tH1(\"XML encoding with Go\"),\n\t\t\tP().Text(\"this format can be used as an alternative markup to XML\"),\n\t\t\tA().Href(\"http://golang.org\").Text(\"Go\"),\n\t\t\tP(\n\t\t\t\tText(\"this is some\"),\n\t\t\t\tB(\"mixed\"),\n\t\t\t\tText(\"text. For more see the\"),\n\t\t\t\tA().Href(\"http://golang.org\").Text(\"Go\"),\n\t\t\t\tText(\"project\"),\n\t\t\t),\n\t\t\tP().Text(\"some text\"),\n\n\t\t\tP(converted...),\n\t\t),\n\t)\n}\n\nfunc TypeSafeBuilderExample(ctx *web.EventContext) (pr web.PageResponse, err error) {\n\tpr.Body = result(H5(\"1\"), B(\"2\"), Strong(\"3\"))\n\treturn\n}\n\nvar TypeSafeBuilderSamplePFPB = web.Page(TypeSafeBuilderExample)\n\nvar TypeSafeBuilderSamplePath = URLPathByFunc(TypeSafeBuilderExample)\n"'></highlightjs> | ||
<p>It's basically assembled what Kotlin can do, Also is legitimate Go code.</p> | ||
|
||
<div> | ||
<div class='demo'> | ||
<a href='/samples/type-safe-builder-example' target='_blank'>Check the demo</a> | ||
<a href='/examples/type-safe-builder-example' target='_blank'>Check the demo</a> | ||
| | ||
<a href='https://github.com/qor5/admin/tree/main/docs/docsrc/examples/examples_web/type-safe-builder-sample.go#L3-L47' target='_blank'>Source on GitHub</a> | ||
<a href='https://github.com/qor5/admin/tree/main/docs/docsrc/../../../../../../pkg/mod/github.com/qor5/web/[email protected]/examples/type-safe-builder-sample.go#L3-L46' target='_blank'>Source on GitHub</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Oops, something went wrong.