wacky 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,19 +1,35 @@
1
1
  ## Wacky
2
+ [![Build Status](https://travis-ci.org/isotope11/wacky.png?branch=master)](https://travis-ci.org/isotope11/wacky)
2
3
 
3
4
  Wacky is an engine for Rails that aims to be the best wiki. The end goal is to
4
5
  have a drop-in wiki for any given Rails app.
5
6
 
7
+ Features:
8
+
9
+ - versioning
10
+ - realtime markdown preview
11
+
6
12
  ### Installation
7
13
 
8
14
  Add wacky to your Gemfile:
9
15
 
10
- gem 'wacky'
16
+ ```ruby
17
+ gem 'wacky'
18
+ ```
11
19
 
12
20
  Mount wacky on your app:
13
21
 
14
- mount Wacky, at: '/wiki'
22
+ ```ruby
23
+ mount Wacky, at: '/wiki'
24
+ ```
15
25
 
16
26
  Copy the migrations and run them:
17
27
 
18
28
  rake wacky:install:migrations
19
29
  rake db:migrate
30
+
31
+ ### Development
32
+
33
+ To run the tests:
34
+
35
+ rake
@@ -16,4 +16,5 @@
16
16
  //= require theme-solarized_dark.js
17
17
  //= require mode-markdown.js
18
18
  //= require keybinding-vim
19
+ //= require showdown
19
20
  //= require_tree .
@@ -0,0 +1,13 @@
1
+ $(function(){
2
+ if($('#showdown_preview')[0]){
3
+ var editor = ace.edit("page_editor");
4
+ var converter = new Showdown.converter();
5
+ var textarea = $('#page_body');
6
+ var previewArea = $('#showdown_preview');
7
+ var updatePreview = function(){
8
+ previewArea.html(converter.makeHtml(editor.getSession().getValue()));
9
+ };
10
+ editor.getSession().on('change', updatePreview);
11
+ updatePreview();
12
+ }
13
+ });
@@ -1,6 +1,10 @@
1
1
  #page_editor {
2
- width: 95%;
2
+ width: 50%;
3
3
  height: 500px;
4
4
  clear: both;
5
5
  font-size: 100%;
6
6
  }
7
+ #showdown_preview {
8
+ width: 48%;
9
+ margin-left: 52%;
10
+ }
@@ -0,0 +1,7 @@
1
+ module Wacky
2
+ class SpecialPagesController < Wacky::ApplicationController
3
+ def recently_updated
4
+ @pages = Page.order("updated_at DESC").limit(10)
5
+ end
6
+ end
7
+ end
@@ -6,3 +6,4 @@ h2 Edit #{@page.slug}
6
6
  = f.label :body
7
7
  = f.text_area :body
8
8
  #page_editor
9
+ #showdown_preview
@@ -0,0 +1,4 @@
1
+ h2 Recently Updated
2
+ ul
3
+ - @pages.each do |page|
4
+ li= link_to page.slug.titleize, page_path(page)
data/config/routes.rb CHANGED
@@ -9,5 +9,6 @@ Wacky::Engine.routes.draw do
9
9
  end
10
10
  end
11
11
 
12
+ match "/recently_updated" => "special_pages#recently_updated"
12
13
  match "/:id" => "pages#show"
13
14
  end
data/lib/wacky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wacky
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/wacky.rb CHANGED
@@ -7,6 +7,7 @@ require "slim"
7
7
  require 'redcarpet'
8
8
  require 'ace-rails-ap'
9
9
  require 'paper_trail'
10
+ require 'showdown-rails'
10
11
 
11
12
  module Wacky
12
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wacky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-09 00:00:00.000000000 Z
12
+ date: 2013-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -123,6 +123,22 @@ dependencies:
123
123
  - - ! '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: showdown-rails
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
126
142
  - !ruby/object:Gem::Dependency
127
143
  name: sqlite3
128
144
  requirement: !ruby/object:Gem::Requirement
@@ -322,27 +338,30 @@ executables: []
322
338
  extensions: []
323
339
  extra_rdoc_files: []
324
340
  files:
325
- - app/views/layouts/wacky/application.html.slim
326
- - app/views/wacky/pages/versions.html.slim
327
- - app/views/wacky/pages/new.html.slim
328
- - app/views/wacky/pages/version.html.slim
329
- - app/views/wacky/pages/show.html.slim
330
- - app/views/wacky/pages/edit.html.slim
331
- - app/models/wacky/page.rb
341
+ - app/assets/javascripts/wacky/showdown.js
332
342
  - app/assets/javascripts/wacky/ace.js
333
343
  - app/assets/javascripts/wacky/application.js
334
344
  - app/assets/stylesheets/wacky/ace.css.scss
335
345
  - app/assets/stylesheets/wacky/application.css
346
+ - app/models/wacky/page.rb
347
+ - app/helpers/wacky/application_helper.rb
336
348
  - app/controllers/wacky/application_controller.rb
349
+ - app/controllers/wacky/special_pages_controller.rb
337
350
  - app/controllers/wacky/pages_controller.rb
338
- - app/helpers/wacky/application_helper.rb
351
+ - app/views/wacky/pages/version.html.slim
352
+ - app/views/wacky/pages/edit.html.slim
353
+ - app/views/wacky/pages/new.html.slim
354
+ - app/views/wacky/pages/versions.html.slim
355
+ - app/views/wacky/pages/show.html.slim
356
+ - app/views/wacky/special_pages/recently_updated.html.slim
357
+ - app/views/layouts/wacky/application.html.slim
339
358
  - config/routes.rb
340
359
  - db/migrate/20121230044818_create_versions.rb
341
360
  - db/migrate/20121228200953_create_pages.rb
342
- - lib/tasks/wacky_tasks.rake
343
361
  - lib/wacky.rb
344
- - lib/wacky/version.rb
345
362
  - lib/wacky/engine.rb
363
+ - lib/wacky/version.rb
364
+ - lib/tasks/wacky_tasks.rake
346
365
  - MIT-LICENSE
347
366
  - Rakefile
348
367
  - README.md
@@ -358,18 +377,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
358
377
  - - ! '>='
359
378
  - !ruby/object:Gem::Version
360
379
  version: '0'
361
- segments:
362
- - 0
363
- hash: -967542709524033240
364
380
  required_rubygems_version: !ruby/object:Gem::Requirement
365
381
  none: false
366
382
  requirements:
367
383
  - - ! '>='
368
384
  - !ruby/object:Gem::Version
369
385
  version: '0'
370
- segments:
371
- - 0
372
- hash: -967542709524033240
373
386
  requirements: []
374
387
  rubyforge_project:
375
388
  rubygems_version: 1.8.24