Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ZEN-4828] Documentation: Migration to Bootstrap 4 (DO NOT MERGE) #62

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/genflow-api-openapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.reprezen.genflow</groupId>
<artifactId>genflow</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.3.1-ZEN-4828-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>genflow-api-openapi</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modules/genflow-api-rapidml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.reprezen.genflow</groupId>
<artifactId>genflow</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.3.1-ZEN-4828-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>genflow-api-rapidml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modules/genflow-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.reprezen.genflow</groupId>
<artifactId>genflow</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.3.1-ZEN-4828-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<name>GenFlow API</name>
Expand Down
2 changes: 1 addition & 1 deletion modules/genflow-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.reprezen.genflow</groupId>
<artifactId>genflow</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.3.1-ZEN-4828-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>genflow-tests</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modules/gentemplates/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.reprezen.genflow</groupId>
<artifactId>genflow</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.3.1-ZEN-4828-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<artifactId>genflow-common</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modules/gentemplates/openapi-diagram/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.reprezen.genflow</groupId>
<artifactId>genflow</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.3.1-ZEN-4828-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>openapi-diagram</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modules/gentemplates/openapi-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.reprezen.genflow</groupId>
<artifactId>genflow</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.3.1-ZEN-4828-SNAPSHOT</version>
<relativePath>../../..</relativePath>
</parent>
<artifactId>openapi-generator</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modules/gentemplates/openapi-normalizer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.reprezen.genflow</groupId>
<artifactId>genflow</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.3.1-ZEN-4828-SNAPSHOT</version>
<relativePath>../../..</relativePath>
</parent>
<artifactId>openapi-normalizer</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modules/gentemplates/openapi3-doc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>com.reprezen.genflow</groupId>
<artifactId>genflow</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.3.1-ZEN-4828-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AttrDetails {
if (topLevel) {
// wrapping in an outer table to make it look the same as in the case where there really is
// an outer table that contains this. Otherwise bootstrap css gives it an odd look
'''<table class="table table-condensed" style="margin:0"><tr><td style="border-top: 0px">«detailsTable»</td></tr></table>'''
'''<table class="table table" style="margin:0"><tr><td style="border-top: 0px">«detailsTable»</td></tr></table>'''
} else {
detailsTable
}
Expand All @@ -46,9 +46,8 @@ class AttrDetails {
def private getInfoButton(String id) {
'''
<a href="#«id»" data-toggle="collapse">
<span id="«id»-controller" data-toggle="tooltip"
data-hidden-title="View Property Details" data-visible-title="Hide Property Details"
class="glyphicon glyphicon-collapse-down">
<span id="«id»-controller" data-toggle="tooltip" class="far fa-caret-square-down"
data-hidden-title="View Property Details" data-visible-title="Hide Property Details" >
</span>
</a>
'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class ModelDoc {
def getHtml() {
'''
<a class="anchor toc-entry" id="«definition.htmlId»" data-toc-level=1 data-toc-text="«name»"></a>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">«name»</h4>
<div class="card">
<div class="card-header">
<h4 class="card-title">«name»</h4>
</div>
<div class="panel-body">
<div class="card-body">
«definition.description.docHtml»
«definition.renderSchema»
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ class OpDoc {

def String getHtml(String method) {
'''
<a class="anchor toc-entry" id="«op.htmlId»" data-toc-level="2" data-toc-text="«method»"></a>
<span class="label label-primary resource-method">«method»</span>
<code>«op.operationId.deprecate(op.isDeprecated)»</code>
«op.tagBadges»
<div class="row justify-content-between method-header">
<div class="row col-10 justify-content-start align-items-center method-badges">
<span class="badge badge-primary resource-method">«method»</span>
<code>«op.operationId.deprecate(op.isDeprecated)»</code>
<a class="anchor toc-entry" id="«op.htmlId»" data-toc-level="2" data-toc-text="«method»"></a>
</div>
«op.tagBadges»
</div>
«IF preview»
&nbsp;
<a href="#">
<span class="glyphicon glyphicon-edit" style="font-size: 1.5em;" data-toggle="tooltip" title="Go to definition in editor."
onclick="reprezen_changeSelection('«op.pointer»', '«op.fileUrl»');return false;"></span>
<span class="fas fa-edit" style="font-size: 1.5em;" data-toggle="tooltip" title="Go to definition in editor."
onclick="reprezen_changeSelection('«op.pointer»', '«op.fileUrl»');return false;"></span>
</a>
«ENDIF»
<ul class="list-group">
Expand Down Expand Up @@ -73,7 +77,7 @@ class OpDoc {
'''
<li class="list-group-item">
«FOR contentType : bodyParam.contentMediaTypes.keySet»
<strong>Request</strong> <span class="label label-default">«contentType»</span>«chevron»«bodyParam.contentMediaTypes.get(contentType).schema?.schemaTitle»
<strong>Request</strong> <span class="badge badge-primary">«contentType»</span>«chevron»«bodyParam.contentMediaTypes.get(contentType).schema?.schemaTitle»
«getMediaTypeHtml(contentType, bodyParam.contentMediaTypes.get(contentType))»
«ENDFOR»
</li>
Expand Down Expand Up @@ -106,7 +110,7 @@ class OpDoc {
def getResponseContentHtml(Response response, String contentType, MediaType mediaType, String status) {
val schema = mediaType?.schema
'''
«chevron» <span class="label label-default">«contentType»</span>
«chevron» <span class="badge badge-primary">«contentType»</span>
«schema?.schemaTitle»
«schema?.renderSchema»
«mediaType?.renderExample»
Expand Down Expand Up @@ -158,17 +162,17 @@ class OpDoc {
&nbsp;
<p>«link.description»</p>
<h5>Parameters</h5>
<table class="table">
<table class="table">
<tr><th>Name</th><th>Value</th></tr>
«FOR parameter : parameters»
«FOR parameter : parameters»
<tr><th>«parameter»</th><td>«link.parameters.get(parameter)»</td></tr>
«ENDFOR»
</table>
'''
}

def chevron() {
'<span class="glyphicon glyphicon-chevron-right"></span>'
'<span class="fas fa-chevron-right"></span>'
}

def statusLabel(String status) {
Expand All @@ -185,12 +189,12 @@ class OpDoc {
case s >= 500 && s < 600: // server error
"danger"
default:
"default"
"primary"
}
} catch (NumberFormatException e) {
status // handle "default" case
}
'''<span class="label label-«context»">«status»</span>'''
'''<span class="badge badge-«context»">«status»</span>'''
}

def deprecate(String text, Boolean deprecated) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class ParamDoc {
val param = model.parameters.get(name)
'''
<a class="anchor toc-entry" id="«param.htmlId»" data-toc-level="1" data-toc-text="«name»"></a>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><strong>«name»</strong></h4>
<div class="card">
<div class="card-header">
<h4 class="card-title"><strong>«name»</strong></h4>
</div>
<div class="panel-body">
<div class="card-body">
«model.parameters.get(name).paramHtml»
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ class PathDoc {
def getHtml() {
'''
<a class="anchor toc-entry" id="«getHtmlId(path)»" data-toc-level="1" data-toc-text="«pathName.htmlEscape»"></a>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<div class="card">
<div class="card-header">
<h4 class="card-title">
Path: «pathName»
«IF preview»
&nbsp;&nbsp;
<a href="#">
<span class="glyphicon glyphicon-edit text-primary" style="font-size: 1.3em;" data-toggle="tooltip" title="Go to definition in editor."
<span class="fas fa-edit text-primary" style="font-size: 1.3em;" data-toggle="tooltip" title="Go to definition in editor."
onclick="reprezen_changeSelection('«path.pointer»', '«path.fileUrl»'); return false;"></span>
</a>
«ENDIF»
</h4>
</div>
<div class="panel-body">
<div class="card-body operation-content">
«path.commonTags.map[it.modelTag?.description].filterNull.join("\n\n").docHtml»
«FOR method : path.operations.keySet.sortByPosition(path.operations)»
«new OpDoc(path.operations.get(method), model, path).getHtml(method)»
«FOR method : path.operations.keySet.sortByPosition(path.operations)»
«new OpDoc(path.operations.get(method), model, path).getHtml(method)»
«ENDFOR»
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class ResponseDoc {

'''
<a class="anchor toc-entry" id="«response.htmlId»" data-toc-level="1" data-toc-text="«status»"></a>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><strong>«status»</strong></h4>
<div class="card">
<div class="card-header">
<h4 class="card-title"><strong>«status»</strong></h4>
</div>
<div class="panel-body">
<div class="card-body">
<strong>Response</strong> «chevron» «schema?.schemaTitle»</h4>
«response.description?.docHtml»
«schema?.renderSchema»
Expand All @@ -54,6 +54,6 @@ class ResponseDoc {
}

def chevron() {
'<span class="glyphicon glyphicon-chevron-right"></span>'
'<span class="fas fa-chevron-right"></span>'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ResponseHelper implements Helper {
val headers = response.headers
if (headers !== null && !headers.empty) {
'''
<table class="table-condensed">
<table class="table">
<tr><th>Name</th><th>Type</th><th>Description</th></tr>
«FOR header : headers.entrySet»
<tr><th>«header.key»</th><td>«header.value?.schema.type»</td><td>«header.value?.description?.htmlEscape»</td></tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class StructureTable<T> {
/* Public method for rendering a table describing an object */
def String render(String name) {
'''
<table class="table table-condensed">
<table class="table">
«renderHeaderRow»
«renderObject(name, null, new Indentation())»
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class TagHelper implements Helper {
def getTagBadges(Operation op) {
'''
«FOR tag : op.tags?.reorderTags ?: #[]»
<span class="pull-right">&nbsp;<span class="badge" data-toggle="tooltip" data-title="«tag.modelTag?.
description?.docHtml?.toString?.htmlEscape»" data-html="true">«tag»</span></span>
<span class="float-right">&nbsp;
<span class="badge badge-dark" data-toggle="tooltip" data-title="«tag.modelTag?.description?.docHtml?.toString?.htmlEscape»" data-html="true">«tag»</span>
</span>
«ENDFOR»
'''
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class TopMatter {

def get(OpenApi3 model) {
'''
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">«model.info?.title» «model.baseUri»</h3>
<div class="card panel-primary">
<div class="card-header text-white bg-primary">
<h3 class="card-title">«model.info?.title» «model.baseUri»</h3>
</div>
<div class="panel-body restful-interface">
<div class="card-body restful-interface">
«model.info?.description?.docHtml»
<table class="table">
<tr><th>Version</th><td>«model.info?.version»</td></tr>
Expand Down
Loading