プロジェクト

全般

プロフィール

Vote #64044

未完了

Customizable "protocols" to generate external links

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Wiki_1
対象バージョン:
-
開始日:
2008/10/24
期日:
進捗率:

0%

予定工数:
category_id:
1
version_id:
0
issue_org_id:
2084
author_id:
2481
assigned_to_id:
0
comments:
2
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Allows to define "prototypes" along with an URL prefix, so it will be easy in markup to reference external resource without needing a copy/paste of a full URL

Example with proto='mywiki' ; URL prefix=''http://wiki.company.com/display/space/' :

markup : "Check This":mywiki:somewikipage
formatted into : Check This

Other examples :

"Great language":wp:Ruby_(Programing_Language)
Great language

:wp:Redmine
Redmine

note: also same feature asked for CustomFields


journals

see also #2083
--------------------------------------------------------------------------------
For info : I've currently hardcoded such feature by adding a method in wiki_formatting.rb, but it's not very pretty ...
<pre>
#-- Erwan Ducroquet 2008-10-23 generate links depending on proto
def inline_specific_link_do(all, start, proto, url, title)
case proto
when 'stp'
"#{start}<a class='external' href='http://wiki.fr.world.socgen/display/STP/#{url}'>#{title}</a>"
when 'ccl'
"#{start}<a class='external' href='http://srvparstp20.fr.world.socgen/cc/view,label,#{url}'>#{title}</a>"
when 'wp'
"#{start}<a class='external' href='http://en.wikipedia.org/wiki/#{url}'>#{title}</a>"
when 'google'
"#{start}<a class='external' href='http://www.google.com/search?q=#{url}'>#{title}</a>"
when 'file'
"#{start}<a class='external' href='file://#{url}'>#{title}</a>"
else
all
end
end

#-- Erwan Ducroquet 2008-10-23 add own way to handle specific URL prototypes : STP wiki links, files, ClearCase source, Rules, ext Reviews
#-- format is :repository:resource or "title":repository:resource
def inline_specific_link(text)
text.gsub!(/\"([^\"\n]+)\"\:([a-z]+)\:([\w\_\/\\\:\-\+\(\)]+)/) do
inline_specific_link_do( $&, '', $2, $3, $1)
end
text.gsub!(/\:([a-z]+)\:([\w\_\/\\\:\-\+\(\)]+)/) do
inline_specific_link_do( $&, '', $1, $2, $2)
end
end
</pre>
--------------------------------------------------------------------------------


related_issues

relates,Closed,2083,CustomField of type "external-link-to" with configurable URL prefix
relates,New,2953,application launch URLs not rendered as link

Admin Redmine さんがほぼ2年前に更新

  • カテゴリWiki_1 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0