diff --git a/src/PreviewMarkdown.ts b/src/PreviewMarkdown.ts index 2e99628..98cf2bb 100644 --- a/src/PreviewMarkdown.ts +++ b/src/PreviewMarkdown.ts @@ -89,25 +89,181 @@ function getWebviewContent(context: vscode.ExtensionContext, webview: vscode.Web + +
+
${result}
+
Section 2
+
Section 3
+
+ +
+ + + +
+ - ${result} diff --git a/src/components/Message.ejs b/src/components/Message.ejs index 78b56ba..7986a83 100644 --- a/src/components/Message.ejs +++ b/src/components/Message.ejs @@ -88,7 +88,7 @@ examples.map((ex, idx) => { %>

<%= ex.name && ex.name %>

<%- ex.summary && md.render(ex.summary) %> - <%= md.render(JSON.stringify(ex.example, null, 2)) %> + <%- md.render(JSON.stringify(ex.example, null, 2)) %> <% }); %> <% } %> <% }else { diff --git a/src/components/Schema.ejs b/src/components/Schema.ejs index 6e2925a..8b9f2a0 100644 --- a/src/components/Schema.ejs +++ b/src/components/Schema.ejs @@ -1,6 +1,7 @@ <% if(schemaName && hideTitle === false ) { %>

<%= schemaName %>

<% } %> +
@@ -16,12 +17,12 @@ <% if ( schema && !(schemaName.indexOf('x-parser-')> -1 || schemaName.indexOf('x-schema-private-') > -1) ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(schema, schemaName, 'root'); %> - - - - - - + + + + + + <% const dependentSchemas = schemaHelper.getDependentSchemas(schema); const extensions = schemaHelper.getCustomExtensions(schema); @@ -34,12 +35,12 @@ <% if ( property && !(propertyName.indexOf('x-parser-')> -1 || propertyName.indexOf('x-schema-private-') > -1) ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(property, propertyName, required.includes(propertyName), schemaHelper.getDependentRequired(propertyName,schema), buildPath((path || schemaName), propertyName)); %> - - - - - - + + + + + + <% } %> <% } %> @@ -47,11 +48,11 @@ <% if ( property && !(propertyName.indexOf('x-parser-')> -1 || propertyName.indexOf('x-schema-private-') > -1) ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(property, propertyName, false, [], buildPath((path || schemaName), propertyName), 'pattern property'); %> - - - - - + + + + + <% } %> @@ -70,12 +71,12 @@ <% if ( property && !(propertyName.indexOf('x-parser-')> -1 || propertyName.indexOf('x-schema-private-') > -1) ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(property, propertyName, required.includes(propertyName), schemaHelper.getDependentRequired(propertyName,items), buildPath((path || ""), propertyName)); %> - - - - - - + + + + + + <% } %> <% } %> @@ -83,12 +84,12 @@ <% if ( property && !(propertyName.indexOf('x-parser-')> -1 || propertyName.indexOf('x-schema-private-') > -1) ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(property, propertyName, false, [], path, 'Single Item'); %> - - - - - - + + + + + + <% } %> <% } %> @@ -99,12 +100,12 @@ if ( item ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(item, "", false, [], buildPath(path || "", idx), 'index'); %> - - - - - - + + + + + + <% } %> <% }) %> @@ -113,12 +114,12 @@ <% if ( items ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(items, "", false, [], path, 'Single Item'); %> - - - - - - + + + + + + <% } %> <% } %> @@ -130,12 +131,12 @@ if ( s && !(idx.indexOf('x-parser-')> -1 || idx.indexOf('x-schema-private-') > -1) ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(s, idx, false, [], buildPath(path || schemaName, idx), 'oneOf item'); %> - - - - - - + + + + + + <% } %> <% }) %> @@ -143,12 +144,12 @@ if ( s && !(idx.indexOf('x-parser-')> -1 || idx.indexOf('x-schema-private-') > -1) ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(s, idx, false, [], buildPath(path || schemaName, idx), 'anyOf item'); %> - - - - - - + + + + + + <% } %> <% }) %> @@ -156,101 +157,101 @@ if ( s && !(idx.indexOf('x-parser-')> -1 || idx.indexOf('x-schema-private-') > -1) ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(s, idx, false, [], buildPath(path || schemaName, idx), 'allOf item'); %> - - - - - - + + + + + + <% } %> <% }) %> <% if ( schema.not() ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(schema.not(), "", false, [], path,'not', false); %> - - - - - - + + + + + + <% } %> <% if ( schema.propertyNames() ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(schema.propertyNames(), "", false, [], path,'property names', false); %> - - - - - - + + + + + + <% } %> <% if ( schema.contains() ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(schema.contains(), "", false, [], path,'contains', false); %> - - - - - - + + + + + + <% } %> <% if ( schema.if() ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(schema.if(), "", false, [], path,'if', false); %> - - - - - - + + + + + + <% } %> <% if ( schema.then() ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(schema.then(), "", false, [], path,'then', false); %> - - - - - - + + + + + + <% } %> <% if ( schema.else() ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(schema.else(), "", false, [], path,'else', false); %> - - - - - - + + + + + + <% } %> <% if ( dependentSchemas ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(dependentSchemas, "", false, [], path,'dependant schemas'); %> - - - - - - + + + + + + <% } %> <% if ( extensionsSchema ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(extensionsSchema, "", false, [], path); %> - - - - - - + + + + + + <% } %> <% const ext = schema.extensions(); @@ -263,12 +264,12 @@ if ( additionalProperties ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(additionalProperties, "", false, [], path,'additional properties', false); %> - - - - - - + + + + + + <% } %> <% } %> @@ -284,12 +285,12 @@ if ( additionalItems ) { const [renderedName, schemaType, description, values, constraints, notes] = schemaPropRow(additionalItems, "", false, [], path,'additional items', false); %> - - - - - - + + + + + + <% } %> <% } %> @@ -300,7 +301,7 @@ <% } %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %> <%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %><%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
<%- (renderedName || '-') %> <%- (schemaType || '-') %> <%- (md.render(description) || '-') %> <%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %> <%- (renderedName || '-') %> <%- (schemaType || '-') %><%- (md.render(description) || '-') %><%- (values || '-') %><%- (constraints || '-') %><%- (notes || '-') %>
- +
<% function schemaPropRow( schema, schemaName, required = false, dependentRequired = [], path = '', nameNote = '',tryRenderAdditionalNotes = true) { const isCircular = schema.isCircular() || false; const extensions = schema.extensions(); diff --git a/src/components/Security.ejs b/src/components/Security.ejs index 79ba76f..53eeb15 100644 --- a/src/components/Security.ejs +++ b/src/components/Security.ejs @@ -35,6 +35,7 @@
  • OpenID Connect URL: <%= schema.split('_')[2] %>
  • <% }else if(schema.split('_')[0] == 'RequiredScopes'){ %>
  • Required Scopes: <%= schema.split('_')[1]? schema.split('_')[1]: 'Nil' %>
  • +
    @@ -48,15 +49,16 @@ <% for(let entry of JSON.parse(schema.split('_')[2])){ %> - - - - - + + + + + <% } %>
    <%= entry[0] %><%= entry[1] %><%= entry[2] %><%= entry[3] %><%= entry[4] %><%= entry[0] %><%= entry[1] %><%= entry[2] %><%= entry[3] %><%= entry[4] %>
    +
    <% }else { %>
  • <%= schema %>
  • <% } %> diff --git a/src/components/Servers.ejs b/src/components/Servers.ejs index ed729bc..286481b 100644 --- a/src/components/Servers.ejs +++ b/src/components/Servers.ejs @@ -13,6 +13,7 @@ <% } %>

    URL Variables

    +
    @@ -25,23 +26,23 @@ <% for(let entry of server.variables().all()){ %> - - + + <% if(entry.hasDefaultValue()){ %> - + <% }else { %> - + <% } %> <% if(entry.hasAllowedValues()){ %> - + <% }else { %> - + <% } %> <% } %>
    <%= entry.id() %><%= entry.description() %><%= entry.id() %><%= entry.description() %><%= entry.defaultValue() %><%= entry.defaultValue() %>_None__None_<%= entry.allowedValues().map(value => value).join(', ') %><%= entry.allowedValues().map(value => value).join(', ') %>_Any__Any_
    - +
    <%- include(securityPath,{ header:null, protocol: server.protocol(), security: server.security(), serverHelper, md }) %> <%- include(tagsPath,{ name:"Tags", tags: server.tags() }) %> diff --git a/src/components/Tags.ejs b/src/components/Tags.ejs index 7b44372..47e077c 100644 --- a/src/components/Tags.ejs +++ b/src/components/Tags.ejs @@ -1,5 +1,6 @@ <% if(tags && !tags.isEmpty()) { %>
    <%= name %>
    +
    @@ -11,17 +12,17 @@ <% for(let entry of tags.all()){ %> - - + + <% if(entry.externalDocs()){ %> - + <% }else { %> - + <% } %> <% } %>
    <%= entry.name() %><%= entry.description() %><%= entry.name() %><%= entry.description() %><%= entry.externalDocs() && entry.externalDocs().hasDescription() ? entry.externalDocs().description() : 'Find more info here' %><%= entry.externalDocs() && entry.externalDocs().hasDescription() ? entry.externalDocs().description() : 'Find more info here' %>--
    - +
    <% } %>