what-is-goplaid.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package getting_started
  2. import (
  3. "github.com/qor5/docs/docsrc/examples/e00_basics"
  4. "github.com/qor5/docs/docsrc/generated"
  5. "github.com/qor5/docs/docsrc/utils"
  6. . "github.com/theplant/docgo"
  7. "github.com/theplant/docgo/ch"
  8. . "github.com/theplant/htmlgo"
  9. )
  10. var WhatIsQOR5 = Doc(
  11. Markdown(`
  12. QOR5 is a Go library to build web applications.
  13. different from other MVC frameworks. the concepts in QOR5 is **Page**, **Event**, **Component**.
  14. and doesn't include Model.
  15. A Page composite different kinds of Components, and Components trigger Events.
  16. A Page contains many event handlers, and renders one view, and event handlers reload the whole page,
  17. Or update certain part of the page, Or go to a different Page.
  18. QOR5 is opinionated in several ways:
  19. - It prefers writing HTML in static typing Go language, rather than a certain type of template language, Not even go template.
  20. - It try to minify the needs to write any JavaScript/Typescript for building interactive web applications
  21. - It maximize the reusability of Components. since it uses Go to write components, You can abstract component very easy, and use component from a third party Go package is also like using normal Go packages.
  22. - It prefers chain methods to set optional parameters of Component
  23. - It uses [Vue](https://vuejs.org/) js under the hood. and only Vue Component can be integrated
  24. `),
  25. utils.Anchor(H2(""), "Hello World"),
  26. Markdown(`
  27. Here is the most sample hello world, that show the header with Hello World.
  28. `),
  29. ch.Code(generated.HelloWorldSample).Language("go"),
  30. Markdown(`
  31. ~H1("Hello World")~ is actually a simple component. it renders h1 html tag. and been set to page body.
  32. The above is the code you mostly writing. the following is the boilerplate code that needs to write one time.
  33. `),
  34. ch.Code(generated.HelloWorldMuxSample1).Language("go"),
  35. ch.Code(generated.HelloWorldMuxSample2).Language("go"),
  36. ch.Code(generated.HelloWorldMainSample).Language("go"),
  37. utils.Demo("Hello World", e00_basics.HelloWorldPath, "e00_basics/hello-world.go"),
  38. Markdown(`
  39. If you wondering why ~H1("Hello World")~ and how this worked, Please go ahead and checkout next page
  40. `),
  41. ).Title("What is QOR5?").
  42. Slug("getting-started/what-is-qor5")