|
| 1 | +<section id="build"> |
| 2 | + |
| 3 | + <section id="commands"> |
| 4 | + <div class="container content-section"> |
| 5 | + |
| 6 | + <div class="row"> |
| 7 | + <div class="col-lg-12"> |
| 8 | + <!-- <hr class="section-heading-spacer"> --> |
| 9 | + <div class="clearfix"></div> |
| 10 | + <div class="lead"> |
| 11 | + <div class="row"> |
| 12 | + <div class="col-xs-5 col-xs-offset-1 col-md-4 col-md-offset-2"> |
| 13 | + <code>> coderoad create</code> |
| 14 | + <br> |
| 15 | + <br> |
| 16 | + </div> |
| 17 | + <div class="col-xs-6">Quickly setup a base project</div> |
| 18 | + </div> |
| 19 | + <div class="row"> |
| 20 | + <div class="col-xs-5 col-xs-offset-1 col-md-4 col-md-offset-2"> |
| 21 | + <code>> coderoad build</code> |
| 22 | + <br> |
| 23 | + <br> |
| 24 | + </div> |
| 25 | + <div class="col-xs-6">Parse markdown tutorial into <i>coderoad.json</i></div> |
| 26 | + </div> |
| 27 | + <div class="row"> |
| 28 | + <div class="col-xs-5 col-xs-offset-1 col-md-4 col-md-offset-2"> |
| 29 | + <code>> coderoad publish</code> |
| 30 | + <br> |
| 31 | + <br> |
| 32 | + </div> |
| 33 | + <div class="col-xs-6">Publish tutorial version on <a href="https://npmjs.org" target="_blank">NPM</a> with <i>coderoad-</i> prefix</div> |
| 34 | + </div> |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + </div> |
| 39 | + </section> |
| 40 | + |
| 41 | + <!-- /.container --> |
| 42 | + |
| 43 | + <div class="content-section-b"> |
| 44 | + |
| 45 | + <div class="container"> |
| 46 | + |
| 47 | + <div class="row"> |
| 48 | + <div class="col-lg-4 col-lg-offset-2 col-sm-push-6 col-sm-6"> |
| 49 | + <!-- <hr class="section-heading-spacer"> --> |
| 50 | + <div class="clearfix"></div> |
| 51 | + <h2 class="section-heading">Build in Markdown</h2> |
| 52 | + <div class="lead">Write lessons using markdown. |
| 53 | + <br> See a <a href="https://github.com/coderoad/coderoad-functional-school/blob/master/tutorial/1/01/filter.md" target="_blank">tutorial file</a>. |
| 54 | + <br> |
| 55 | + <br> Control the editor with a simple API: |
| 56 | + <br> |
| 57 | + <br> |
| 58 | + <br> |
| 59 | + <ul> |
| 60 | + <li><code>@import</code> load another markdown file</li> |
| 61 | + <br> |
| 62 | + <li><code>@test</code> load unit tests</li> |
| 63 | + <br> |
| 64 | + <li><code>@action</code> open a file, set/insert text</li> |
| 65 | + <br> |
| 66 | + <li><code>@hint</code> add helpful clues</li> |
| 67 | + </ul> |
| 68 | + </div> |
| 69 | + </div> |
| 70 | + <div class="col-lg-6 col-sm-pull-6 col-sm-6"> |
| 71 | + <pre><code class="language-markdown"> |
| 72 | +# Functional School |
| 73 | +A trip through functional programming in Javascript. |
| 74 | + |
| 75 | +## Array Methods |
| 76 | +Using common built-in Javascript array methods. |
| 77 | + |
| 78 | +### Filter |
| 79 | +Array -> Array of items that match a condition |
| 80 | + |
| 81 | ++ Write a filter condition function called `isAda` |
| 82 | +@test('1/01/01-filter') |
| 83 | +@action(open('01-filter.js')) |
| 84 | +@action(insert( |
| 85 | +``` |
| 86 | +// return true if student name |
| 87 | +// matches "Ada Lovelace" |
| 88 | +function isAda() { |
| 89 | +// write condition here |
| 90 | +} |
| 91 | +``` |
| 92 | +)) |
| 93 | + </pre></code> |
| 94 | + </div> |
| 95 | + </div> |
| 96 | + |
| 97 | + </div> |
| 98 | + <!-- /.container --> |
| 99 | + |
| 100 | + </div> |
| 101 | + <!-- /.content-section-b --> |
| 102 | + |
| 103 | + <div class="content-section-a"> |
| 104 | + |
| 105 | + <div class="container"> |
| 106 | + |
| 107 | + <div class="row"> |
| 108 | + <div class="col-lg-4 col-sm-6"> |
| 109 | + <!-- <hr class="section-heading-spacer"> --> |
| 110 | + <div class="clearfix"></div> |
| 111 | + <h2 class="section-heading">Unit Test Feedback</h2> |
| 112 | + <div class="lead"> Write task feedback using unit tests. |
| 113 | + <br> See a <a href="https://github.com/coderoad/coderoad-functional-school/blob/master/tutorial/1/01/01-filter.spec.js" target="_blank">complete test file</a>. |
| 114 | + <br> |
| 115 | + <br> |
| 116 | + <br> Currently supported: |
| 117 | + <br> |
| 118 | + <br> |
| 119 | + <ul> |
| 120 | + <li>Javascript: <a href="https://github.com/coderoad/mocha-coderoad" target="_blank">Mocha</a></li> |
| 121 | + </ul> |
| 122 | + <br> |
| 123 | + <br> |
| 124 | + <br> |
| 125 | + <i>We hope to support more test frameworks and programming languages in the near future.</i></div> |
| 126 | + </div> |
| 127 | + <div class="col-lg-6 col-lg-offset-2 col-sm-6"> |
| 128 | + <pre><code class="language-js"> |
| 129 | +describe('01 function isAda', function () { |
| 130 | + |
| 131 | +it('doesn\'t exist', function () { |
| 132 | + expect(isAda).to.not.be.undefined; |
| 133 | +}); |
| 134 | + |
| 135 | +it('should be a function', function () { |
| 136 | + expect(isAda).to.be.a('function'); |
| 137 | +}); |
| 138 | + |
| 139 | +it('needs to take a param', function () { |
| 140 | + expect(isAda).to.have.length(1); |
| 141 | +}); |
| 142 | + |
| 143 | +it('should use the full name "Ada Lovelace"', function () { |
| 144 | + var regex = /Ada Lovelace/; |
| 145 | + expect(!!isAda.toString().match(regex)).to.be.true; |
| 146 | +}); |
| 147 | + |
| 148 | +}); |
| 149 | + </code></pre> |
| 150 | + </div> |
| 151 | + </div> |
| 152 | + |
| 153 | + </div> |
| 154 | + <!-- /.container --> |
| 155 | + |
| 156 | + </div> |
| 157 | + <!-- /.content-section-a --> |
| 158 | + |
| 159 | +</section> |
| 160 | +<!-- /.content-section-b --> |
0 commit comments