hologram icon indicating copy to clipboard operation
hologram copied to clipboard

Reference variables in output

Open bradryanbice opened this issue 9 years ago • 2 comments

Is it possible to access example-specific variables in my out put file? For example, here is my output file now:

<div class="codeExample">
    <div class="exampleOutput">
        <%= rendered_example %>
    </div>
    <div class="codeBlock">
        <div class="highlight">
            <pre>
                <code><%= code_example %></code>
            </pre>
        </div>
  </div>

Can I do something like the following:

<div class="codeExample">
    <div class="exampleOutput <%= name %>">
        <%= rendered_example %>
    </div>
    <div class="codeBlock">
        <div class="highlight">
            <pre>
                <code><%= code_example %></code>
            </pre>
        </div>
  </div>

Which introduces an example-specific class into each code block? So maybe this would say typography if my .scss file shows:

/*doc

---
title: Typography
name: typography
category: foundations

---

bradryanbice avatar May 13 '15 16:05 bradryanbice

:+1:

ryanmclaughlin avatar Dec 12 '15 02:12 ryanmclaughlin

Did anyone find a solution for this? I would love to include the name variable in the rendered template files.

sonniesedge avatar Feb 09 '16 17:02 sonniesedge