Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

Commit

Permalink
Added a convenient syntax for <footer>, fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
kizu committed Apr 13, 2013
1 parent c455607 commit 2c9ca4f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,18 @@ Also, Shower engine allows you to say if the image should be fit to the width or
{:.cover .h}
```

#### Presenter notes

In Shower the presenter notes are made by using `<footer>` tag. Jekyller provides you a convenient way to write short ones — just write them like this:

``` md
// I'm a presenter note!
```

That's it — a line starting with `//` followed by one optional space would be wrapped by `<footer>`.

However, if you'd want more complex note, you'd need to use plain html `<footer>`, 'cause there is no way to place anything block-level inside this “comment” right now.

#### Embedded HTML

Of course even extended by kramdown markdown syntax don't have everything in it. So if you'd like to add something _extra_, you could just use plain HTML there. Like this:
Expand Down
26 changes: 26 additions & 0 deletions _includes/showerify.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,32 @@
{% assign showerify_middle = showerify_middle | replace:'&lt;mark class="comment"&gt;','<mark class="comment">' %}
{% assign showerify_middle = showerify_middle | replace:'&lt;mark class="important"&gt;','<mark class="important">' %}

<!-- Replacing inline “comment” with <footer> -->
{% assign footers = showerify_middle | split:'<p>// ' %}
{% assign iteration = 0 %}
{% for footer in footers %}
{% if iteration > 0 %}
{% assign footer_content = footer | split:'</p>' | first %}
{% capture footer_oldcontent %}<p>// {{ footer_content }}</p>{% endcapture %}
{% capture footer_newcontent %}<footer>{{ footer_content }}</footer>{% endcapture %}
{% assign showerify_middle = showerify_middle | replace_first:footer_oldcontent,footer_newcontent %}
{% endif %}
{% assign iteration = iteration | plus:1 %}
{% endfor %}

<!-- The same thing, but this time for comment without the space -->
{% assign footers = showerify_middle | split:'<p>//' %}
{% assign iteration = 0 %}
{% for footer in footers %}
{% if iteration > 0 %}
{% assign footer_content = footer | split:'</p>' | first %}
{% capture footer_oldcontent %}<p>//{{ footer_content }}</p>{% endcapture %}
{% capture footer_newcontent %}<footer>{{ footer_content }}</footer>{% endcapture %}
{% assign showerify_middle = showerify_middle | replace_first:footer_oldcontent,footer_newcontent %}
{% endif %}
{% assign iteration = iteration | plus:1 %}
{% endfor %}

<!-- Prototype of #3, need to split things here -->
<!-- is there a way to declare <hr/> with classes/attributes? -->
{% assign showerify_middle = showerify_middle | replace:'<hr />','</div></section><section class="slide"><div>' %}
Expand Down

0 comments on commit 2c9ca4f

Please sign in to comment.