GithubHelp home page GithubHelp logo

arc-archive / raml-documentation-panel Goto Github PK

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

A documentation details panel. Its purpose is to compute documentation from the RAML file and display the result as a main documentation panel

License: Other

HTML 96.06% JavaScript 3.94%
raml raml-documentation-viewer api-console

raml-documentation-panel's Introduction

Build Status

raml-documentation-panel

The documentation viewer.

It displays a documentation panel depending on if the selected object is a method, resource, type or the documentation node.

The element will compute current view from the path property. However, if the app is using raml-path-to-object element the you can set the handlePathEvents property which will make the element to register event listeners fired from the raml-path-to-object element. It will skip internall path computation to not double the work.

The element is consisted with the following documentation viewers:

  • raml-docs-method-viewer
  • raml-docs-resource-viewer
  • raml-docs-documentation-viewer
  • raml-summary-view
  • raml-docs-types-viewer

Elements that are not displayed at a time are demoved from the DOM and are inavtive. Only active elements observe changes to the selected-object property and perform internall computation (it's optimisation).

Example

<raml-path-to-object path="types.0"></raml-path-to-object>
<raml-documentation-panel handle-path-events"></raml-documentation-panel>
<script>
var pto = document.querySelector('raml-path-to-object');
var docs = document.querySelector('raml-documentation-panel');
pto.addEventListener('selected-object-changed', function(e) {
  docs.selectedObject = e.detail.value;
});
pto.addEventListener('selected-parent-changed', function(e) {
  docs.selectedParent = e.detail.value;
});
</script>

Handling scrolling

Set the scrollTarget to an element that has a scroll region to suppoer scrolling in the elements. The resource documentation panel handles internall links that are expected to scroll the view to correspoinding sections. This default to the window object.

Styling

<raml-documentation-panel> provides the following custom properties and mixins for styling:

Custom property Description Default
--raml-documentation-panel Mixin applied to the element {}
--raml-docs-main-content Mixin applied to the main docs content (where the docs content is displayed). {}
--raml-docs-main-content-width Max width of the documentation panel. Additional space is required for innner panels navigation 900px
--raml-docs-documentation-width Max width of the documentation panel. It should be used to avoid usability issues for reading long texts. 700px

raml-documentation-panel's People

Contributors

arcauto avatar jarrodek avatar

Watchers

 avatar

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.