gpr / redmine_scmacros Goto Github PK
View Code? Open in Web Editor NEWAdds Wiki macros related to SCM
Adds Wiki macros related to SCM
$ rake db:migrate_plugins RAILS_ENV=production
rake aborted!
/var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/trace_output.rb:16:in `block in trace_on': invalid byte sequence in US-ASCII (ArgumentError)
from /var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/trace_output.rb:14:in `map'
from /var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/trace_output.rb:14:in `trace_on'
from /var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:376:in `trace'
from /var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:222:in `display_exception_message_details'
from /var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:209:in `display_exception_details'
from /var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:198:in `display_error_message'
from /var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:185:in `rescue in standard_exception_handling'
from /var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
from /var/lib/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
from /var/lib/gems/1.9.1/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
from /usr/local/bin/rake:23:in `load'
from /usr/local/bin/rake:23:in `<main>'
Thanks for this great plugin.
To include a line break inside a paragraph in the Markdown syntax, one should add two spaces at the end of the line. However, the rendered output for repo_includemd
is including a <br>
tag on every line break inside paragraphs.
Refers to comment in #1: repo_includewiki
macro fails on UTF8 conversion.
problem at this line. I 'm not familiar ruby. how can I fix it.
text = repo.cat(file_path);
Hello,
thank for this plugin.
I use redmine 3.10 and RedmineThemePixelCookers theme so the intégration of source code is not very readable.
I've made some modifications, i hope this will help you a lot:
Redmine::WikiFormatting::Macros.register do
desc "Includes and formats a file from repository.\n\n" +
" \{{repo_include(file_path)}}\n" +
" \{{repo_include(file_path, rev)}}\n"
macro :repo_include do |obj, args|
return nil if args.length < 1
file_path = args[0].strip
rev ||= args[1].strip if args.length > 1
repo = @project.repository
return nil unless repo
texts = repo.cat(file_path, rev)
#text = Redmine::CodesetUtil.to_utf8_by_setting(text)
text = ""
line_num = 1
text += "<link rel=\"stylesheet\" media=\"screen\" href=\"/redmine/stylesheets/scm.css\">"
text += "<style>#CodeDiv div.wiki table, div.wiki td, div.wiki th, div.wiki pre, div.wiki code{padding: 0px 3px 3px;border: 0px;}</style>"
text += "<div id=\"CodeDiv\" class=\"autoscroll\">"
text += "<table class=\"filecontent syntaxhl\">"
text += "<tbody>"
syntax_highlight_lines(file_path, Redmine::CodesetUtil.to_utf8_by_setting(texts)).each do |line|
text += "<tr id=\"L"+line_num.to_s+"\">"
text += "<th class=\"line-num\">"
text += "<a href=\"#L"+line_num.to_s+"\">"+line_num.to_s+"</a>"
text += "</th>"
text += "<td class=\"line-code\">"
text += "<pre>"+line.html_safe+"</pre>"
text += "</td>"
text += "</tr>"
line_num += 1
end
text += "</tbody>"
text += "</table>"
text += "</div>"
#o = text
h((text.html_safe))
#return o
end
end
best regards
helmer
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.