jensljungblad / elemental_styleguide Goto Github PK
View Code? Open in Web Editor NEWSimple style guide for Rails 5.1+
License: MIT License
Simple style guide for Rails 5.1+
License: MIT License
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?
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 ;)
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:
The error occurs during the third step.
The error does not show up if I browse the styleguide immediately after starting the server.
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))
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)
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?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.