Redmine Wiki HTML Utility
At work we use a project management system called Redmine. So far I have been very pleased with the ease of use, Git repository integration, issue tracking and wikis for all your projects.
Redmine offers a lot more than just Git integration, issue tracking and wikis. It is also open source! Visit the website for more information.
In Action
The Conflict
I had just finished adding some new styles to our company style.ui.css file. These new classes are to be used to create certain Web UI Components with ease. I started to document the use of these new UI components for my coworkers and took advantage of the textile formatting available in Redmine wikis, especially the syntax highlighting.
At the end, there was only one thing I REALLY wanted for this documentation, a demo (HTML/CSS). Now, I know I could have made a separate HTML file, host it on our server and then link to it from the wiki. That approach just seemed to lame and I really wanted this “demo” habit to stick with my fellow coworkers, so I needed something easy to use. Not being to familiar with wiki textiles I quickly abandoned my googling and started to create my own wiki macros. Here is what I came up with
The Plugin
The plugin can be found or cloned from my Github Repo. Let’s continue with how you would use the plugin.
Plugin Installation
Go to your Redmine plugin directory, for the bitnami Redmine VM it would be:
~$ cd /opt/bitnami/apps/redmine/vendors/plugins/
Then use git to down load the plugin into a folder.
~$ sudo git clone git://github.com/mexitek/redmine_wiki_html_util.git
Now, simply reset Redmine and you are done!
~$ sudo /etc/init.d/bitnami restart
Exposed Macros
Wiki HTML Utility exposes several macros to your Redmine Wikis:
- css_url() : allows you to “inject” an external stylesheet into the current wiki page
- js_url() : allows you to “inject” an external javascript file into the current wiki page
- html() : allows you to “inject” RAW HTML into the Wiki page
HTML()
Embeds RAW HTML.
{{html(
<ul>
<li>option 1</li>
<li>option 2</li>
<li>option 3</li>
</ul>
)}}
If you use HTML like the example above, the wiki will convert all newlines with <br>. If you know of a way to access the unfiltered text let me know.
CSS_URL()
This injects an external CSS file into the DOM (current wiki page). Notice the single quotes around the URL, this is very important.
{{css_url('http://www.domain.com/css/styles.ui.css')}}
JS_URL()
This injects an external JS file into the DOM (current wiki page). Notice the single quotes around the URL, this is very important.
{{js_url('http://www.domain.com/js/widget.js')}}
Conclusion
At the end of the day, you can inject JQuery and your CSS file into a wiki page and show off your awesome widgets! Live demos on a freaking wiki page! The possibilities are endless, kinda.
See the code on Github.com
-
Steven
-
http://www.arlocarreon.com Arlo Carreon
-
Jjreina
-
http://www.arlocarreon.com Arlo Carreon
-
Jjreina
-
William Rosa
-
William Rosa
-
William Rosa
-
Javi
-
http://www.arlocarreon.com Arlo Carreon
-
http://www.arlocarreon.com Arlo Carreon
-
Franco
-
Franco
-
http://twitter.com/framandaniarivo Frédéric RAMANDA.
-
Charles
-
Franco
-
DrP
-
Kartik
-
Franco
-
Franco
-
Franco
-
Adam
-
Adam
-
Franco
-
Giovanni Juanes
-
http://www.arlocarreon.com Arlo Carreon
-
Chuvy
-
Chuvy
-
DevMan
