Skip to content

Commit

Permalink
plain-documentation: Restructure headings
Browse files Browse the repository at this point in the history
  • Loading branch information
karlvr committed Nov 27, 2023
1 parent 20f08d1 commit 58814a5
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 31 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-moose-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openapi-generator-plus/plain-documentation-generator": minor
---

Restructure headings
8 changes: 0 additions & 8 deletions packages/plain-documentation/less/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ h4 {
line-height: @lh-title4;
font-weight: 200;
margin: 0;

.operation & {
font-weight: 700;
}
}

h5 {
Expand Down Expand Up @@ -184,10 +180,6 @@ body.api-docs {
nav {
border-right: 1px solid @ui-border;
.grid(5, 6);

li:not(.expandable) a {
font-weight: 700;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plain-documentation/templates/api/group.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
--}}

<span id="group-{{htmlId name}}" data-path="{{path}}" class="operation-group"></span>
<h3 class="group">{{capitalize name}}</h3>
<h3 class="group">{{sentenceCase name}}</h3>
{{#eachSorted operations}}
{{>api/operation .}}
{{/eachSorted}}
16 changes: 13 additions & 3 deletions packages/plain-documentation/templates/api/operation.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
--}}

<section class="summary operation{{#if deprecated}} -deprecated{{/if}}" data-path="{{fullPath}}" data-method="{{httpMethod}}" id="operation-{{htmlId httpMethod}}-{{htmlId fullPath}}">
<h4>{{name}}</h4>

<div class="api-title"><span class="method operation-{{lowerCase httpMethod}}">{{upperCase httpMethod}}</span> {{fullPath}}</div>
<h4 class="api-title"><span class="method operation-{{lowerCase httpMethod}}">{{upperCase httpMethod}}</span> {{fullPath}}</h4>

{{>hooks/operation-header}}

Expand All @@ -21,6 +19,18 @@
{{{md summary "true"}}}
{{{md description}}}

<div class="operationId">
<h5>Operation ID</h5>

<table>
<tr>
<td class="type">
{{name}}
</td>
</tr>
</table>
</div>

{{>api/security-requirements}}
{{>api/request-body}}
{{>api/parameters parameters=parameters}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{#each schemes}}
<tr>
<td><a href="#/security/{{htmlId scheme.name}}">{{scheme.type}}</a></td>
<td>
<td class="type">
{{#each scopes}}
{{name}}{{#hasMore}},{{/hasMore}}
{{/each}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</table>
{{else if isOAuth}}
{{#each flows}}
<h4>{{capitalize type}} flow</h4>
<h4>{{sentenceCase type}} flow</h4>
<table class="auth-flows">
<tbody>
{{#if authorizationUrl}}
Expand Down
2 changes: 1 addition & 1 deletion packages/plain-documentation/templates/model/all-of.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
renders a model "allOf"-definition.
}}
<div class="all-of">
<h5>All of</h5>
<h4>All of</h4>
<div class="detail">
{{#each composes}}
{{#unless anonymous}}
Expand Down
2 changes: 1 addition & 1 deletion packages/plain-documentation/templates/model/any-of.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
renders a model "anyOf"-definition.
}}
<div class="any-of">
<h5>Any of</h5>
<h4>Any of</h4>
<div class="detail">
{{#each composes}}
<p><a class="model-ref" href="#{{../anchor}}/{{htmlId nativeType}}">{{nativeType}}</a></p>
Expand Down
2 changes: 1 addition & 1 deletion packages/plain-documentation/templates/model/children.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ renders the inherited properties of a parent class.
}}

<div class="children">
<h5>Children</h5>
<h4>Children</h4>
<div class="detail">
{{#each children}}
<p><a class="model-ref" href="#{{../anchor}}/{{htmlId nativeType}}">{{nativeType}}</a></p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{!Renders model discriminator}}
<div class="params -discriminator">
<h5>Discriminator</h5>
<h4>Discriminator</h4>
{{#with discriminator}}
<div class="params -properties">
<table>
Expand All @@ -25,9 +25,8 @@
</table>
</div>
{{/with}}
</div>
<div class="params -discriminator">
<h5>Discriminator values</h5>

<h5>Values</h5>
<div class="params -properties">
<table>
<thead>
Expand Down
2 changes: 1 addition & 1 deletion packages/plain-documentation/templates/model/enum.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="values -enum">
<h5>Values</h5>
<h4>Values</h4>
<span class="model-property-enum" title="Constant">
[
{{#each enumValues}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ renders the inherited properties of a parent class.
}}

<div class="implements">
<h5>Implements</h5>
<h4>Implements</h4>
<div class="detail">
{{#each implements}}
<p><a class="model-ref" href="#{{../anchor}}/{{htmlId nativeType}}">{{nativeType}}</a></p>
Expand Down
4 changes: 2 additions & 2 deletions packages/plain-documentation/templates/model/inherited.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ renders the inherited properties of a parent class.
}}

<div class="parent">
<h5>Parent</h5>
<h4>Parent</h4>
<div class="detail">
<p><a class="model-ref" href="#{{anchor}}/{{htmlId nativeType}}">{{nativeType}}</a></p>
</div>

{{#if properties}}
<div class="params -inherited-properties">
<h5>Inherited Properties</h5>
<h4>Inherited Properties</h4>
<table>
{{>model/frag/inherited}}
</table>
Expand Down
4 changes: 2 additions & 2 deletions packages/plain-documentation/templates/model/interface.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="interface">
<h5>Implemented by</h5>
<h4>Implemented by</h4>
<div class="detail">
{{#each implementors}}
<p><a class="model-ref" href="#{{../anchor}}/{{htmlId nativeType}}">{{nativeType}}</a></p>
Expand All @@ -8,7 +8,7 @@

{{#if properties}}
<div class="params -inherited-properties">
<h5>Inherited Properties</h5>
<h4>Inherited Properties</h4>
<table>
{{>model/frag/inherited}}
</table>
Expand Down
4 changes: 2 additions & 2 deletions packages/plain-documentation/templates/model/main-panel.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
{{#ifdef hideName}}
{{else}}
{{#if name}}
<h4>
<h3 class="schema-title">
{{nativeType}}
{{#if (isInterface)}}<span class="type">INTERFACE</span>{{/if}}
</h4>
</h3>
{{/if}}
{{/ifdef}}

Expand Down
2 changes: 1 addition & 1 deletion packages/plain-documentation/templates/model/one-of.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
renders a model "allOf"-definition.
}}
<div class="one-of">
<h5>One of</h5>
<h4>One of</h4>
<div class="detail">
{{#each composes}}
<p><a class="model-ref" href="#{{../anchor}}/{{htmlId nativeType}}">{{nativeType}}</a></p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{!Renders model object properties.}}
<div class="params -properties">
<h5>Properties</h5>
<h4>Properties</h4>
<table>
{{>model/frag/properties}}
</table>
Expand Down

0 comments on commit 58814a5

Please sign in to comment.