This repository has been archived by the owner. It is now read-only.
forked from pragdave/codex
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Example included.
- Loading branch information
Showing
12 changed files
with
120 additions
and
58 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,13 @@ | ||
# This is _my_ example filter. Define your own ;-) | ||
|
||
class TestFilter < Codex::Filter | ||
tag :test | ||
|
||
def filter_inline(text,args) | ||
text.reverse | ||
end | ||
|
||
def filter_single(args) | ||
args.reverse | ||
end | ||
end |
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,44 @@ | ||
h1. User-defined filters | ||
|
||
h1. User-defined filters | ||
|
||
* Allow you to create your own @filters@ and @tags@ | ||
* They go in the filters/ directory | ||
* There already is an example filter there | ||
|
||
h1. Example filter | ||
|
||
<div style="width: 50%; float: right"> | ||
|
||
:code filters/example_filter.rb[class=code-normal] | ||
|
||
</div> | ||
|
||
|
||
<div style="width: 50%"> | ||
|
||
* Declare a class which inherits from @Codex::Filter@ | ||
** Set the tag you wish to use | ||
** Implement @filter_inline(text,args)@ | ||
** Implement @filter_single(args)@ | ||
** You can omit filter_single if you just want it to load a file and parse it through filter_inline | ||
|
||
</div> | ||
|
||
It's _that_ simple. | ||
|
||
h1. Using your filter | ||
|
||
You can now use your tags in your slides: | ||
|
||
:inlinecode | ||
:inlinetest | ||
Reverse this text | ||
:endinlinetest | ||
:endinlinecode | ||
|
||
The result is: | ||
|
||
:inlinetest | ||
Reverse this text | ||
:endinlinetest |
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
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 |
---|---|---|
|
@@ -8,4 +8,4 @@ def setup | |
def test_truth | ||
assert true | ||
end | ||
end | ||
end |
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,14 @@ | ||
require File.dirname(__FILE__) + '/test_helper.rb' | ||
|
||
class TestFilters < Test::Unit::TestCase | ||
def setup | ||
end | ||
|
||
def teardown | ||
end | ||
|
||
def test_truth | ||
assert true | ||
end | ||
|
||
end |