GithubHelp home page GithubHelp logo

izelnakri / moses Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 22.51 MB

one <script> tag that turns your frontend framework into a styleguide:

Home Page: http://izelnakri.github.io/moses/examples/custom/index.html

License: MIT License

JavaScript 37.30% CSS 62.70%

moses's Introduction

##One js file that turns your frontend framework into a styleguide

This is the library every frontend team needs to document and showcase their work. The library displays the html of your component + classes, and does few necessary magic for you... However we never intend to get in your way!

It is very easy to get started:

  • Create an empty webpage that has your css and javascript.
  • Include
<script src="https://rawgit.com/izelnakri/moses/master/src/moses.js"></script>

before </body>

Now you can use the styleguide!

####How to Use

  • create
  <main id="styleguide">

Whatever html you write inside the the <main> tag will get documented!

  • The library uses h1, h2, h3 as the title of your components, they get displayed on the left side of the styleguide navigation. <p> tag is used for descriptions, thus our html display engine ignores the element at the direct childrent level after <main> tag.
  • Every element other than
 <h1>, <h2>, <h3> and <p>

tag will be detected by the styleguide display engine and the html will be displayed under the element.

Now go ahead and try the library, you will be impressed.

##Additional stuff

###Grouping elements

  • you can group your components/classes under a single html display if you wrap the elements with .moses-group:
 <div class="moses-group">
    <!-- everything here will get displayed including the comments! -->
  </div>

###Hiding elements

  • you can turn of the display generation for a single element/parent element with .moses-hide:
 <div class="moses-hide">
    <!-- these elements will have an html display -->
  </div>

todo:

###Display icons

###Display color palette

###Display grid

###Seperate elements to categories

TODO:

  • ignore-tag logic.(done)
  • navigation logic. (half-done)
  • import the css via the javascript (done)
  • styleguide name logic from domain (done)
  • navigation populating + localstorage caching (mostly done)
  • maybe use http://prismjs.com/ (todo - low priority)
  • add ESC keylistener to untoggle navigation (done)
  • implement the rootStyleguidePath correctly in RegEX (probably done)
  • implement subheaderLists (done)
  • add Logic to implement extra Styleguide Categories (variable moses.js will check on runtime and merge it with possibleTargets)
  • click on the colors to copy color hex code
  • loading progress bar caveat

special classes:

.moses-group

.moses-hide

.moses-icon-list

.moses-color / palette

.moses-grid

.moses-code

.moses-subheader

moses's People

Contributors

izelnakri avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  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.