Skip to content

Commit

Permalink
docs: update broken references (#2124)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-ferdman authored Nov 9, 2024
1 parent 548a19f commit 5f317b3
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ for (const model in models) {
</td>
</tr>
<tr>
<td><b>Easily modify how models are <a href="./docs/constraints.md">constrained</a> into the output</b></td>
<td><b>Easily modify how models are <a href="./docs/constraints/README.md">constrained</a> into the output</b></td>

<td>

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Details which different generator options are supported.
### [Presets](./presets.md)
Goes more in-depth into how the preset system works, which enables full customization of generators.

### [Interpretation of JSON Schema](./inputs/json_schema.md)
### [Interpretation of JSON Schema](./inputs/JSON_Schema.md)
Explains how a JSON Schema is interpreted to a data model.

### [Migration](./migrations/README.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This document contains many of the advanced use-cases that you may stumble upon

This example shows us how to generate each model in the same file

Check out this [example out for a live demonstration](../examples/generate-all-models-within-same-file).
Check out this [example out for a live demonstration](../examples/generate-all-models-within-the-same-file).

## Generate models to separate files

Expand Down Expand Up @@ -97,7 +97,7 @@ Check out this [example out for a live demonstration](../examples/change-type-ma

## Changing the constrain rules

When moving from a [MetaModel](./internal-model.md#the-meta-model) to a [ConstrainedMetaModel](./internal-model.md#the-constrained-meta-model) it means we bind the input to a specific output. That output has specific constraints that the input MUST adhere to, [read more about this here](constraints.md).
When moving from a [MetaModel](./internal-model.md#the-meta-model) to a [ConstrainedMetaModel](./internal-model.md#the-constrained-meta-model) it means we bind the input to a specific output. That output has specific constraints that the input MUST adhere to, [read more about this here](constraints/README.md).

There can be multiple reasons why you want to change the default constrain rules, and therefore you can form them to your needs.

Expand Down
26 changes: 13 additions & 13 deletions docs/constraints/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Constraints
Because we cannot control what is provided as input, we must constrain the internal model to be valid for the output ([read more about the process here](./internal-model.md)). What is considered valid entirely depends on the output so each have their own set of rules.
Because we cannot control what is provided as input, we must constrain the internal model to be valid for the output ([read more about the process here](../internal-model.md)). What is considered valid entirely depends on the output so each have their own set of rules.

As an example lets consider TypeScript as an output. Consider the model name, which are a simple string, but a string which can contain ANY characters and formats. Some of the constraints we have found for the naming of a model are:

Expand All @@ -16,18 +16,18 @@ class 1name {}

There are many rules as such, but to get the full description about the default constraints here:

- [C++](./constraints/Csplusplus.md)
- [C#](./constraints/CSharp.md)
- [Dart](./constraints/Dart.md)
- [Go](./constraints/Go.md)
- [Java](./constraints/Java.md)
- [JavaScript](./constraints/JavaScript.md)
- [Kotlin](./constraints/Kotlin.md)
- [PHP](./constraints/PHP.md)
- [Python](./constraints/Python.md)
- [Rust](./constraints/Rust.md)
- [Scala](./constraints/Scala.md)
- [TypeScript](./constraints/TypeScript.md)
- [C++](./Cplusplus.md)
- [C#](./CSharp.md)
- [Dart](./Dart.md)
- [Go](./Go.md)
- [Java](./Java.md)
- [JavaScript](./JavaScript.md)
- [Kotlin](./Kotlin.md)
- [PHP](./PHP.md)
- [Python](./Python.md)
- [Rust](./Rust.md)
- [Scala](./Scala.md)
- [TypeScript](./TypeScript.md)

Even though there are many of these constraints, there might be reasons you want to customize the behavior to make it suit your use-case. Therefore each of the constraint rules can be overwritten completely and allow for you to implement your own behavior.

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ To make it easier to contribute a new generator, and to avoid focusing too much
4. Add your [generator to the generator index file](../src/generators/index.ts).

Now it's time to adapt the template into what ever it is you are generating:
1. Adapt the [constraint logic](../src/generators/template/constrainer) and the [type constraints](../src/generators/template/TemplateConstrainer.ts) based on what is allowed within your output. Read more about the constraint logic [here](./constraints.md).
1. Adapt the [constraint logic](../src/generators/template/constrainer) and the [type constraints](../src/generators/template/TemplateConstrainer.ts) based on what is allowed within your output. Read more about the constraint logic [here](./constraints/README.md).
2. Add all of the reserved keywords that the models must never generate in the [Constant file](../src/generators/template/Constants.ts).
3. Adapt/create the first renderers. The template by default include two renderers, one for rendering enums and one for classes, but you can create what ever renderers makes sense. For example in Rust it's not called class but struct, so therefore its called a `StructRenderer`.
4. Adapt the file generator and the rendering of the complete models to fit your generator.
Expand Down
2 changes: 1 addition & 1 deletion docs/internal-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ This means that if you accessed `EnumValueModel.key` you would get `something% s

How and what are constrained?

The answer to this question is not straightforward, cause each output has unique constraints that the meta models must adhere to. You can read more about [the constraint behavior here](./constraints.md).
The answer to this question is not straightforward, cause each output has unique constraints that the meta models must adhere to. You can read more about [the constraint behavior here](./constraints/README.md).

```mermaid
---
Expand Down
2 changes: 1 addition & 1 deletion docs/other-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Here is some of the noticeable differences with Modelina that is nice to know be
1. Modelina does not care much about the input, and support a range of them with no real limitation. I.e. supporting AsyncAPI, OpenAPI, ..., etc, see [supported inputs for more information](../README.md#features).
2. Modelina does not care about output language, i.e. it's not only Java that is supported, see the full list of [supported outputs here](../README.md#features).
3. Modelina does not hardcode specific features such as serialization libraries i.e. Jackson, Gson, ..., or validation annotations. Instead we use [presets](./presets.md) to control what is being generated to never be limited by hardcoding. Read more about which [serialization libraries we support for Java here](./languages/Java.md#generate-serializer-and-deserializer-functionality).
4. Modelina does not care which types you want generated (primitive types, long integers, etc), this can be [controlled by the constrainer](./constraints.md). Read more about how to [change the type mapping](./constraints.md#type-mapping).
4. Modelina does not care which types you want generated (primitive types, long integers, etc), this can be [controlled by the constrainer](./constraints/README.md). Read more about how to [change the type mapping](./constraints/README.md#type-mapping).
5. Modelina is part of Linux Foundation and is therefore a neutral ground for collaboration.


Expand Down
2 changes: 1 addition & 1 deletion modelina-website/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ for (const model in models) {
<td className='flex items-center justify-center px-6 py-4 text-sm font-light text-gray-900 md:w-1/2'>
<b>
Easily modify how models are{' '}
<a href='./docs/constraints.md' className='italic underline underline-offset-2'>
<a href='./docs/constraints/README.md' className='italic underline underline-offset-2'>
constrained
</a>{' '}
into the into the output
Expand Down

0 comments on commit 5f317b3

Please sign in to comment.