GithubHelp home page GithubHelp logo

arc-archive / raml-docs-method-viewer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 119 KB

Documentation view for the method defined in RAML file

License: Other

HTML 91.45% JavaScript 2.11% RAML 6.44%
raml raml-documentation api-console

raml-docs-method-viewer's Introduction

Build Status

raml-docs-method-viewer

<raml-docs-method-viewer> Documentation view for the method defined in RAML file

This element is meant to work with data structure returned by the <raml-js-parser> and <raml-path-to-object>. Regular JSON output from the RAML JS parser will not work with this element.

Example

<raml-docs-method-viewer
  raml="[[methodDefinition]]"
  parent-endpoint="[[selectedParent]]"></raml-docs-method-viewer>

To properly compute values displayed in the view it needs to know its parentEndpoint. Though, it will work properly if the parent is not passed. Parent is used to display title of the method.

Disabling the "try it" button

You can either set the noTryIt property to true (or set the no-try-it attribute on the element) or send for the tryit-toggle custom event with the state property set to the detail object. The element will listen on window object for the event.

Styling

<raml-docs-method-viewer> provides the following custom properties and mixins for styling:

Custom property Description Default
--raml-docs-method-viewer Mixin applied to the element {}
--raml-docs-h1 Mixin applied to H1 {}
--raml-docs-h2 Mixin applied to H2 {}
--raml-docs-h3 Mixin applied to H3 {}
--raml-docs-method-viewer-title-method-font-weight Font weight of the name if the method 500
--raml-docs-method-viewer-http-method-font-weight Font weight of the HTTP method 500
--raml-docs-item-description Mixin applied to the description field. {}
--raml-docs-method-viewer-url-color Color of the URL field --accent-color
--raml-docs-method-viewer-url-font-style font-style of the URL value italic
--raml-docs-method-viewer-url Mixin applied to the URL field {}
--action-button Mixin applied to the main action button (Try it) {}
--action-button-hover Mixin applied to the main action button on hover (Try it) {}
--arc-font-headline Mixin applied to the h1 element (API title) {}
--arc-font-title Mixin applied to the h2 elements (section title) {}
--arc-font-subhead Mixin applied to the h3 elements (section sub-titles) {}
--toggle-button Mixin applied to toggling button (show/hide) {}
--toggle-button-hover Mixin applied to toggling button on hover (show/hide) {}
--raml-docs-method-viewer-title-area-actions Mixin applied to toggling actions area {}
--raml-docs-method-viewer-traits-list Mixin applied to the list of traits container {}
--raml-docs-method-viewer-traits-list-values Mixin applied to the list of traits values (names) {}
--raml-docs-method-viewer-traits-list-label Mixin applied to the list of traits list label {}
--raml-docs-method-viewer-traits-list-color Color of the traits list section rgba(0,0,0,0.74)
--raml-docs-method-viewer-traits-list-values-color Color of the traits list values (names) rgba(0,0,0,0.94)
--raml-docs-method-viewer-traits-list-label-color Color of the traits list label inherit

Events

Name Description Params
tryit-requested Fired when the user pressed the try it button. none

raml-docs-method-viewer's People

Contributors

arcauto avatar jarrodek avatar nazartokar avatar

Watchers

 avatar

raml-docs-method-viewer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.