From ef6f077ab441b37ebc21c16a424f5f76efe35c16 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 13 May 2016 14:12:03 +0000 Subject: [PATCH] This is a redmine plugin for supporting Markdown as a wiki format. This plugin use Redcarpet which is GitHub's markdown wiki formatter. Redcarpet is extreme fast and compatible GitHub's Wiki. They are advantage from Redmine Markdown Formatter and Redmine Markdown Extra Formatter. This code is originally Redmine Markdown Formatter and Redmine reStructuredtext Formatter. I appreciate these guys. WWW: https://github.com/alminium/redmine_redcarpet_formatter --- www/Makefile | 1 + www/redmine-redcarpet_formatter/Makefile | 59 +++++++++++++++++++ www/redmine-redcarpet_formatter/distinfo | 2 + .../files/patch-Gemfile | 6 ++ .../files/patch-init.rb | 21 +++++++ ...ine_wiki__formatting_markdown_formatter.rb | 11 ++++ ...edmine_wiki__formatting_markdown_helper.rb | 11 ++++ www/redmine-redcarpet_formatter/pkg-descr | 8 +++ 8 files changed, 119 insertions(+) create mode 100644 www/redmine-redcarpet_formatter/Makefile create mode 100644 www/redmine-redcarpet_formatter/distinfo create mode 100644 www/redmine-redcarpet_formatter/files/patch-Gemfile create mode 100644 www/redmine-redcarpet_formatter/files/patch-init.rb create mode 100644 www/redmine-redcarpet_formatter/files/patch-lib_redmine_wiki__formatting_markdown_formatter.rb create mode 100644 www/redmine-redcarpet_formatter/files/patch-lib_redmine_wiki__formatting_markdown_helper.rb create mode 100644 www/redmine-redcarpet_formatter/pkg-descr diff --git a/www/Makefile b/www/Makefile index 37f2b4cb7870..eceff473603c 100644 --- a/www/Makefile +++ b/www/Makefile @@ -1835,6 +1835,7 @@ SUBDIR += redmine-graphs SUBDIR += redmine-http-auth SUBDIR += redmine-qa_contact + SUBDIR += redmine-redcarpet_formatter SUBDIR += redmine-sidebar_hide SUBDIR += redmine-stuff_to_do SUBDIR += redmine-wiki_notes diff --git a/www/redmine-redcarpet_formatter/Makefile b/www/redmine-redcarpet_formatter/Makefile new file mode 100644 index 000000000000..48833bdc7a26 --- /dev/null +++ b/www/redmine-redcarpet_formatter/Makefile @@ -0,0 +1,59 @@ +# Created by: Mark Felder +# $FreeBSD$ + +PORTNAME= redcarpet_formatter +PORTVERSION= 2.0.1 +DISTVERSIONPREFIX=v +CATEGORIES= www +PKGNAMEPREFIX= redmine- + +MAINTAINER= feld@FreeBSD.org +COMMENT= Redmine plugin to support Markdown + +LICENSE= GPLv2 + +NO_ARCH= yes + +USE_GITHUB= yes +GH_ACCOUNT= alminium +GH_PROJECT= redmine_redcarpet_formatter + +RUN_DEPENDS+= redmine>=2.0:www/redmine +RUN_DEPENDS+= rubygem-redcarpet>0:textproc/rubygem-redcarpet + +REDMINE_PLUGIN_NAME= redmine_${PORTNAME} + +USE_RUBY= yes +.if !defined(PLIST) +PLIST= ${WRKDIR}/PLIST +_GEN_PLIST= YesPlease +.endif + +WWWDIR?= ${PREFIX}/www/redmine +WWWDIR_REL= ${WWWDIR:S|^${PREFIX}/||} + +.if ${WWWDIR_REL} == ${WWWDIR} +IGNORE= WWWDIR is not a child of PREFIX (${PREFIX}) +.endif + +.if !defined(do-build) +do-build: redmine-plugin-plist + @${DO_NADA} +.endif + +redmine-plugin-plist: +.if defined(_GEN_PLIST) + cd ${WRKSRC} && ${FIND} . -type f | ${GREP} -v '\.orig$$' | ${SED} -e's|^\.|${WWWDIR_REL}/plugins/${REDMINE_PLUGIN_NAME}|' >> ${PLIST} + cd ${WRKSRC} && ${FIND} -d . -empty -type d | ${SED} -e's|^\.|@dir ${WWWDIR_REL}/plugins/${REDMINE_PLUGIN_NAME}|' >> ${PLIST} +.else + @${DO_NADA} +.endif + +post-patch: + (cd ${WRKSRC}/lib/redmine/wiki_formatting && ${MV} markdown redcarpet_markdown) + +do-install: + ${MKDIR} "${STAGEDIR}${WWWDIR}/plugins/${REDMINE_PLUGIN_NAME}" + ${TAR} -C "${WRKSRC}" -cf - --exclude '*.orig' . | ${TAR} -C "${STAGEDIR}${WWWDIR}/plugins/${REDMINE_PLUGIN_NAME}" -xf - + +.include diff --git a/www/redmine-redcarpet_formatter/distinfo b/www/redmine-redcarpet_formatter/distinfo new file mode 100644 index 000000000000..ad27a82b1ecd --- /dev/null +++ b/www/redmine-redcarpet_formatter/distinfo @@ -0,0 +1,2 @@ +SHA256 (alminium-redmine_redcarpet_formatter-v2.0.1_GH0.tar.gz) = 84fddbbfc2b15fc3336ca5a6f645c52cb19586706a106d1a914b354b7bc83dee +SIZE (alminium-redmine_redcarpet_formatter-v2.0.1_GH0.tar.gz) = 11116 diff --git a/www/redmine-redcarpet_formatter/files/patch-Gemfile b/www/redmine-redcarpet_formatter/files/patch-Gemfile new file mode 100644 index 000000000000..d638f75b9669 --- /dev/null +++ b/www/redmine-redcarpet_formatter/files/patch-Gemfile @@ -0,0 +1,6 @@ +--- Gemfile.orig 2016-05-13 13:43:53 UTC ++++ Gemfile +@@ -1,3 +0,0 @@ +-source :rubygems +- +-gem "redcarpet" diff --git a/www/redmine-redcarpet_formatter/files/patch-init.rb b/www/redmine-redcarpet_formatter/files/patch-init.rb new file mode 100644 index 000000000000..16b6377c4372 --- /dev/null +++ b/www/redmine-redcarpet_formatter/files/patch-init.rb @@ -0,0 +1,21 @@ +--- init.rb.orig 2016-05-13 13:44:03 UTC ++++ init.rb +@@ -1,8 +1,8 @@ + # Redmine Redcarpet formatter + + require 'redmine' +-require 'redmine/wiki_formatting/markdown/formatter' +-require 'redmine/wiki_formatting/markdown/helper' ++require 'redmine/wiki_formatting/redcarpet_markdown/formatter' ++require 'redmine/wiki_formatting/redcarpet_markdown/helper' + + + Redmine::Plugin.register :redmine_redcarpet_formatter do +@@ -11,6 +11,6 @@ Redmine::Plugin.register :redmine_redcar + description 'Markdown wiki formatting by Redcarpet for Redmine' + version '2.0.1' + +- wiki_format_provider 'markdown', Redmine::WikiFormatting::Markdown::Formatter, Redmine::WikiFormatting::Markdown::Helper ++ wiki_format_provider 'redcarpet_markdown', Redmine::WikiFormatting::RedcarpetMarkdown::Formatter, Redmine::WikiFormatting::RedcarpetMarkdown::Helper + + end diff --git a/www/redmine-redcarpet_formatter/files/patch-lib_redmine_wiki__formatting_markdown_formatter.rb b/www/redmine-redcarpet_formatter/files/patch-lib_redmine_wiki__formatting_markdown_formatter.rb new file mode 100644 index 000000000000..44eed180a4b2 --- /dev/null +++ b/www/redmine-redcarpet_formatter/files/patch-lib_redmine_wiki__formatting_markdown_formatter.rb @@ -0,0 +1,11 @@ +--- lib/redmine/wiki_formatting/markdown/formatter.rb.orig 2016-05-13 13:44:58 UTC ++++ lib/redmine/wiki_formatting/markdown/formatter.rb +@@ -20,7 +20,7 @@ end + + module Redmine + module WikiFormatting +- module Markdown ++ module RedcarpetMarkdown + class Formatter + # include ActionView::Helpers::TagHelper + diff --git a/www/redmine-redcarpet_formatter/files/patch-lib_redmine_wiki__formatting_markdown_helper.rb b/www/redmine-redcarpet_formatter/files/patch-lib_redmine_wiki__formatting_markdown_helper.rb new file mode 100644 index 000000000000..1559fb2f4484 --- /dev/null +++ b/www/redmine-redcarpet_formatter/files/patch-lib_redmine_wiki__formatting_markdown_helper.rb @@ -0,0 +1,11 @@ +--- lib/redmine/wiki_formatting/markdown/helper.rb.orig 2016-05-13 13:45:22 UTC ++++ lib/redmine/wiki_formatting/markdown/helper.rb +@@ -1,7 +1,7 @@ + module Redmine + module WikiFormatting + +- module Markdown ++ module RedcarpetMarkdown + module Helper + unloadable + diff --git a/www/redmine-redcarpet_formatter/pkg-descr b/www/redmine-redcarpet_formatter/pkg-descr new file mode 100644 index 000000000000..4f0d819f4e50 --- /dev/null +++ b/www/redmine-redcarpet_formatter/pkg-descr @@ -0,0 +1,8 @@ +This is a redmine plugin for supporting Markdown as a wiki format. This +plugin use Redcarpet which is GitHub's markdown wiki formatter. +Redcarpet is extreme fast and compatible GitHub's Wiki. They are +advantage from Redmine Markdown Formatter and Redmine Markdown Extra +Formatter. This code is originally Redmine Markdown Formatter and +Redmine reStructuredtext Formatter. I appreciate these guys. + +WWW: https://github.com/alminium/redmine_redcarpet_formatter