Skip to content

Commit

Permalink
fix markdown rendering of the property table issue (#176)
Browse files Browse the repository at this point in the history
* fix markdown rendering of the property table

the js/flat renderer check for the node being a ref, do something
similar in the markdown renderer while also keeping "defined in" working
as is.

ref for flat renderer:
https://github.com/coveooss/json-schema-for-humans/blob/9ced1e2a71eea858e1b9c49273828dfc2ffebeaf/json_schema_for_humans/templates/flat/content.html#L37-L38

* black

Co-authored-by: Denis Blanchette <[email protected]>
  • Loading branch information
chrono and dblanchette committed Nov 9, 2022
1 parent 2278765 commit 8fc97b7
Show file tree
Hide file tree
Showing 21 changed files with 166 additions and 161 deletions.
24 changes: 12 additions & 12 deletions docs/examples/examples_md_default/description_with_ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

## <a name="outer"></a>1. Property `root > outer`

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | Yes |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Defined in** | #/definitions/inner schema |
| | |
| ------------------------- | ------------------------------------------------------- |
| **Type** | `object` |
| **Required** | Yes |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Defined in** | #/definitions/inner schema |

**Description:** We should see this

Expand All @@ -41,12 +41,12 @@

## <a name="outer2"></a>2. Property `root > outer2`

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Same definition as** | [outer](#outer) |
| | |
| ------------------------- | ------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Same definition as** | [outer](#outer) |

**Description:** We should see this too

Expand Down
42 changes: 21 additions & 21 deletions docs/examples/examples_md_default/ref_with_tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Type** | `combining` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Defined in** | #/definitions/signature |
Expand Down Expand Up @@ -116,12 +116,12 @@

##### <a name="autogenerated_heading_2"></a>1.1.1.1.1. root > objectA > signature > oneOf > item 0 > signers > signer

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Defined in** | #/definitions/signer |
| | |
| ------------------------- | ------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Defined in** | #/definitions/signer |

| Property | Pattern | Type | Deprecated | Definition | Title/Description |
| ------------------------------------------------------------------------------- | ------- | --------------- | ---------- | -------------------------- | ----------------- |
Expand Down Expand Up @@ -201,7 +201,7 @@ Must be one of:

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Type** | `combining` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Defined in** | #/definitions/publicKey |
Expand Down Expand Up @@ -525,23 +525,23 @@ Must be one of:

##### <a name="autogenerated_heading_8"></a>1.1.2.1.1. root > objectA > signature > oneOf > item 1 > chain > signer

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Same definition as** | [Signature](#objectA_signature_oneOf_i0_signers_items) |
| | |
| ------------------------- | ------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Same definition as** | [Signature](#objectA_signature_oneOf_i0_signers_items) |

#### <a name="objectA_signature_oneOf_i2"></a>1.1.3. Property `root > objectA > signature > oneOf > Signature`

**Title:** Signature

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Same definition as** | [Signature](#objectA_signature_oneOf_i0_signers_items) |
| | |
| ------------------------- | ------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Same definition as** | [Signature](#objectA_signature_oneOf_i0_signers_items) |

**Description:** Unique top level property for simple signatures. (signaturecore)

Expand All @@ -563,7 +563,7 @@ Must be one of:

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Type** | `combining` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Same definition as** | [signature](#objectA_signature) |
Expand Down
24 changes: 12 additions & 12 deletions docs/examples/examples_md_default/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@

## <a name="anchor_with_slash"></a>3. Property `root > anchor_with_slash`

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Defined in** | #/definitions/object_def |
| | |
| ------------------------- | ------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Defined in** | #/definitions/object_def |

| Property | Pattern | Type | Deprecated | Definition | Title/Description |
| -------------------------------------------- | ------- | ------ | ---------- | ---------- | ------------------------------------------ |
Expand Down Expand Up @@ -135,12 +135,12 @@

## <a name="same_file_anchor_no_slash"></a>7. Property `root > same_file_anchor_no_slash`

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Same definition as** | [anchor_with_slash](#anchor_with_slash) |
| | |
| ------------------------- | ------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Same definition as** | [anchor_with_slash](#anchor_with_slash) |

## <a name="same_file_nested_reference"></a>8. Property `root > same_file_nested_reference`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
| ------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Defined in** | https://raw.githubusercontent.com/coveooss/json-schema-for-humans/main/docs/examples/cases/description_from_ref.json |

| Property | Pattern | Type | Deprecated | Definition | Title/Description |
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/examples_md_default/with_descriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Type** | `combining` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Defined in** | #/definitions/delivery_info |
Expand Down
24 changes: 12 additions & 12 deletions docs/examples/examples_md_nested_default/description_with_ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
</summary>
<blockquote>

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | Yes |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Defined in** | #/definitions/inner schema |
| | |
| ------------------------- | ------------------------------------------------------- |
| **Type** | `object` |
| **Required** | Yes |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Defined in** | #/definitions/inner schema |

**Description:** We should see this

Expand Down Expand Up @@ -50,12 +50,12 @@
</summary>
<blockquote>

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Same definition as** | [outer](#outer) |
| | |
| ------------------------- | ------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Same definition as** | [outer](#outer) |

**Description:** We should see this too

Expand Down
16 changes: 8 additions & 8 deletions docs/examples/examples_md_nested_default/ref_with_tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Type** | `combining` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Defined in** | #/definitions/signature |
Expand Down Expand Up @@ -131,12 +131,12 @@

**Title:** Signature

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Same definition as** | [Signature](#objectA_signature_oneOf_i0_signers_items) |
| | |
| ------------------------- | ------------------------------------------------------- |
| **Type** | `object` |
| **Required** | No |
| **Additional properties** | [[Not allowed]](# "Additional Properties not allowed.") |
| **Same definition as** | [Signature](#objectA_signature_oneOf_i0_signers_items) |

**Description:** Unique top level property for simple signatures. (signaturecore)

Expand Down Expand Up @@ -172,7 +172,7 @@

| | |
| ------------------------- | ------------------------------------------------------------------------- |
| **Type** | `object` |
| **Type** | `combining` |
| **Required** | No |
| **Additional properties** | [[Any type: allowed]](# "Additional Properties of any type are allowed.") |
| **Same definition as** | [signature](#objectA_signature) |
Expand Down
Loading

0 comments on commit 8fc97b7

Please sign in to comment.