alno / irwi Goto Github PK
View Code? Open in Web Editor NEWComplete wiki plugin for Ruby on Rails
Home Page: http://irwi-test.heroku.com/
License: MIT License
Complete wiki plugin for Ruby on Rails
Home Page: http://irwi-test.heroku.com/
License: MIT License
I seem to be having some trouble with Irwi Wiki since switching my app to use Bundler. I get a weird error on any wiki show page:
missing interpolation argument in "%{count} %B %Y, %H:%M" ({:object=>Sun Jan 10 17:10:07 +0100 2010} given)
Showing vendor/plugins/irwi/app/views/base_wiki_pages/_wiki_page_info.html.erb where line #2 raised:
Extracted source (around line #2):
1: <div class="wiki_page_info">
2: <%=wt "Revised on {{time}} by {{user}}", :time => l( page.updated_at, :format => :long ), :user => wiki_user( page.updator ) %>
3: </div>
And yes, this error occurs also when Irwi is installed as plugin, not as gem.
Ruby i18n version 0.4.1 (latest one).
I get an ever weirder error on edit pages:
NameError in Wiki_pages#edit
Showing vendor/plugins/irwi/app/views/base_wiki_pages/edit.html.erb where line #16 raised:
uninitialized constant WikiPage::WikiPageAttachment
Extracted source (around line #16):
13: <% end %>
14:
15:
16: <%- @page.attachments.each do |attachment| %>
17: <%= image_tag attachment.wiki_page_attachment.url(:thumb) %>
18: <%= "Attachment_#{attachment.id}" %>
19: <%= link_to wt('Remove'), wiki_remove_page_attachment_path(attachment.id), :method => :delete %>
Are you able to reproduce it?
I cant seem to generate links or get any sort of wiki like syntax to generate links in pages.
how do you link a page to another?
foo[1]
bar
fn1. Not exclusivly foo, als foobar.
It will not render the id-attribute of the p-tag.
Redcloth is working correct:
text= "foo[1]\n\nbar\n\nfn1. Not exclusivly foo, als foobar."; RedCloth.new(text).to_html
results in:
<p>foo<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>\n<p>bar</p>\n<p class="footnote" id="fn1"><a href="#fnr1"><sup>1</sup></a> Not exclusivly foo, als foobar.</p>
There are a few things I'd like to add. The code looks very tight, so I'd love to contribute.
I found one bug with spaces in titles. I also have some thoughts about page renaming. And some documentation on how to integrate with Pundit and how to namespace wiki stuff (for larger apps).
But I don't want to write all this up unless I know someone will read it :)
Would be awesome to reactivate to quickly check out irwi.
Hi great job so far with the plugin, it works really well.
I just have one small problem I can't seem to resolve. When I run my project in Production mode I keep getting a "uninitialized constant Irwi::Formatters" somehow he doesn't load the formatters.
Would you have any idea why this is? It runs perfectly fine in development.
Regards
I get this warning using the lastest version of gems:
NOTE: Gem::Specification#has_rdoc= is deprecated with no replacement. It will be removed on or after 2011-10-01.
in a default installation - that is:
$ rails generate irwi_wiki
$ rake db:migrate
when looking at the history of some wiki page, it will be rendered /twice/ on the page
If I change the wiki_root '/wiki'
to, say wiki_root '/docs'
, I get an error from the page actions partial "undefined local variable or method `wiki_all_path' for…"
Looks like the actual path helper is set to docs_all… is there a way to change this in config?
Hi,
I currently try to use irwi attachments and get the following error:
ActiveModel::MassAssignmentSecurity::Error in WikiPagesController#add_attachment
Can't mass-assign protected attributes: wiki_page_attachment, page_id
in
irwi-df0c21c14b33/lib/irwi/extensions/controllers/wiki_page_attachments.rb:4:innew' irwi-df0c21c14b33/lib/irwi/extensions/controllers/wiki_page_attachments.rb:4:in
add_attachment'
Because of issue #31 i switched from the gem on rubygems to the git version:
Gemfile:
gem "irwi", :git => "git://github.com/alno/irwi.git"
gem 'paperclip'
Running Debian stable with
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
Rails 3.2.5
Hi,
I have a project-management app build and would like to have a wiki for every project. In other words, I would like to have wiki resource nested inside project resource.
Can I use irwi and how?
Thanks in advance.
Preview button on wiki edit page.
Irwi's gem generated problems with a dependency on rcov.
It seems that there should be a link to revert a change, not just compare from the history page... no?
http://irwi-test.herokuapp.com returns an 'Application Error'
When the wiki content contains newlines, then those get rendered as such by Erubis (RoR 3's ERB engine), and then get "correctly" indented in the produced HTML code. The following line is responsible for this:
irwi/app/views/base_wiki_pages/edit.html.erb:16
<p><%=wt 'Content:' %><br /><%= f.text_area :content %></p>
The produced HTML looks like this:
______<p>Content:<br /><textarea cols="40" id="page_content" name="page[content]" rows="20">First Line
________Second Line</textarea>
(the leading spaces above have been replaced by underscores). The problem is, that the spaces in front of "Second Line" will appear inside the textarea in the browser. And when the user submits the content as it is, those spaces will get added to the respectiv database wiki_page row.
I've googled around for two hours or so, and there seem to be other people having the same problem with ERB and f.textarea, however no solution for ERB/Erubis seems to be known.
Noticed this:
raise ActiveRecordError.new "Cann't modify existent version"
Should be "Can't".
Hi there! Noticed that your rdoc.info doc generation failed. Looks like this is because your .document file includes at least one filename that doesn't exist in your project (LICENSE should be MIT-LICENSE, etc). If you want to correct this I suspect that doc generation will work fine the next time. If not, let us know and we'll be happy to help.
Hi. I'm beginner of irwi.
In my sample app, ruby2 with rails4, failed the rails generate command.
$ ../rails/railties/bin/rails g irwi_wiki
/usr/local/www/codes/rails4/rails/activesupport/lib/active_support/dependencies.rb:228:in `require': cannot load such file -- rails/generators/active_record/migration (LoadError)
Is it fixeable?
Rails 3.0 (or 2.3.5 with plugin) has xss protection by default. Irwi work well with it except one place, here patch that fix it and allow to work with 2.3 and 3.0:
diff --git a/app/views/base_wiki_pages/_wiki_page_actions.html.erb b/app/views/base_wiki_pages/_wiki_page_actions.html.erb
index e8ce1e0..5086bd9 100644
--- a/app/views/base_wiki_pages/_wiki_page_actions.html.erb
+++ b/app/views/base_wiki_pages/_wiki_page_actions.html.erb
@@ -1,5 +1,5 @@
<ul class="wiki_page_actions">
- <%= '<li>' + link_to( wt( 'History' ), wiki_page_history_path ) + '</li>' if history_allowed? %>
- <%= '<li>' + link_to( wt( 'Edit' ), wiki_page_edit_path ) + '</li>' if edit_allowed? %>
- <%= '<li>' + link_to( wt( 'Destroy' ), wiki_page_path, :method => :delete, :confirm => wt( "Destroyed page cann't be restored. Are yo
-</ul>
\ No newline at end of file
+ <%= content_tag('li', link_to( wt( 'History' ), wiki_page_history_path )) if history_allowed? %>
+ <%= content_tag('li', link_to( wt( 'Edit' ), wiki_page_edit_path )) if edit_allowed? %>
+ <%= content_tag('li', link_to( wt( 'Destroy' ), wiki_page_path, :method => :delete, :confirm => wt( "Destroyed page cann't be restore
+</ul>
This is a new project with:
ruby 1.9.3p194 (2012-04-20 revision 35410)
Rails 3.2.9
The gem file has, among others:
gem 'irwi', :git => 'git://github.com/alno/irwi.git'
gem 'haml-rails'
I added the gem, did the migration and then tried to create the first page. The editor came up just fine but then when I tried to save I got:
ActionView::Template::Error (cannot load such file -- redcloth):
6: <%= wiki_page_actions %>
7:
8:
require' activesupport (3.2.9) lib/active_support/dependencies.rb:251:in
block in require'load_dependency' activesupport (3.2.9) lib/active_support/dependencies.rb:251:in
require'initialize' /home/mdoering/.rvm/gems/ruby-1.9.3-p194/bundler/gems/irwi-df0c21c14b33/lib/irwi/config.rb:19:in
new'formatter' /home/mdoering/.rvm/gems/ruby-1.9.3-p194/bundler/gems/irwi-df0c21c14b33/lib/irwi/helpers/wiki_pages_helper.rb:42:in
wiki_content'
It looks like redcloth is not happy with the erb file? Any thoughts?
Thank you
Having a bit of trouble applying the gem to my App. I set everything up and ran the script. Everything was pretty much in place from the beginning, so there was really no need for any configurations; however, when I go to my "/wiki" location and then try to start a new page to be the homepage I get an error. Here is the output:
wrong number of arguments (3 for 2)
Extracted source (around line #5):
2:
3: <%=wt 'Creating a new wiki page' %>
4:
5: <% wiki_page_form do |f| %>
6: <%= f.hidden_field :previous_version_number, :value => f.object.last_version_number %>
7:
8:
<%=wt 'Title:' %>
<%= f.text_field :title %>
Is there anything that I might be doing wrong? Or maybe some kind of configuration that I needed and missed? Thanks,
On MySQL adapter pages are limited to 2^16 characters due to :text data type (TEXT
in MySQL). Changing MySQL type to LONGTEXT
would allow longer pages - this requires a change to schema (:text
--> :text, :limit => 4294967295
)
While using carrierwave instead of paperclip to wiki_attachments getting this error.
Running the migration yields:
rake aborted!
undefined method `attr_accessor_with_default' for Irwi::Config:Class
In some cases diff сuts unicode charachres (cyrilic for example). Adding mb_chars to diff_lcs solves problem:
diffs = Diff::LCS.sdiff( (old_text || '').mb_chars, (new_text || '').mb_chars ) # Building symmetric diff sequence
So the migration doesn't work
enviroment:
rails 3.0.5
irwi (0.4.1)
actionpack (>= 3.0.0)
activerecord (>= 3.0.0)
activesupport (>= 3.0.0)
diff-lcs (>= 1.1.2)
I have installed irwi and generated irwi_wiki, everything seems OK.But after DB migrate,I run my app,and visit wiki, then got this error.
rails error info in chrome:
NoMethodError in Wiki_pages#show
Showing /home/fanday/.bundler/ruby/1.8/irwi-3cfb6f192e2d/app/views/base_wiki_pages/no.html.erb where line #1 raised:
private method `gsub' called for nil:NilClass
Extracted source (around line #1):
1: <%=(wt 'There is no such page. Do you want to create it?', :new_url => wiki_page_new_path ).html_safe %>
thanks very much.
Right of the box, I seem to see a problem with edit. The generated HTML looks like this:
<p>Content:<br /><textarea cols="40" id="page_content" name="page[content]" rows="20">FAQs Here!</textarea></p>
Notice the beginning of the input tag is missing and then the HTML is quoted. The other fields do render correctly.
I'm using HAML and my application layout file is in HAML. When I convert edit.html.erb to edit.html.haml and place it in my applications view/wiki_pages folder, all seems to be good.
This leads me to think that there's a mismatch somewhere between erb and haml. This might not be an irwi problem but that's where I encountered it. Thought I'd let you know.
Now wiki content look like
def wiki_content( text )
sanitize( wiki_linkify( auto_link( Irwi.config.formatter.format( text ) ) ) )
end
For RedCloth, for example this won't work "[[FAQ]]" because it converted to [[<span class="caps">FAQ</span>]]. I suggest change order to:
sanitize( auto_link( Irwi.config.formatter.format( wiki_linkify (text) ) ) )
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.