-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add juxtaposing support to visual test app (#1168)
This commit adds the ability to juxtapose the highlighted and raw source in the visual test app. This can make comparison easier. To enable juxtaposing, use the `?juxtaposed=true` query variable.
- Loading branch information
Showing
4 changed files
with
55 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<style type="text/css"> | ||
main { | ||
display: inline-block; | ||
margin-right: -215px; | ||
padding: 8px 215px 0 0; | ||
width: 100%; | ||
} | ||
.codeviewer { | ||
float: left; | ||
padding: 8px 12px; | ||
width: 49.5%; | ||
} | ||
.legend { | ||
float: right; | ||
padding: 16px 14px 8px 0; | ||
width: 215px; | ||
} | ||
.legend .codehilite { font-size: 13px } | ||
</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> |