Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme installation #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 48 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# HighlightJS Plugin
# HighlightJS Plugin

A redmine plugin to highlight code blocks much better than coderay! :)
135 languages with autodetection feature, 65 color themes, multi language code highlight (like http+json)
A redmine plugin to highlight code blocks much better than coderay! :)
135 languages with autodetection feature, 65 color themes, multi language code highlight (like http+json)
Try Your language and choose best theme for You: https://highlightjs.org/static/demo/

Old good coderay:
Old good coderay:

![](https://raw.githubusercontent.com/dominch/redmine_highlightjs/master/screenshots/coderay.png)

Expand All @@ -19,26 +19,54 @@ Supported languages and markups in build: 1c accesslog actionscript apache apple

# Install

1. Follow the Redmine plugin installation steps at: http://www.redmine.org/wiki/redmine/Plugins
1. Make sure the plugin installation directory name is <tt>redmine_highlighjs</tt>
1. Restart the server (this will ensure that the CSS file and other assets are copied to the right place)
1. (optional) Configure color theme in Administration -> Plugins -> HighlightJS
1. Copy `redmine_highlightjs` plugin to your Redmine's `/plugin` directory:
+ Redmine 1.x:

```
cd redmine/vendor/plugins
git clone [email protected]:dominch/redmine_highlightjs.git
```
+ Redmine 2.x or 3.x:

```
cd redmine/plugins
git clone [email protected]:dominch/redmine_highlightjs.git
```
2. This plugin relies on [useragent](https://github.com/gshutler/useragent) `gem`, so make sure you have it installed:

```
cd redmine/
bundle
```
3. This plugin needs an extra table in Redmine's DB, so:
+ Redmine 1.x:

```
rake db:migrate_plugins RAILS_ENV=production
```
+ Redmine 2.x or 3.x:

```
rake redmine:plugins:migrate RAILS_ENV=production
```
4. Restart Redmine (_this will ensure that the CSS file and other assets are copied to the right place_)
5. (optional) Configure color theme in `Administration -> Plugins -> HighlightJS`

# Browser Restrictions

Plugin is restricted to work with following browsers (or newer):
Plugin is restricted to work with following browsers (or newer):

Browser.new('Safari', '2'),
Browser.new('Firefox', '3'),
Browser.new('Chrome', '10'),
Browser.new('Internet Explorer', '9')

If You find out that there are some problems with Your browser then report bug in github, so we can turn it off for selected software. Some people still using old browsers like IE8, when others are up to date. IE8 is unsupported by main lib so there is nothing better than turning on coderay again.
If You find out that there are some problems with Your browser then report bug in github, so we can turn it off for selected software. Some people still using old browsers like IE8, when others are up to date. IE8 is unsupported by main lib so there is nothing better than turning on coderay again.

# Usage

This plugin will replace existing Coderay highlights,
You can specify target language like usual:
This plugin will replace existing Coderay highlights,
You can specify target language like usual:

<pre><code class="json">
[
Expand All @@ -55,7 +83,7 @@ You can specify target language like usual:
]
</code></pre>

or use autodetection:
or use autodetection:

<pre><code>
[
Expand All @@ -72,14 +100,14 @@ or use autodetection:
]
</code></pre>

Autodetection works great with more than one language on the board, like http with appliction/json body:
Autodetection works great with more than one language on the board, like http with appliction/json body:

<pre><code>
POST /task?id=1 HTTP/1.1
Host: example.org
Content-Type: application/json; charset=utf-8
Content-Length: 19

{"status": "ok", "extended": true}
</code></pre>

Expand All @@ -91,7 +119,7 @@ Plugin additionaly trims white lines from start and end so

<pre><code>{"status": "ok", "extended": true}</code></pre>

is equal to:
is equal to:

<pre><code>
{"status": "ok", "extended": true}
Expand All @@ -100,17 +128,17 @@ is equal to:
# Build Your own HighlightJS version

If You need subset of supported languages follow instruction on highlightJS site: http://highlightjs.readthedocs.org/en/latest/building-testing.html
Just replace redmine_highlightjs/assets/javascript/highlight.pack.min.js with Your build
Just replace redmine_highlightjs/assets/javascript/highlight.pack.min.js with Your build

For Your new language definition follow instructions here: http://highlightjs.readthedocs.org/en/latest/language-guide.html

# FAQ:
# FAQ:

### Line numbers?
### Line numbers?

No, that probably never happens! http://highlightjs.readthedocs.org/en/latest/line-numbers.html

This plugin removes line numbers from file-view too in order to get one block to highlight.
This plugin removes line numbers from file-view too in order to get one block to highlight.


# License
Expand Down
112 changes: 0 additions & 112 deletions README.rdoc

This file was deleted.