menu.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package basics
  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. h "github.com/theplant/htmlgo"
  9. )
  10. var ManageMenu = Doc(
  11. Markdown(`
  12. Menu refers to the list on the left side of the page, such as the menu of the Demo below contains Customers and Companies.
  13. `),
  14. h.Br(),
  15. utils.Demo("Presets Detail Page Credit Cards", e21_presents.PresetsDetailPageCardsPath+"/customers", "e21_presents/detailing.go"),
  16. Markdown(`
  17. ## Menu order
  18. Sorting menus is very simple, use ~MenuOrder~ to sort menus as you want by **slug name** .
  19. `),
  20. ch.Code(generated.MenuOrderSample).Language("go"),
  21. utils.Demo("Menu Order", e21_presents.PresetsMenuOrderPath+"/books", "e21_presents/menu.go"),
  22. Markdown(`
  23. ## Menu group and icon
  24. ~MenuGroup~ can merge multiple items into one group, as shown in the following code.
  25. Use ~MenuIcon~ on ~ModelBuilder~ can set the item icon, and set menu group icon by ~Icon~ following ~MenuGroup~.
  26. Icon strings can be found at <https://fonts.google.com/icons>.
  27. `),
  28. ch.Code(generated.MenuGroupSample).Language("go"),
  29. utils.Demo("Menu Group", e21_presents.PresetsMenuGroupPath+"/videos", "e21_presents/menu.go"),
  30. ).Title("Menu").
  31. Slug("basics/menu")