its-the-whole-house.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package advanced_functions
  2. import (
  3. "github.com/qor5/docs/docsrc/examples/e21_presents"
  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. )
  9. var ItsTheWholeHouse = Doc(
  10. Markdown(`
  11. Presets let you config generalized data management UI interface for database.
  12. It's not a scaffolding to generate source code. But provide more abstract and
  13. flexible API to enrich features along the way.
  14. `),
  15. ch.Code(generated.PresetHelloWorldSample).Language("go"),
  16. Markdown(`
  17. And this ~*presets.Builder~ instance is actually also a ~http.Handler~, So that we can mount it
  18. to the http serve mux directly like this:
  19. `),
  20. ch.Code(generated.MountPresetHelloWorldSample).Language("go"),
  21. utils.Demo("Presets Hello World", e21_presents.PresetsHelloWorldPath+"/customers", "e21_presents/listing.go"),
  22. Markdown(`
  23. With ~r.Model(&Customer{})~:
  24. - It setup the global layout with the left navigation menu
  25. - It setup the listing page with a data table
  26. - It add the new button to create a new record
  27. - It setup the editing and creating form as a right side drawer
  28. - It setup each row of data have a operation menu that you have edit and delete operations
  29. - It setup the global search box, can search the model's all string columns
  30. `),
  31. ).Title("Not just scaffolding, it's the whole house").
  32. Slug("presets-guide/its-the-whole-house")