Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify CSS, rename template #4

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/visual/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def query_string
@raw = Rouge.highlight(@sample, 'plaintext', @formatter)
@highlighted = Rouge.highlight(@sample, @lexer, @formatter)

template = params[:juxtaposed] ? :juxtaposed : :lexer
template = params[:juxtaposed] ? :lexer_juxtaposed : :lexer
erb template
end

Expand Down
69 changes: 0 additions & 69 deletions spec/visual/templates/juxtaposed.erb

This file was deleted.

47 changes: 47 additions & 0 deletions spec/visual/templates/lexer_juxtaposed.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<style type="text/css">
main {
display: inline-block;
margin-right: -300px;
padding: 15px 300px 15px 15px;
width: 100%;
}

.legend {
float: right;
padding: 15px;
padding-left: 0;
width: 250px;
}

div.codeviewer {
display: inline-block;
margin-right: 15px;
width: 48%;
}
</style>

<header id="page-header">
<h1><%= @lexer.class.tag %> lexer visual test</h1>
</header>

<main>
<section>
<div class="codeviewer">
<header class="section-header"><h2>Raw</h2></header>
<%= @raw %>
</div>
<div class="codeviewer">
<header class="section-header"><h2>Highlighted</h2></header>
<%= @highlighted %>
</div>
</section>
</main>

<aside class="legend">
<header class="section-header"><h2>Legend</h2></header>
<pre class="codehilite">
<% Rouge::Token.each_token do |token|
%><span class="<%= token.shortname %>"><%= token.qualname %></span>
<% end %>
</pre>
</aside>