diff --git a/modelina-website/src/pages/index.tsx b/modelina-website/src/pages/index.tsx index b51846d951..d4e90b8583 100644 --- a/modelina-website/src/pages/index.tsx +++ b/modelina-website/src/pages/index.tsx @@ -10,7 +10,7 @@ import Image from 'next/image'; export default function Index() { const description = - 'Sometimes you just want to generate data models for your payload. Modelina is a library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents.'; + 'Modelina is a library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents.'; const image = '/img/social/modelina-card.jpg'; return ( @@ -22,84 +22,95 @@ export default function Index() { >
- - Modelina + + Generate data models for payload {description}
-
-
- - AsyncAPI Cli - - - Get started immediately with Modelina through the AsyncAPI Cli. - -
- - asyncapi generate models typescript ./asyncapi.json - +
+ + How to get started + + + You can use through the AsyncAPI CLI or install it as a library. + +
+ +
+
+
+ {'CLI +
+
+ + AsyncAPI CLI + + + Get started immediately with Modelina through the AsyncAPI CLI or by installing it as a library. +
- + + asyncapi generate models typescript ./asyncapi.json + +
+ +
-
- {'CLI -
-
-
-
- - Installation - - - Install Modelina as a library to take full control. - -
- - npm install @asyncapi/modelina - +
+
+ {'Modelina +
+
+ + Installation + + + Install Modelina as a library to take full control. +
-
-
- {'Modelina -
@@ -114,24 +125,22 @@ export default function Index() {
-
- - - - - + + +
- - Modelina lets you generate data models from many types of{' '} - inputs - - - - {`const asyncapi = ... + + + + + - - - - + + + + + - - - + + + + - + - - - + + + - + + - - - + + + - + + - - - + + + - + + - - -
+ + Modelina lets you generate data models from many types of{' '} + inputs + + + + {`const asyncapi = ... const jsonschema = ... const openapi = ... const metamodel = ... @@ -139,48 +148,50 @@ const metamodel = ... const models = await generator.generate( asyncapi | jsonschema | openapi | metamodel );`} - -
- - Use the same inputs across a range of different{' '} - generators - - - - {`const generator = new TypeScriptGenerator(); + +
+ + Use the same inputs across a range of different{' '} + generators + + + + {`const generator = new TypeScriptGenerator(); const generator = new CsharpGenerator(); const generator = new JavaGenerator(); const generator = new RustGenerator(); ... const models = await generator.generate(input);`} - -
+ +
+

Easily let you interact with the generated models.- Want to show the generated models on a website? Sure! - Want to generate the models into files? Sure! - Want to combine all the models into one single file? Sure! Whatever interaction you need, you can create. -

- - {`const models = await generator.generate(input); +

+
+ + {`const models = await generator.generate(input); for (const model in models) { const generatedCode = generatedModel.result; const dependencies = generatedModel.dependencies; @@ -188,26 +199,25 @@ for (const model in models) { const modelName = generatedModel.modelName; ... }`} - -
- - Easily modify how models are{' '} - constrained into the - output - -
- - {`const generator = new TypeScriptGenerator({ +
+ + Easily modify how models are{' '} + constrained into the + output + + + + {`const generator = new TypeScriptGenerator({ constraints: { modelName: ({modelName}) => { // Implement your own constraining logic @@ -215,28 +225,27 @@ for (const model in models) { } } });`} - -
- - Seamlessly layer additional or replacement code{' '} - - on top of each other to customize the models - {' '} - to your use-case - -
- - {`const generator = new TypeScriptGenerator({ +
+ + Seamlessly layer additional or replacement code{' '} + + on top of each other to customize the models + {' '} + to your use-case + + + + {`const generator = new TypeScriptGenerator({ presets: [ { class: { @@ -251,27 +260,26 @@ public myCustomFunction(): string { ] }); const models = await generator.generate(input);`} - -
- - Seamlessly lets you{' '} - - combine multiple layers of additional or replacement code - - -
- - {`const myCustomFunction1 = { +
+ + Seamlessly lets you{' '} + + combine multiple layers of additional or replacement code + + + + + {`const myCustomFunction1 = { class: { additionalContent({ content }) { return \`\${content} @@ -289,12 +297,11 @@ const generator = new TypeScriptGenerator({ ] }); const models = await generator.generate(input);`} - -
- +
+
);