dominch / redmine_highlightjs Goto Github PK
View Code? Open in Web Editor NEWA redmine plugin to highlight code blocks much better than coderay!
License: Other
A redmine plugin to highlight code blocks much better than coderay!
License: Other
Hi,
I'm trying this plugin in redmine 2.4 on ubuntu.
I followed the installation procedure from http://www.redmine.org/projects/redmine/wiki/Plugins
I also had to add a symlink from
/usr/share/redmine/public/plugin_assets/redmine_highlightjs
to
/usr/share/redmine/plugins/redmine_highlightjs/assets/
but when i try to use the plugin I get a 500 error on my page, with this in the log :
Started GET "/redmine/projects/frex/wiki/Sandbox" for 93.93.152.125 at 2015-09-16 14:47:22 +0200
Processing by WikiController#show as HTML
Parameters: {"project_id"=>"frex", "id"=>"Sandbox"}
Current user: tludwig (id=4)
Rendered wiki/_content.html.erb (3.9ms)
Rendered wiki/show.html.erb within layouts/base (8.8ms)
Completed 500 Internal Server Error in 17.4ms
ActionView::Template::Error (undefined method highlight_by_language' for Highlightjs:Module): 1: <div class="wiki wiki-page"> 2: <%= textilizable content, :text, :attachments => content.page.attachments, 3: :edit_section_links => (@sections_editable && {:controller => 'wiki', :action => 'edit', :project_id => @page.project, :id => @page.title}) %> 4: </div> lib/redmine/syntax_highlighting.rb:23:in
highlight_by_language'
lib/redmine/wiki_formatting/textile/formatter.rb:125:in block in smooth_offtags' lib/redmine/wiki_formatting/textile/formatter.rb:121:in
gsub!'
lib/redmine/wiki_formatting/textile/formatter.rb:121:in smooth_offtags' lib/redcloth3.rb:307:in
to_html'
lib/redmine/wiki_formatting/textile/formatter.rb:43:in to_html' lib/redmine/wiki_formatting.rb:62:in
to_html'
app/helpers/application_helper.rb:529:in textilizable' app/views/wiki/_content.html.erb:2:in
_app_views_wiki__content_html_erb__534908553950101736_53954980'
app/views/wiki/show.html.erb:44:in _app_views_wiki_show_html_erb___2816532835930986738_53653820' app/controllers/wiki_controller.rb:97:in
show'
any clue ?
Thomas
Not work in git repository
https://highlightjs.org/static/demo/
For example, ocean?
xml code can not be highlighted.
Log:
Started GET "/" for 176.192.242.97 at 2016-06-21 17:50:39 +0300
Processing by WelcomeController#index as HTML
Current user: admin (id=1)
Rendered welcome/index.html.erb within layouts/base (4.4ms)
Completed 500 Internal Server Error in 26.6ms
ActionView::Template::Error (uninitialized constant Highlightjs::Hooks::ViewHighlightedHook::UserAgent):
12: <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
13: <%= javascript_heads %>
14: <%= heads_for_theme %>
15: <%= call_hook :view_layouts_base_html_head %>
16:
17: <%= yield :header_tags -%>
18:
lib/redmine/hook.rb:61:in block (2 levels) in call_hook' lib/redmine/hook.rb:61:in
each'
lib/redmine/hook.rb:61:in block in call_hook' lib/redmine/hook.rb:58:in
tap'
lib/redmine/hook.rb:58:in call_hook' lib/redmine/hook.rb:158:in
call_hook'
app/views/layouts/base.html.erb:15:in `_app_views_layouts_base_html_erb___2050110720569795547_34888040'
Hi,
When use your plugin with an other plugin "redmine_ckeditor", that breaks the preview of source code
the numbering of the lines and the navigation (with the arrow keys on the keyboard) are inconsistent in source preview
Redmine 3.4.5 stable
Plugin "http://github.com/a-ono/redmine_ckeditor" 1.1.5
Plugin "https://github.com/dominch/redmine_highlightjs" 1.0.3
Greetings.
#9 fix the code block disappearing problem in IE8, but codeRay is not working in IE8 now.
ActiveRecord::RecordNotFound (Couldn't find all CodeThemeUserSettings with 'id': (first, {:conditions=>["user_id = ?", 1]}) (found 0 results, but was looking for 2)):
lib/redmine/hook.rb:119:in `block (2 levels) in render_on'
lib/redmine/hook.rb:117:in `map'
lib/redmine/hook.rb:117:in `block in render_on'
lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
lib/redmine/hook.rb:61:in `each'
lib/redmine/hook.rb:61:in `block in call_hook'
lib/redmine/hook.rb:58:in `tap'
lib/redmine/hook.rb:58:in `call_hook'
lib/redmine/hook.rb:167:in `call_hook'
app/views/my/account.html.erb:34:in `block in _cc579177290608748590be8a74c21b3f'
app/helpers/application_helper.rb:1027:in `labelled_form_for'
app/views/my/account.html.erb:14:in `_cc579177290608748590be8a74c21b3f'
Those blocks, are now without padding, so they look bit different than simple
blocks.
Current lib is included statically (latest - 8.8.0), because of rapid development of highlightJS there should be script for building latest version
Redmine usually is restricted to logged in users, but it is possible to set it to view issues (with code) by non-logged users, there are some errors on this now.
setInterval(function() { updateCodes(file_class); }, 5000);
these lines remove selection every 5 seconds from text in pre block in webkit browsers(chrome, firefox, etc..)
After installing this extension, when I select Annotate in a file in the repository, I obtain the full code, as in "View".
It's possible at least to disable this extension to the Annotate view, ideally defaulting to the default syntax highlight in this case?
I know that IE8 is devil... But, all of our company's laptops use IE8 as the standard working browser.
Highlight.js does not support IE8, so I think maybe the plugin should add some compatible code not to use highlight.js in IE8.
styles in fixes.css made code blocks hidden in IE8...
Individual users wants to choose best theme for them. Let's allow that choice in user preference page.
All code HTML / XML / CSS in the repositories, is translated, instead of being displayed "as is" so , for example if I have an HTML file in the repository, when I see the page, the page elements are translated and it tries to display the elements inside (like tables, IFRAMES, sections, DIVS, XML CSS , etc) instead of the code. Unfortunately this is a big deal, so for now I'll uninstall until further notices for updates. Thank you for the plug-in, I'll keep track of it. I think its a great idea.
Hello,
There is some visual interaction between redmine_highlightjs 1.0.1 with the file views from repositories.
Environment:
Redmine version 2.6.6.stable
Ruby version 1.9.3-p194 (2012-04-20) [i386-mingw32]
Rails version 3.2.22
Environment production
Database adapter Mysql2
SCM:
Subversion 1.8.13
Git 1.9.5
Filesystem
Redmine plugins:
clipboard_image_paste 1.10
projects_tree_view 0.0.8
redmine_checklists 3.1.1
redmine_code_review 0.6.4
redmine_didyoumean 1.2.0
redmine_highlightjs 1.0.1
redmine_issue_detailed_tabs_time 0.1.0
redmine_issue_templates 0.0.9
redmine_latex_mathjax 0.1.0
redmine_local_avatars 0.1.1
redmine_pastebin 0.2.0
redmine_plugin_views_revisions 0.0.1
redmine_silencer 0.4.0
redmine_theme_changer 0.1.0
redmine_user_issues 0.0.2
redmine_wiki_gchart_formula 0.0.5
redmine_xls_export 0.2.1
redmine_youtube 0.0.1
sidebar_hide 0.0.6
wiking 1.0.0b
I experienced this with C files. When redmine_highlightjs is active the distance between the lines is about twice the normal spacing. Also, the formatting is lost.
Here is normal spacing and formatting
https://www.dropbox.com/s/3xuhwnu4snxvipn/normal_spacing.PNG?dl=0
and here is doubled spacing
https://www.dropbox.com/s/83ou5vn0t290436/extended_spacing.PNG?dl=0
,
The syntax shows here : http://www.redmine.org/projects/redmine/wiki/RedmineTextFormattingMarkdown describes a way to reference a line number with this syntax : source:some/file#L120
.
It doesn't work anymore with this plugin. I know Ivan Sagalaev is very anti line number, I don't know why because sometimes it's a great way to reference some code part when explaining it. It should be an option.
redmine_highlightjs/config/locales/zh.yml file with the first line wrongly set to en.
when plugin into redmine will get error like this:
Completed 500 Internal Server Error in 166ms
ActionView::Template::Error (translation missing: en.date.formats.default):
Good Redmine Plugin!
I have integrated it in my redmine system, and I have created the spanish translation. Here you have my little contribution to the project:
`
# Spanish strings go here for Rails i18n
es:
supported_languages: Lenguajes soportados en esta versión
highlighting_theme: Esquema de colores usado
try_it_link: "Prueba este tema con una demo online:"
code_theme: Esquema de colores
code_theme_title: Cambiar el esquema de colores
allow_redefine: Permitir cambios de esquema de colores por usuario
`
Thanks!
not really an issue but an update.
redmine gives this plugin compatible only with the version from 2.4 to 2.6.
I've installed it on my redmine 3.1 and it works perfectly!
thanx!
I can’t seem to get the plugin to work with markdown as my parser. Markdown should allow fenced code blocks like github does (three backticks, optionally followed by the language). However, this does not work in Redmine apparently. How do I use redmine_highlightjs with markdown?
Right now those blocks are parsed each 5s by lib and looks bit more ugly than simple "pre" block.
My redmine does not come online when I add this plugin.
Does it support the 3.2.1 version?
<pre><code class="html">
<input type="button" name="login" onclick="Agent.clickEvent();">
</code></pre>
Current version is 8.9.1,
This mode is not regular code block, has table all over screen. Let's see if there is a way to improve that.
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.