Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Export demos.json file to allow the categories to be shown in the side menu on Vaadin.com/components #104

Open
gilberto-torrezan opened this issue Nov 19, 2018 · 2 comments

Comments

@gilberto-torrezan
Copy link
Contributor

Taking this HTML Examples page as example:

image

The demo categories are shown in the side menu, under the HTML Examples item.

As for Java Examples, the categories are shown as a header for each page:

image

In order to Vaadin.com to show the categories as links in the side menu, a special demos.json file needs to be exported for each demo. Here is the file for the Grid demo, for example.

@Haprog
Copy link

Haprog commented Nov 19, 2018

The format for the nav link data for Java examples doesn't have to be the same as for HTML examples. We just used the format how the HTML examples already had the data when we added the navigation items for it to the side menu.

For Java examples I think it should be enough to have something like this (example for Grid):

[
  {
    "title": "Basic usage",
    "url": ""
  },
  {
    "title": "Selection",
    "url": "selection"
  },
  {
    "title": "Configuring columns",
    "url": "configuring-columns"
  },
  {
    "title": "Using renderers",
    "url": "using-renderers"
  },
  {
    "title": "Using templates",
    "url": "using-templates"
  },
  {
    "title": "Using components",
    "url": "using-components"
  },
  {
    "title": "Item details",
    "url": "item-details"
  },
  {
    "title": "Sorting",
    "url": "sorting"
  },
  {
    "title": "Header and footer rows",
    "url": "header-and-footer-rows"
  },
  {
    "title": "Filtering",
    "url": "filtering"
  },
  {
    "title": "Height by Rows",
    "url": "height-by-rows"
  },
  {
    "title": "Basic Features",
    "url": "basic-features"
  }
]

Ordering will matter so that we can keep the same order for the menu items in vaadin.com. First item in the list should be the default one that is shown first when you open "Java examples".

@Haprog
Copy link

Haprog commented Nov 19, 2018

The url property will be used in a URL template similar to

`https://vaadin.com/components/${component}/java-examples/${url}`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants