Added initial cookbook implementation.#943
Conversation
gosteenBASIS
left a comment
There was a problem hiding this comment.
This looks good to me! I think this will be a useful section to develop.
bbrennanbasis
left a comment
There was a problem hiding this comment.
@EHandtkeBasis In addition to the code suggestions comments:
- General question: Is it expected that every cookbook article should be created in
.mdxfiles, even though the reset of the project articles are in.mdfiles?
2. The Hover/Focus text for topic labels need more contrast in dark mode
- The Hover/Focus text for selected topic labels need more contrast in light mode
- The level dropdown is lacking CSS styling
- Overlaying content in the main toolbar when the screen is ~1400px
- The text inside the components CookbookCar.jsx and CookBookIndex.jsx need to be translatable, use PR #861 and Docusaurus's Translate your React code for reference.
- Rules will need to be added to
src\main\webapp\WEB-INF\urlrewrite.xmlso users don't land on directory pages within cookbook when the project is fully built, likehttp://localhost:8080/cookbook/routingorhttp://localhost:8080/cookbook. See what I did in PR #522.
- Tags page (http://localhost:8080/cookbook/tags) doesn't match the tag styling for the blogs (https://docs.webforj.com/blog/tags). Personally, I don't have a preference either or, as long as the styling was intentionally untouched
| BasedOnStyles = | ||
|
|
||
| [docs/cookbook/**/*.mdx] | ||
| BasedOnStyles = |
There was a problem hiding this comment.
Suggestion to at least add the style check that checks if the right letters in webforJ are capitalized
| BasedOnStyles = | |
| BasedOnStyles = webforJ | |
| webforJ.* = NO | |
| Google.Capitalization = YES |
| path: 'cookbook', | ||
| routeBasePath: 'cookbook', | ||
| sidebarPath: require.resolve('./cookbook-sidebars.js'), | ||
| editUrl: 'https://github.com/webforj/webforj-documentation/edit/main/docs/cookbook/', |
There was a problem hiding this comment.
| editUrl: 'https://github.com/webforj/webforj-documentation/edit/main/docs/cookbook/', | |
| editUrl: 'https://github.com/webforj/webforj-documentation/edit/main/docs/', |
|
|
||
| @Route | ||
| public class HomeView extends Composite<Div> { | ||
|
|
||
| public HomeView() { | ||
| Button goToDashboard = new Button("Go to Dashboard"); | ||
| goToDashboard.onClick(e -> Router.getCurrent().navigate(DashboardView.class)); | ||
| getBoundComponent().add(goToDashboard); | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Use private fields and a reference to the bound component instead of getBoundComponent() directly
| @Route | |
| public class HomeView extends Composite<Div> { | |
| public HomeView() { | |
| Button goToDashboard = new Button("Go to Dashboard"); | |
| goToDashboard.onClick(e -> Router.getCurrent().navigate(DashboardView.class)); | |
| getBoundComponent().add(goToDashboard); | |
| } | |
| } | |
| ``` | |
| @Route | |
| public class HomeView extends Composite<Div> { | |
| private final Div self = getBoundComponent(); | |
| private final Button goToDashboard = new Button("Go to Dashboard"); | |
| public HomeView() { | |
| goToDashboard.onClick(e -> Router.getCurrent().navigate(DashboardView.class)); | |
| self.add(goToDashboard); | |
| } | |
| } |
| @@ -0,0 +1,11 @@ | |||
| --- | |||
| title: Overview | |||
There was a problem hiding this comment.
| title: Overview | |
| title: Cookbook Overview |
| @@ -0,0 +1,31 @@ | |||
| --- | |||
| title: "Inject inline CSS into a page from Java" | |||
| description: "Use @InlineStyleSheet to add CSS class definitions directly from a Java component without a separate stylesheet file." | |||
There was a problem hiding this comment.
[Google.WordList] Use 'style sheet' instead of 'stylesheet'.
| } | ||
| ``` | ||
|
|
||
| Setting `once = true` ensures the style block is injected only once even when multiple instances of the component are on the page at the same time. |
There was a problem hiding this comment.
[webforJ.BeDirect] Avoid using 'ensures the style'. Focus more on explicitly giving details about the feature.
No description provided.