Code Monkey home page Code Monkey logo

irwi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

irwi's Issues

bundler compatibility

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?

where is the wiki syntax

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?

footnote ancor (id-attribute) not rendered

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>

Is this gem still being maintained? Pull requests welcome?

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 :)

Can't run it in production without hack

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

Deprecation Warning with Latest Gems?

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.

history appears twice

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

Can't change root path?

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?

ActiveModel::MassAssignmentSecurity::Error in WikiPagesController#add_attachment

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:in new' irwi-df0c21c14b33/lib/irwi/extensions/controllers/wiki_page_attachments.rb:4:inadd_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

Using irwi as a nested resource

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.

markup gets spaces added in front on every edit

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.

rdoc.info failure - .document file

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.

rails4 couldn't execute 'rails g irwi_wiki'

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, xss

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>

cannot load such file -- redcloth

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:


9: <%=wiki_content @page.content %>
10:

activesupport (3.2.9) lib/active_support/dependencies.rb:251:in require' activesupport (3.2.9) lib/active_support/dependencies.rb:251:inblock in require'
activesupport (3.2.9) lib/active_support/dependencies.rb:236:in load_dependency' activesupport (3.2.9) lib/active_support/dependencies.rb:251:inrequire'
/home/mdoering/.rvm/gems/ruby-1.9.3-p194/bundler/gems/irwi-df0c21c14b33/lib/irwi/formatters/red_cloth.rb:4:in initialize' /home/mdoering/.rvm/gems/ruby-1.9.3-p194/bundler/gems/irwi-df0c21c14b33/lib/irwi/config.rb:19:innew'
/home/mdoering/.rvm/gems/ruby-1.9.3-p194/bundler/gems/irwi-df0c21c14b33/lib/irwi/config.rb:19:in formatter' /home/mdoering/.rvm/gems/ruby-1.9.3-p194/bundler/gems/irwi-df0c21c14b33/lib/irwi/helpers/wiki_pages_helper.rb:42:inwiki_content'

It looks like redcloth is not happy with the erb file? Any thoughts?

Thank you

/wiki/new - Wrong number of Args (3 of 2)

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,

Page content limited to 2^16 bytes on MySQL

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)

Diff does't work with unicode

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    

private method `gsub' called for nil:NilClass

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.

edit.html.erb doesn't render correctlywith application.html.haml

Right of the box, I seem to see a problem with edit. The generated HTML looks like this:

<p>Content:<br />&lt;textarea cols=&quot;40&quot; id=&quot;page_content&quot; name=&quot;page[content]&quot; rows=&quot;20&quot;&gt;FAQs Here!&lt;/textarea&gt;</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.

Wiki content order issue

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) ) )  )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.