trulia / hologram

A markdown based documentation system for style guides.
http://trulia.github.io/hologram
Other
2.16k stars 200 forks source link

Reference variables in output #230

Open bradryanbice opened 9 years ago

bradryanbice commented 9 years ago

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

---
ryanmclaughlin commented 8 years ago

:+1:

sonniesedge commented 8 years ago

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