summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-22 19:40:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-22 19:40:47 +0000
commit5564dfbbd5a31362fde86f27ac8beccd1661d6f8 (patch)
tree8a622876dd84409112a3d794f9c92b48aaf4d7bf
parenta17b62b455188208dccd38b312fb40d39c515757 (diff)
downloadredmine-5564dfbbd5a31362fde86f27ac8beccd1661d6f8.tar.gz
redmine-5564dfbbd5a31362fde86f27ac8beccd1661d6f8.zip
TOC rendered as an unordered list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1693 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/wiki/export.rhtml4
-rw-r--r--lib/redmine/wiki_formatting.rb6
-rw-r--r--public/stylesheets/application.css20
3 files changed, 17 insertions, 13 deletions
diff --git a/app/views/wiki/export.rhtml b/app/views/wiki/export.rhtml
index 1ab5c13e4..94b4e6f0d 100644
--- a/app/views/wiki/export.rhtml
+++ b/app/views/wiki/export.rhtml
@@ -6,6 +6,10 @@
<style>
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
+ul.toc { padding: 4px; margin-left: 0; }
+ul.toc li { list-style-type:none; }
+ul.toc li.heading2 { margin-left: 1em; }
+ul.toc li.heading3 { margin-left: 2em; }
</style>
</head>
<body>
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 952f636d3..11ec6803a 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -81,16 +81,16 @@ module Redmine
div_class = 'toc'
div_class << ' right' if $1 == '>'
div_class << ' left' if $1 == '<'
- out = "<div class=\"#{div_class}\">"
+ out = "<ul class=\"#{div_class}\">"
@toc.each_with_index do |heading, index|
# remove wiki links from the item
toc_item = heading.last.gsub(/(\[\[|\]\])/, '')
# remove styles
# eg. %{color:red}Triggers% => Triggers
toc_item.gsub! %r[%\{[^\}]*\}([^%]+)%], '\\1'
- out << "<a href=\"##{index+1}\" class=\"heading#{heading.first}\">#{toc_item}</a>"
+ out << "<li class=\"heading#{heading.first}\"><a href=\"##{index+1}\">#{toc_item}</a></li>\n"
end
- out << '</div>'
+ out << '</ul>'
out
end
end
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 018c71732..9ae4d1595 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -461,31 +461,31 @@ div.wiki pre {
overflow-x: auto;
}
-div.wiki div.toc {
+div.wiki ul.toc {
background-color: #ffffdd;
border: 1px solid #e4e4e4;
padding: 4px;
line-height: 1.2em;
margin-bottom: 12px;
margin-right: 12px;
+ margin-left: 0;
display: table
}
-* html div.wiki div.toc { width: 50%; } /* IE6 doesn't autosize div */
+* html div.wiki ul.toc { width: 50%; } /* IE6 doesn't autosize div */
-div.wiki div.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; }
-div.wiki div.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; }
+div.wiki ul.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; }
+div.wiki ul.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; }
+div.wiki ul.toc li { list-style-type:none;}
+div.wiki ul.toc li.heading2 { margin-left: 6px; }
+div.wiki ul.toc li.heading3 { margin-left: 12px; font-size: 0.8em; }
-div.wiki div.toc a {
- display: block;
+div.wiki ul.toc a {
font-size: 0.9em;
font-weight: normal;
text-decoration: none;
color: #606060;
}
-div.wiki div.toc a:hover { color: #c61a1a; text-decoration: underline;}
-
-div.wiki div.toc a.heading2 { margin-left: 6px; }
-div.wiki div.toc a.heading3 { margin-left: 12px; font-size: 0.8em; }
+div.wiki ul.toc a:hover { color: #c61a1a; text-decoration: underline;}
/***** My page layout *****/
.block-receiver {