Coder Social home page Coder Social logo

elemental_styleguide's People

Contributors

jensljungblad avatar msalzburg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

emjot six7 reviewed

elemental_styleguide's Issues

Gem name and release on rubygems

Since the name "styleguide" is already used/blocked on rubygems we should probably find a new name, rename the project/files and work towards an offical release on rubygems?

@jensljungblad do you have any names on your mind already?

Wrong namespace for install generator in README

While following your README I just stumbled across the wrong namespace
for the install generator. Currently it says to use the bin/rails g components:install generator,
which actually is named bin/rails g styleguide:install ;)

Ensure Styleguide::NavigationHelper is available in Styleguide::PagesController

While experimenting with the gem I regularly managed to receive this error:

NameError in Styleguide::Pages#show - undefined local variable or method `navigation' for Class ...

I can reproduce it by following these steps:

  1. start rails server (freshly) bin/rails s
  2. browse to a controller/action from my rails project e.g. localhost:3000/pages/index
  3. browse to the styleguide e.g. localhost:3000/styleguide (thats where I mounted the engine)

The error occurs during the third step.

The error does not show up if I browse the styleguide immediately after starting the server.

"New" ElementalStyleguide::MarkdownHandler is not Rails 5 compatible

The .call method signature of rails template handlers has changed between rails 5 and 6.

Rails 5: (see: https://github.com/rails/rails/blob/5-2-stable/actionview/lib/action_view/template/handlers/html.rb)

def call(template)

Rails 6:
(see: https://github.com/rails/rails/blob/6-0-stable/actionview/lib/action_view/template/handlers/html.rb)

def call(template, source)

Since the "new" renamed ElementalStyleguide::MarkdownHandler currently uses the rails 6 method signature, users trying to view the styleguide in rails 5 receive the following error:

ActionView::Template::Error (wrong number of arguments (given 1, expected 2))

Generate example.html.erb layout within app/views/layouts directory

Currently the styleguide:install generator copies the styleguide/example.html.erb file and directory directly into the rails app/ directory - which leads to a "missing template" error while rendering the styleguide.

Current location: /app/layouts/styleguide/example.html.erb (with error)
"Conventional" location: /app/views/layouts/styleguide/example.html.erb (without error)

Execute examples in the context of the application

Currently we mix in helpers from the main application in the ExamplesController class. However, things like routes get prefixed with the engine name regardless. Is there a better way to have the example be executed in the context of the application, which is what we want?

Figure out a better, more secure way of injecting examples into the example iframe

Currently examples are Base64 encoded, then passed to the iframe which, as part of the examples_controller#show method, decodes it and evaluates the erb. This is obviously not a good idea, since anyone with access to the style guide can execute any erb they want. That is why the style guide should currently not be used in a production environment, and is considered experimental.

So, we should figure out a better way to pass and evaluate the erb to the iframe.

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.