From 96d610553e5fdaabc923835ab1f194070ddb4477 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Fri, 6 Feb 2009 01:57:02 +0000 Subject: Merge docrails along with the new guides and guides generation code --- .../guides/files/javascripts/code_highlighter.js | 188 +++++++++ railties/guides/files/javascripts/guides.js | 8 + railties/guides/files/javascripts/highlighters.js | 90 +++++ railties/guides/files/stylesheets/main.css | 436 +++++++++++++++++++++ railties/guides/files/stylesheets/print.css | 52 +++ railties/guides/files/stylesheets/reset.css | 43 ++ railties/guides/files/stylesheets/style.css | 13 + railties/guides/files/stylesheets/syntax.css | 31 ++ 8 files changed, 861 insertions(+) create mode 100755 railties/guides/files/javascripts/code_highlighter.js create mode 100755 railties/guides/files/javascripts/guides.js create mode 100644 railties/guides/files/javascripts/highlighters.js create mode 100644 railties/guides/files/stylesheets/main.css create mode 100755 railties/guides/files/stylesheets/print.css create mode 100755 railties/guides/files/stylesheets/reset.css create mode 100755 railties/guides/files/stylesheets/style.css create mode 100644 railties/guides/files/stylesheets/syntax.css (limited to 'railties/guides/files') diff --git a/railties/guides/files/javascripts/code_highlighter.js b/railties/guides/files/javascripts/code_highlighter.js new file mode 100755 index 0000000000..a234ba888c --- /dev/null +++ b/railties/guides/files/javascripts/code_highlighter.js @@ -0,0 +1,188 @@ +/* Unobtrustive Code Highlighter By Dan Webb 11/2005 + Version: 0.4 + + Usage: + Add a script tag for this script and any stylesets you need to use + to the page in question, add correct class names to CODE elements, + define CSS styles for elements. That's it! + + Known to work on: + IE 5.5+ PC + Firefox/Mozilla PC/Mac + Opera 7.23 + PC + Safari 2 + + Known to degrade gracefully on: + IE5.0 PC + + Note: IE5.0 fails due to the use of lookahead in some stylesets. To avoid script errors + in older browsers use expressions that use lookahead in string format when defining stylesets. + + This script is inspired by star-light by entirely cunning Dean Edwards + http://dean.edwards.name/star-light/. +*/ + +// replace callback support for safari. +if ("a".replace(/a/, function() {return "b"}) != "b") (function(){ + var default_replace = String.prototype.replace; + String.prototype.replace = function(search,replace){ + // replace is not function + if(typeof replace != "function"){ + return default_replace.apply(this,arguments) + } + var str = "" + this; + var callback = replace; + // search string is not RegExp + if(!(search instanceof RegExp)){ + var idx = str.indexOf(search); + return ( + idx == -1 ? str : + default_replace.apply(str,[search,callback(search, idx, str)]) + ) + } + var reg = search; + var result = []; + var lastidx = reg.lastIndex; + var re; + while((re = reg.exec(str)) != null){ + var idx = re.index; + var args = re.concat(idx, str); + result.push( + str.slice(lastidx,idx), + callback.apply(null,args).toString() + ); + if(!reg.global){ + lastidx += RegExp.lastMatch.length; + break + }else{ + lastidx = reg.lastIndex; + } + } + result.push(str.slice(lastidx)); + return result.join("") + } +})(); + +var CodeHighlighter = { styleSets : new Array }; + +CodeHighlighter.addStyle = function(name, rules) { + // using push test to disallow older browsers from adding styleSets + if ([].push) this.styleSets.push({ + name : name, + rules : rules, + ignoreCase : arguments[2] || false + }) + + function setEvent() { + // set highlighter to run on load (use LowPro if present) + if (typeof Event != 'undefined' && typeof Event.onReady == 'function') + return Event.onReady(CodeHighlighter.init.bind(CodeHighlighter)); + + var old = window.onload; + + if (typeof window.onload != 'function') { + window.onload = function() { CodeHighlighter.init() }; + } else { + window.onload = function() { + old(); + CodeHighlighter.init(); + } + } + } + + // only set the event when the first style is added + if (this.styleSets.length==1) setEvent(); +} + +CodeHighlighter.init = function() { + if (!document.getElementsByTagName) return; + if ("a".replace(/a/, function() {return "b"}) != "b") return; // throw out Safari versions that don't support replace function + // throw out older browsers + + var codeEls = document.getElementsByTagName("CODE"); + // collect array of all pre elements + codeEls.filter = function(f) { + var a = new Array; + for (var i = 0; i < this.length; i++) if (f(this[i])) a[a.length] = this[i]; + return a; + } + + var rules = new Array; + rules.toString = function() { + // joins regexes into one big parallel regex + var exps = new Array; + for (var i = 0; i < this.length; i++) exps.push(this[i].exp); + return exps.join("|"); + } + + function addRule(className, rule) { + // add a replace rule + var exp = (typeof rule.exp != "string")?String(rule.exp).substr(1, String(rule.exp).length-2):rule.exp; + // converts regex rules to strings and chops of the slashes + rules.push({ + className : className, + exp : "(" + exp + ")", + length : (exp.match(/(^|[^\\])\([^?]/g) || "").length + 1, // number of subexps in rule + replacement : rule.replacement || null + }); + } + + function parse(text, ignoreCase) { + // main text parsing and replacement + return text.replace(new RegExp(rules, (ignoreCase)?"gi":"g"), function() { + var i = 0, j = 1, rule; + while (rule = rules[i++]) { + if (arguments[j]) { + // if no custom replacement defined do the simple replacement + if (!rule.replacement) return "" + arguments[0] + ""; + else { + // replace $0 with the className then do normal replaces + var str = rule.replacement.replace("$0", rule.className); + for (var k = 1; k <= rule.length - 1; k++) str = str.replace("$" + k, arguments[j + k]); + return str; + } + } else j+= rule.length; + } + }); + } + + function highlightCode(styleSet) { + // clear rules array + var parsed, clsRx = new RegExp("(\\s|^)" + styleSet.name + "(\\s|$)"); + rules.length = 0; + + // get stylable elements by filtering out all code elements without the correct className + var stylableEls = codeEls.filter(function(item) { return clsRx.test(item.className) }); + + // add style rules to parser + for (var className in styleSet.rules) addRule(className, styleSet.rules[className]); + + + // replace for all elements + for (var i = 0; i < stylableEls.length; i++) { + // EVIL hack to fix IE whitespace badness if it's inside a
+			if (/MSIE/.test(navigator.appVersion) && stylableEls[i].parentNode.nodeName == 'PRE') {
+				stylableEls[i] = stylableEls[i].parentNode;
+
+				parsed = stylableEls[i].innerHTML.replace(/(]*>)([^<]*)<\/code>/i, function() {
+					return arguments[1] + parse(arguments[2], styleSet.ignoreCase) + ""
+				});
+				parsed = parsed.replace(/\n( *)/g, function() {
+					var spaces = "";
+					for (var i = 0; i < arguments[1].length; i++) spaces+= " ";
+					return "\n" + spaces;
+				});
+				parsed = parsed.replace(/\t/g, "    ");
+				parsed = parsed.replace(/\n(<\/\w+>)?/g, "
$1").replace(/
[\n\r\s]*
/g, "


"); + + } else parsed = parse(stylableEls[i].innerHTML, styleSet.ignoreCase); + + stylableEls[i].innerHTML = parsed; + } + } + + // run highlighter on all stylesets + for (var i=0; i < this.styleSets.length; i++) { + highlightCode(this.styleSets[i]); + } +} \ No newline at end of file diff --git a/railties/guides/files/javascripts/guides.js b/railties/guides/files/javascripts/guides.js new file mode 100755 index 0000000000..81fc07e799 --- /dev/null +++ b/railties/guides/files/javascripts/guides.js @@ -0,0 +1,8 @@ +function guideMenu(){ + + if (document.getElementById('guides').style.display == "none") { + document.getElementById('guides').style.display = "block"; + } else { + document.getElementById('guides').style.display = "none"; + } +} diff --git a/railties/guides/files/javascripts/highlighters.js b/railties/guides/files/javascripts/highlighters.js new file mode 100644 index 0000000000..4f5f0779d7 --- /dev/null +++ b/railties/guides/files/javascripts/highlighters.js @@ -0,0 +1,90 @@ +CodeHighlighter.addStyle("css", { + comment : { + exp : /\/\*[^*]*\*+([^\/][^*]*\*+)*\// + }, + keywords : { + exp : /@\w[\w\s]*/ + }, + selectors : { + exp : "([\\w-:\\[.#][^{};>]*)(?={)" + }, + properties : { + exp : "([\\w-]+)(?=\\s*:)" + }, + units : { + exp : /([0-9])(em|en|px|%|pt)\b/, + replacement : "$1$2" + }, + urls : { + exp : /url\([^\)]*\)/ + } + }); + +CodeHighlighter.addStyle("ruby",{ + comment : { + exp : /#[^\n]+/ + }, + brackets : { + exp : /\(|\)/ + }, + string : { + exp : /'[^']*'|"[^"]*"/ + }, + keywords : { + exp : /\b(do|end|self|class|def|if|module|yield|then|else|for|until|unless|while|elsif|case|when|break|retry|redo|rescue|require|raise)\b/ + }, + /* Added by Shelly Fisher (shelly@agileevolved.com) */ + symbol : { + exp : /([^:])(:[A-Za-z0-9_!?]+)/ + }, + ivar : { + exp : /\@[A-Za-z0-9_!?]+/ + } +}); + +CodeHighlighter.addStyle("html", { + comment : { + exp: /<!\s*(--([^-]|[\r\n]|-[^-])*--\s*)>/ + }, + tag : { + exp: /(<\/?)([a-zA-Z1-9]+\s?)/, + replacement: "$1$2" + }, + string : { + exp : /'[^']*'|"[^"]*"/ + }, + attribute : { + exp: /\b([a-zA-Z-:]+)(=)/, + replacement: "$1$2" + }, + doctype : { + exp: /<!DOCTYPE([^&]|&[^g]|&g[^t])*>/ + } +}); + +CodeHighlighter.addStyle("javascript",{ + comment : { + exp : /(\/\/[^\n]*(\n|$))|(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)/ + }, + brackets : { + exp : /\(|\)/ + }, + string : { + exp : /'[^']*'|"[^"]*"/ + }, + keywords : { + exp : /\b(arguments|break|case|continue|default|delete|do|else|false|for|function|if|in|instanceof|new|null|return|switch|this|true|typeof|var|void|while|with)\b/ + }, + global : { + exp : /\b(toString|valueOf|window|element|prototype|constructor|document|escape|unescape|parseInt|parseFloat|setTimeout|clearTimeout|setInterval|clearInterval|NaN|isNaN|Infinity)\b/ + } +}); + +CodeHighlighter.addStyle("yaml", { + keyword : { + exp : /\/\*[^*]*\*+([^\/][^*]*\*+)*\// + }, + value : { + exp : /@\w[\w\s]*/ + }, +}); diff --git a/railties/guides/files/stylesheets/main.css b/railties/guides/files/stylesheets/main.css new file mode 100644 index 0000000000..64243be945 --- /dev/null +++ b/railties/guides/files/stylesheets/main.css @@ -0,0 +1,436 @@ +/* Guides.rubyonrails.org */ +/* Main.css */ +/* Created January 30, 2009 */ +/* Modified January 31, 2009 +--------------------------------------- */ + +/* General +--------------------------------------- */ + +.left {float: left; margin-right: 1em;} +.right {float: right; margin-left: 1em;} +.small {font-size: smaller;} +.large {font-size: larger;} +.hide {display: none;} + +li ul, li ol { margin:0 1.5em; } +ul, ol { margin: 0 1.5em 1.5em 1.5em; } + +ul { list-style-type: disc; } +ol { list-style-type: decimal; } + +dl { margin: 0 0 1.5em 0; } +dl dt { font-weight: bold; } +dd { margin-left: 1.5em;} + +pre,code { margin: 1.5em 0; white-space: pre; } +pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height: 1.5; } + +abbr, acronym { border-bottom: 1px dotted #666; } +address { margin: 0 0 1.5em; font-style: italic; } +del { color:#666; } + +blockquote { margin: 1.5em; color: #666; font-style: italic; } +strong { font-weight: bold; } +em, dfn { font-style: italic; } +dfn { font-weight: bold; } +sup, sub { line-height: 0; } +p {margin: 0 0 1.5em;} + +label { font-weight: bold; } +fieldset { padding:1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; } +legend { font-weight: bold; font-size:1.2em; } + +input.text, input.title, +textarea, select { + margin:0.5em 0; + border:1px solid #bbb; +} + +table { + margin: 1em 0; + border: 1px solid #ddd; + background: #f4f4f4; + border-spacing: 0; +} + + table th, table td { + padding: 0.25em; + border-right: 1px dotted #e0e0e0; + border-bottom: 1px dotted #e0e0e0; + } + + table th:last-child, table td:last-child { + border-right: none; + } + + table th { + border-bottom: 1px solid #ddd; + background: #f0f0f0; + font-weight: bold; + } + + table td { + } + + table tt { + padding: 0.1em; + } + + +/* Structure and Layout +--------------------------------------- */ + +body { + text-align: center; + font-family: Helvetica, Arial, sans-serif; + font-size: 87.5%; + line-height: 1.5em; + background: #222; + color: #999; + } + +.wrapper { + text-align: left; + margin: 0 auto; + width: 69em; + } + +#topNav { + padding: 1em 0; + color: #565656; +} + +#header { + background: #c52f24 url(../../images/header_tile.gif) repeat-x; + color: #FFF; + padding: 1.5em 0; + position: relative; + z-index: 99; + } + +#feature { + background: #d5e9f6 url(../../images/feature_tile.gif) repeat-x; + color: #333; + padding: 0.5em 0 1.5em; +} + +#container { + background: #FFF; + color: #333; + padding: 0.5em 0 1.5em 0; + } + +#mainCol { + width: 45em; + margin-left: 2em; + } + +#subCol { + position: absolute; + z-index: 0; + top: 0; + right: 0; + background: #FFF; + padding: 1em 1.5em 1em 1.25em; + width: 17em; + font-size: 0.9285em; + line-height: 1.3846em; + } + +#extraCol {display: none;} + +#footer { + padding: 2em 0; + background: url(../../images/footer_tile.gif) repeat-x; + } +#footer .wrapper { + padding-left: 2em; + width: 67em; +} + +#header .wrapper, #topNav .wrapper, #feature .wrapper {padding-left: 1em; width: 68em;} +#feature .wrapper {width: 45em; padding-right: 23em; position: relative; z-index: 0;} + +/* Links +--------------------------------------- */ + +a, a:link, a:visited { + color: #ee3f3f; + text-decoration: underline; + } + +#mainCol a, #subCol a {color: #980905;} + + +/* Navigation +--------------------------------------- */ + +.nav {margin: 0; padding: 0;} +.nav li {display: inline; list-style: none;} + +#header .nav { + float: right; + margin-top: 1.5em; + font-size: 1.2857em; +} + +#header .nav li {margin: 0 0 0 0.5em;} +#header .nav a {color: #FFF; text-decoration: none;} +#header .nav a:hover {text-decoration: underline;} + +#header .nav .index { + padding: 0.5em 1.5em; + border-radius: 1em; + -webkit-border-radius: 1em; + -moz-border-radius: 1em; + background: #980905; + position: relative; +} + +#header .nav .index a { + background: #980905 url(../../images/nav_arrow.gif) no-repeat right top; + padding-right: 1em; + position: relative; + z-index: 15; + padding-bottom: 0.125em; +} +#header .nav .index:hover a, #header .nav .index a:hover {background-position: right -81px;} + +#guides { + width: 27em; + display: block; + background: #980905; + border-radius: 1em; + -webkit-border-radius: 1em; + -moz-border-radius: 1em; + -webkit-box-shadow: 0.25em 0.25em 1em rgba(0,0,0,0.25); + -moz-box-shadow: rgba(0,0,0,0.25) 0.25em 0.25em 1em; + color: #f1938c; + padding: 1.5em 2em; + position: absolute; + z-index: 10; + top: -0.25em; + right: 0; + padding-top: 2em; +} + +#guides dt, #guides dd { + font-weight: normal; + font-size: 0.722em; + margin: 0; + padding: 0; +} +#guides dt {padding:0; margin: 0.5em 0 0;} +#guides a {color: #FFF; background: none !important;} +#guides .L, #guides .R {float: left; width: 50%; margin: 0; padding: 0;} +#guides .R {float: right;} +#guides hr { + display: block; + border: none; + height: 1px; + color: #f1938c; + background: #f1938c; +} + +/* Headings +--------------------------------------- */ + +h1 { + font-size: 2.5em; + line-height: 1em; + margin: 0.6em 0 .2em; + font-weight: bold; + } + +h2 { + font-size: 2.1428em; + line-height: 1em; + margin: 0.7em 0 .2333em; + font-weight: bold; + } + +h3 { + font-size: 1.7142em; + line-height: 1.286em; + margin: 0.875em 0 0.2916em; + font-weight: bold; + } + +h4 { + font-size: 1.2857em; + line-height: 1.2em; + margin: 1.6667em 0 .3887em; + font-weight: bold; + } + +h5 { + font-size: 1em; + line-height: 1.5em; + margin: 1em 0 .5em; + font-weight: bold; +} + +h6 { + font-size: 1em; + line-height: 1.5em; + margin: 1em 0 .5em; + font-weight: normal; + } + +/* Content +--------------------------------------- */ + +.pic { + margin: 0 2em 2em 0; +} + +#topNav strong {color: #999; margin-right: 0.5em;} +#topNav strong a {color: #FFF;} + +#header h1 { + float: left; + background: url(../../images/ruby_guides_logo.gif) no-repeat; + width: 492px; + text-indent: -9999em; + margin: 0; + padding: 0; +} + +#header h1 a { + text-decoration: none; + display: block; + height: 77px; +} + +#feature p { + font-size: 1.2857em; + margin-bottom: 0.75em; +} + +#feature ul {margin-left: 0;} +#feature ul li { + list-style: none; + background: url(../../images/check_bullet.gif) no-repeat left 0.5em; + padding: 0.5em 1.75em 0.5em 1.75em; + font-size: 1.1428em; + font-weight: bold; +} + +#mainCol dd, #subCol dd { + padding: 0.25em 0 1em; + border-bottom: 1px solid #CCC; + margin-bottom: 1em; + margin-left: 0; + padding-left: 28px; +} + +#mainCol dt, #subCol dt { + font-size: 1.2857em; + padding: 0.125em 0 0.25em 28px; + margin-bottom: 0; + background: url(../../images/book_icon.gif) no-repeat left top; +} + +#mainCol dd.ticket, #subCol dd.ticket { + background: #fff9d8 url(../../images/tab_yellow.gif) no-repeat left top; + border: none; + padding: 1.25em 1em 1.25em 48px; + margin-left: 0; + margin-top: 0.25em; +} + +#mainCol dd.warning, #subCol dd.warning { + background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; + border: none; + padding: 1.25em 1.25em 1.25em 48px; + margin-left: 0; + margin-top: 0.25em; +} + +#subCol .chapters {color: #980905;} +#subCol .chapters a {font-weight: bold;} +#subCol .chapters ul a {font-weight: normal;} +#subCol .chapters li {margin-bottom: 0.75em;} +#subCol h3.chapter {margin-top: 0.25em;} +#subCol h3.chapter img {vertical-align: text-bottom;} +#subCol .chapters ul {margin-left: 0; margin-top: 0.5em;} +#subCol .chapters ul li { + list-style: none; + padding: 0 0 0 1em; + background: url(../../images/bullet.gif) no-repeat left 0.45em; + margin-left: 0; + font-size: 1em; + font-weight: normal; +} + +tt { + background: #EEE; + border: 1px solid #CCC; + padding: 0.25em 0.5em; + font-family: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace; +} + +code, pre { + font-family: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace; + background: #EEE url(../../images/tab_grey.gif) no-repeat left top; + border: none; + padding: 0.25em 1em 0.5em 48px; + margin-left: 0; + margin-top: 0.25em; + display: block; +} + +.note { + background: #fff9d8 url(../../images/tab_note.gif) no-repeat left top; + border: none; + padding: 1em 1em 0.25em 48px; + margin-left: 0; + margin-top: 0.25em; +} + +.info { + background: #d5e9f6 url(../../images/tab_info.gif) no-repeat left top; + border: none; + padding: 1em 1em 0.25em 48px; + margin-left: 0; + margin-top: 0.25em; +} + +.warning { + background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; + border: none; + padding: 1em 1em 0.25em 48px; + margin-left: 0; + margin-top: 0.25em; +} + +.warning tt, .note tt, .info tt {border:none; background: none; padding: 0;} + +em.highlight { + background: #fffcdb; + padding: 0 0.25em; +} + +#mainCol ul li { + list-style:none; + background: url(../../images/grey_bullet.gif) no-repeat left 0.5em; + padding-left: 1em; + margin-left: 0; +} + +/* Clearing +--------------------------------------- */ + +.clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} +.clear { clear:both; } diff --git a/railties/guides/files/stylesheets/print.css b/railties/guides/files/stylesheets/print.css new file mode 100755 index 0000000000..98780ab029 --- /dev/null +++ b/railties/guides/files/stylesheets/print.css @@ -0,0 +1,52 @@ +/* Guides.rubyonrails.org */ +/* Print.css */ +/* Created January 30, 2009 */ +/* Modified January 31, 2009 +--------------------------------------- */ + +body, .wrapper, .note, .info, code, #topNav, .L, .R, #frame, #container, #header, #navigation, #footer, #feature, #mainCol, #subCol, #extraCol, .content {position: static; text-align: left; text-indent: 0; background: White; color: Black; border-color: Black; width: auto; height: auto; display: block; float: none; min-height: 0; margin: 0; padding: 0;} + +body { + background: #FFF; + font-size: 10pt !important; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + line-height: 1.5; + color: #000; + padding: 0 3%; + } + +.hide, .nav { + display: none !important; + } + +a:link, a:visited { + background: transparent; + font-weight: bold; + text-decoration: underline; + } + +hr { + background:#ccc; + color:#ccc; + width:100%; + height:2px; + margin:2em 0; + padding:0; + border:none; +} + +h1,h2,h3,h4,h5,h6 { font-family: "Helvetica Neue", Arial, "Lucida Grande", sans-serif; } +code { font:.9em "Courier New", Monaco, Courier, monospace; } + +img { float:left; margin:1.5em 1.5em 1.5em 0; } +a img { border:none; } + +blockquote { + margin:1.5em; + padding:1em; + font-style:italic; + font-size:.9em; +} + +.small { font-size: .9em; } +.large { font-size: 1.1em; } \ No newline at end of file diff --git a/railties/guides/files/stylesheets/reset.css b/railties/guides/files/stylesheets/reset.css new file mode 100755 index 0000000000..cd5f8e846e --- /dev/null +++ b/railties/guides/files/stylesheets/reset.css @@ -0,0 +1,43 @@ +/* Guides.rubyonrails.org */ +/* Reset.css */ +/* Created January 30, 2009 +--------------------------------------- */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-size: 100%; + background: transparent; +} + +body {line-height: 1; color: black; background: white;} +a img {border:none;} +ins {text-decoration: none;} +del {text-decoration: line-through;} + +:focus { + -moz-outline:0; + outline:0; + outline-offset:0; +} + +/* tables still need 'cellspacing="0"' in the markup */ +table {border-collapse: collapse; border-spacing: 0;} +caption, th, td {text-align: left; font-weight: normal;} + +blockquote, q {quotes: none;} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} \ No newline at end of file diff --git a/railties/guides/files/stylesheets/style.css b/railties/guides/files/stylesheets/style.css new file mode 100755 index 0000000000..89b2ab885a --- /dev/null +++ b/railties/guides/files/stylesheets/style.css @@ -0,0 +1,13 @@ +/* Guides.rubyonrails.org */ +/* Style.css */ +/* Created January 30, 2009 +--------------------------------------- */ + +/* +--------------------------------------- +Import advanced style sheet +--------------------------------------- +*/ + +@import url("reset.css"); +@import url("main.css"); diff --git a/railties/guides/files/stylesheets/syntax.css b/railties/guides/files/stylesheets/syntax.css new file mode 100644 index 0000000000..cf5df03494 --- /dev/null +++ b/railties/guides/files/stylesheets/syntax.css @@ -0,0 +1,31 @@ +.html .tag { + color : green; +} + +.html .doctype { + color: #708090; +} + +.erb .tag { + color : green; +} + +.erb .doctype { + color: #708090; +} + +.ruby .keywords { + color : red; +} + +.ruby .ivar { + color : blue; +} + +.ruby .comment { + color: #708090; +} + +.ruby .symbol { + color: green; +} \ No newline at end of file -- cgit v1.2.3 From 53cd102b39eb62567298430cbd94e40dd78d46a0 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Tue, 24 Feb 2009 12:29:25 +0000 Subject: Merge with docrails --- .../guides/files/javascripts/code_highlighter.js | 2 +- railties/guides/files/stylesheets/main.css | 675 +++++++++++++-------- railties/guides/files/stylesheets/print.css | 2 +- railties/guides/files/stylesheets/reset.css | 2 +- railties/guides/files/stylesheets/syntax.css | 2 +- 5 files changed, 412 insertions(+), 271 deletions(-) (limited to 'railties/guides/files') diff --git a/railties/guides/files/javascripts/code_highlighter.js b/railties/guides/files/javascripts/code_highlighter.js index a234ba888c..ce983dad52 100755 --- a/railties/guides/files/javascripts/code_highlighter.js +++ b/railties/guides/files/javascripts/code_highlighter.js @@ -185,4 +185,4 @@ CodeHighlighter.init = function() { for (var i=0; i < this.styleSets.length; i++) { highlightCode(this.styleSets[i]); } -} \ No newline at end of file +} diff --git a/railties/guides/files/stylesheets/main.css b/railties/guides/files/stylesheets/main.css index 64243be945..f8302505c5 100644 --- a/railties/guides/files/stylesheets/main.css +++ b/railties/guides/files/stylesheets/main.css @@ -7,416 +7,549 @@ /* General --------------------------------------- */ -.left {float: left; margin-right: 1em;} -.right {float: right; margin-left: 1em;} -.small {font-size: smaller;} -.large {font-size: larger;} -.hide {display: none;} +.left { + float: left; + margin-right: 1em; +} +.right { + float: right; + margin-left: 1em; +} +.small { + font-size: smaller; +} +.large { + font-size: larger; +} +.hide { + display: none; +} -li ul, li ol { margin:0 1.5em; } -ul, ol { margin: 0 1.5em 1.5em 1.5em; } +li ul, li ol { + margin: 0 1.5em; +} +ul, ol { + margin: 0 1.5em 1.5em 1.5em; +} -ul { list-style-type: disc; } -ol { list-style-type: decimal; } +ul { + list-style-type: disc; +} +ol { + list-style-type: decimal; +} -dl { margin: 0 0 1.5em 0; } -dl dt { font-weight: bold; } -dd { margin-left: 1.5em;} +dl { + margin: 0 0 1.5em 0; +} +dl dt { + font-weight: bold; +} +dd { + margin-left: 1.5em; +} -pre,code { margin: 1.5em 0; white-space: pre; } -pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height: 1.5; } +pre,code { + margin: 1.5em 0; + white-space: pre; +} +pre,code { + font: 1em 'andale mono', 'lucida console', monospace; + line-height: 1.5; +} -abbr, acronym { border-bottom: 1px dotted #666; } -address { margin: 0 0 1.5em; font-style: italic; } -del { color:#666; } +abbr, acronym { + border-bottom: 1px dotted #666; +} +address { + margin: 0 0 1.5em; + font-style: italic; +} +del { + color: #666; +} -blockquote { margin: 1.5em; color: #666; font-style: italic; } -strong { font-weight: bold; } -em, dfn { font-style: italic; } -dfn { font-weight: bold; } -sup, sub { line-height: 0; } -p {margin: 0 0 1.5em;} +blockquote { + margin: 1.5em; + color: #666; + font-style: italic; +} +strong { + font-weight: bold; +} +em, dfn { + font-style: italic; +} +dfn { + font-weight: bold; +} +sup, sub { + line-height: 0; +} +p { + margin: 0 0 1.5em; +} -label { font-weight: bold; } -fieldset { padding:1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; } -legend { font-weight: bold; font-size:1.2em; } +label { + font-weight: bold; +} +fieldset { + padding: 1.4em; + margin: 0 0 1.5em 0; + border: 1px solid #ccc; +} +legend { + font-weight: bold; + font-size: 1.2em; +} -input.text, input.title, -textarea, select { - margin:0.5em 0; - border:1px solid #bbb; +input.text, input.title, textarea, select { + margin: 0.5em 0em; + border: 1px solid #bbb; } table { - margin: 1em 0; - border: 1px solid #ddd; - background: #f4f4f4; - border-spacing: 0; + margin: 1em 0; + border: 1px solid #ddd; + background: #f4f4f4; + border-spacing: 0; } - table th, table td { +table th, table td { padding: 0.25em; border-right: 1px dotted #e0e0e0; border-bottom: 1px dotted #e0e0e0; - } +} - table th:last-child, table td:last-child { - border-right: none; - } +table th:last-child, table td:last-child { + border-right: none; +} - table th { +table th { border-bottom: 1px solid #ddd; background: #f0f0f0; font-weight: bold; - } - - table td { - } +} - table tt { +table tt { padding: 0.1em; - } +} /* Structure and Layout --------------------------------------- */ body { - text-align: center; - font-family: Helvetica, Arial, sans-serif; - font-size: 87.5%; - line-height: 1.5em; - background: #222; - color: #999; - } + text-align: center; + font-family: Helvetica, Arial, sans-serif; + font-size: 87.5%; + line-height: 1.5em; + background: #222; + color: #999; +} .wrapper { - text-align: left; - margin: 0 auto; - width: 69em; - } + text-align: left; + margin: 0 auto; + width: 69em; +} #topNav { - padding: 1em 0; - color: #565656; + padding: 1em 0; + color: #565656; } #header { - background: #c52f24 url(../../images/header_tile.gif) repeat-x; - color: #FFF; - padding: 1.5em 0; - position: relative; - z-index: 99; - } + background: #c52f24 url(../../images/header_tile.gif) repeat-x; + color: #FFF; + padding: 1.5em 0; + position: relative; + z-index: 99; +} #feature { - background: #d5e9f6 url(../../images/feature_tile.gif) repeat-x; - color: #333; - padding: 0.5em 0 1.5em; + background: #d5e9f6 url(../../images/feature_tile.gif) repeat-x; + color: #333; + padding: 0.5em 0 1.5em; } #container { - background: #FFF; - color: #333; - padding: 0.5em 0 1.5em 0; - } + background: #FFF; + color: #333; + padding: 0.5em 0 1.5em 0; +} #mainCol { - width: 45em; - margin-left: 2em; - } + width: 45em; + margin-left: 2em; +} #subCol { - position: absolute; - z-index: 0; - top: 0; - right: 0; - background: #FFF; - padding: 1em 1.5em 1em 1.25em; - width: 17em; - font-size: 0.9285em; - line-height: 1.3846em; - } - -#extraCol {display: none;} + position: absolute; + z-index: 0; + top: 0; + right: 0; + background: #FFF; + padding: 1em 1.5em 1em 1.25em; + width: 17em; + font-size: 0.9285em; + line-height: 1.3846em; +} + +#extraCol { + display: none; +} #footer { - padding: 2em 0; - background: url(../../images/footer_tile.gif) repeat-x; - } + padding: 2em 0; + background: url(../../images/footer_tile.gif) repeat-x; +} #footer .wrapper { - padding-left: 2em; - width: 67em; + padding-left: 2em; + width: 67em; } -#header .wrapper, #topNav .wrapper, #feature .wrapper {padding-left: 1em; width: 68em;} -#feature .wrapper {width: 45em; padding-right: 23em; position: relative; z-index: 0;} +#header .wrapper, #topNav .wrapper, #feature .wrapper { + padding-left: 1em; + width: 68em; +} +#feature .wrapper { + width: 45em; + padding-right: 23em; + position: relative; + z-index: 0; +} /* Links --------------------------------------- */ a, a:link, a:visited { - color: #ee3f3f; - text-decoration: underline; - } + color: #ee3f3f; + text-decoration: underline; +} -#mainCol a, #subCol a {color: #980905;} +#mainCol a, #subCol a { + color: #980905; +} /* Navigation --------------------------------------- */ -.nav {margin: 0; padding: 0;} -.nav li {display: inline; list-style: none;} +.nav { + margin: 0; + padding: 0; +} +.nav li { + display: inline; + list-style: none; +} #header .nav { - float: right; - margin-top: 1.5em; - font-size: 1.2857em; + float: right; + margin-top: 1.5em; + font-size: 1.2857em; } -#header .nav li {margin: 0 0 0 0.5em;} -#header .nav a {color: #FFF; text-decoration: none;} -#header .nav a:hover {text-decoration: underline;} +#header .nav li { + margin: 0 0 0 0.5em; +} +#header .nav a { + color: #FFF; + text-decoration: none; +} +#header .nav a:hover { + text-decoration: underline; +} #header .nav .index { - padding: 0.5em 1.5em; - border-radius: 1em; - -webkit-border-radius: 1em; - -moz-border-radius: 1em; - background: #980905; - position: relative; + padding: 0.5em 1.5em; + border-radius: 1em; + -webkit-border-radius: 1em; + -moz-border-radius: 1em; + background: #980905; + position: relative; } #header .nav .index a { - background: #980905 url(../../images/nav_arrow.gif) no-repeat right top; - padding-right: 1em; - position: relative; - z-index: 15; - padding-bottom: 0.125em; + background: #980905 url(../../images/nav_arrow.gif) no-repeat right top; + padding-right: 1em; + position: relative; + z-index: 15; + padding-bottom: 0.125em; +} +#header .nav .index:hover a, #header .nav .index a:hover { + background-position: right -81px; } -#header .nav .index:hover a, #header .nav .index a:hover {background-position: right -81px;} #guides { - width: 27em; - display: block; - background: #980905; - border-radius: 1em; - -webkit-border-radius: 1em; - -moz-border-radius: 1em; - -webkit-box-shadow: 0.25em 0.25em 1em rgba(0,0,0,0.25); - -moz-box-shadow: rgba(0,0,0,0.25) 0.25em 0.25em 1em; - color: #f1938c; - padding: 1.5em 2em; - position: absolute; - z-index: 10; - top: -0.25em; - right: 0; - padding-top: 2em; + width: 27em; + display: block; + background: #980905; + border-radius: 1em; + -webkit-border-radius: 1em; + -moz-border-radius: 1em; + -webkit-box-shadow: 0.25em 0.25em 1em rgba(0,0,0,0.25); + -moz-box-shadow: rgba(0,0,0,0.25) 0.25em 0.25em 1em; + color: #f1938c; + padding: 1.5em 2em; + position: absolute; + z-index: 10; + top: -0.25em; + right: 0; + padding-top: 2em; } #guides dt, #guides dd { - font-weight: normal; - font-size: 0.722em; - margin: 0; - padding: 0; -} -#guides dt {padding:0; margin: 0.5em 0 0;} -#guides a {color: #FFF; background: none !important;} -#guides .L, #guides .R {float: left; width: 50%; margin: 0; padding: 0;} -#guides .R {float: right;} + font-weight: normal; + font-size: 0.722em; + margin: 0; + padding: 0; +} +#guides dt { + padding: 0; + margin: 0.5em 0 0; +} +#guides a { + color: #FFF; + background: none !important; +} +#guides .L, #guides .R { + float: left; + width: 50%; + margin: 0; + padding: 0; +} +#guides .R { + float: right; +} #guides hr { - display: block; - border: none; - height: 1px; - color: #f1938c; - background: #f1938c; + display: block; + border: none; + height: 1px; + color: #f1938c; + background: #f1938c; } /* Headings --------------------------------------- */ h1 { - font-size: 2.5em; - line-height: 1em; - margin: 0.6em 0 .2em; - font-weight: bold; - } + font-size: 2.5em; + line-height: 1em; + margin: 0.6em 0 .2em; + font-weight: bold; +} h2 { - font-size: 2.1428em; - line-height: 1em; - margin: 0.7em 0 .2333em; - font-weight: bold; - } + font-size: 2.1428em; + line-height: 1em; + margin: 0.7em 0 .2333em; + font-weight: bold; +} h3 { - font-size: 1.7142em; - line-height: 1.286em; - margin: 0.875em 0 0.2916em; - font-weight: bold; - } + font-size: 1.7142em; + line-height: 1.286em; + margin: 0.875em 0 0.2916em; + font-weight: bold; +} h4 { - font-size: 1.2857em; - line-height: 1.2em; - margin: 1.6667em 0 .3887em; - font-weight: bold; - } + font-size: 1.2857em; + line-height: 1.2em; + margin: 1.6667em 0 .3887em; + font-weight: bold; +} h5 { - font-size: 1em; - line-height: 1.5em; - margin: 1em 0 .5em; - font-weight: bold; + font-size: 1em; + line-height: 1.5em; + margin: 1em 0 .5em; + font-weight: bold; } h6 { - font-size: 1em; - line-height: 1.5em; - margin: 1em 0 .5em; - font-weight: normal; - } + font-size: 1em; + line-height: 1.5em; + margin: 1em 0 .5em; + font-weight: normal; +} /* Content --------------------------------------- */ .pic { - margin: 0 2em 2em 0; + margin: 0 2em 2em 0; } -#topNav strong {color: #999; margin-right: 0.5em;} -#topNav strong a {color: #FFF;} +#topNav strong { + color: #999; + margin-right: 0.5em; +} +#topNav strong a { + color: #FFF; +} #header h1 { - float: left; - background: url(../../images/ruby_guides_logo.gif) no-repeat; - width: 492px; - text-indent: -9999em; - margin: 0; - padding: 0; + float: left; + background: url(../../images/ruby_guides_logo.gif) no-repeat; + width: 492px; + text-indent: -9999em; + margin: 0; + padding: 0; } #header h1 a { - text-decoration: none; - display: block; - height: 77px; + text-decoration: none; + display: block; + height: 77px; } #feature p { - font-size: 1.2857em; - margin-bottom: 0.75em; + font-size: 1.2857em; + margin-bottom: 0.75em; } -#feature ul {margin-left: 0;} +#feature ul { + margin-left: 0; +} #feature ul li { - list-style: none; - background: url(../../images/check_bullet.gif) no-repeat left 0.5em; - padding: 0.5em 1.75em 0.5em 1.75em; - font-size: 1.1428em; - font-weight: bold; + list-style: none; + background: url(../../images/check_bullet.gif) no-repeat left 0.5em; + padding: 0.5em 1.75em 0.5em 1.75em; + font-size: 1.1428em; + font-weight: bold; } #mainCol dd, #subCol dd { - padding: 0.25em 0 1em; - border-bottom: 1px solid #CCC; - margin-bottom: 1em; - margin-left: 0; - padding-left: 28px; + padding: 0.25em 0 1em; + border-bottom: 1px solid #CCC; + margin-bottom: 1em; + margin-left: 0; + padding-left: 28px; } #mainCol dt, #subCol dt { - font-size: 1.2857em; - padding: 0.125em 0 0.25em 28px; - margin-bottom: 0; - background: url(../../images/book_icon.gif) no-repeat left top; + font-size: 1.2857em; + padding: 0.125em 0 0.25em 28px; + margin-bottom: 0; + background: url(../../images/book_icon.gif) no-repeat left top; } #mainCol dd.ticket, #subCol dd.ticket { - background: #fff9d8 url(../../images/tab_yellow.gif) no-repeat left top; - border: none; - padding: 1.25em 1em 1.25em 48px; - margin-left: 0; - margin-top: 0.25em; + background: #fff9d8 url(../../images/tab_yellow.gif) no-repeat left top; + border: none; + padding: 1.25em 1em 1.25em 48px; + margin-left: 0; + margin-top: 0.25em; } #mainCol dd.warning, #subCol dd.warning { - background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; - border: none; - padding: 1.25em 1.25em 1.25em 48px; - margin-left: 0; - margin-top: 0.25em; -} - -#subCol .chapters {color: #980905;} -#subCol .chapters a {font-weight: bold;} -#subCol .chapters ul a {font-weight: normal;} -#subCol .chapters li {margin-bottom: 0.75em;} -#subCol h3.chapter {margin-top: 0.25em;} -#subCol h3.chapter img {vertical-align: text-bottom;} -#subCol .chapters ul {margin-left: 0; margin-top: 0.5em;} + background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; + border: none; + padding: 1.25em 1.25em 1.25em 48px; + margin-left: 0; + margin-top: 0.25em; +} + +#subCol .chapters { + color: #980905; +} +#subCol .chapters a { + font-weight: bold; +} +#subCol .chapters ul a { + font-weight: normal; +} +#subCol .chapters li { + margin-bottom: 0.75em; +} +#subCol h3.chapter { + margin-top: 0.25em; +} +#subCol h3.chapter img { + vertical-align: text-bottom; +} +#subCol .chapters ul { + margin-left: 0; + margin-top: 0.5em; +} #subCol .chapters ul li { - list-style: none; - padding: 0 0 0 1em; - background: url(../../images/bullet.gif) no-repeat left 0.45em; - margin-left: 0; - font-size: 1em; - font-weight: normal; + list-style: none; + padding: 0 0 0 1em; + background: url(../../images/bullet.gif) no-repeat left 0.45em; + margin-left: 0; + font-size: 1em; + font-weight: normal; +} +#subCol .chapters p { + font-size: 1em; } tt { - background: #EEE; - border: 1px solid #CCC; - padding: 0.25em 0.5em; - font-family: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace; + font-family: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace; } code, pre { - font-family: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace; - background: #EEE url(../../images/tab_grey.gif) no-repeat left top; - border: none; - padding: 0.25em 1em 0.5em 48px; - margin-left: 0; - margin-top: 0.25em; - display: block; + font-family: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace; + background: #EEE url(../../images/tab_grey.gif) no-repeat left top; + border: none; + padding: 0.25em 1em 0.5em 48px; + margin-left: 0; + margin-top: 0.25em; + display: block; + min-height: 45px; + overflow: auto; +} + +.info code, .info pre { + background-image: none; + background-color: #C5D9E6; + padding: 0.25em 1em; + min-height: 1px; } .note { - background: #fff9d8 url(../../images/tab_note.gif) no-repeat left top; - border: none; - padding: 1em 1em 0.25em 48px; - margin-left: 0; - margin-top: 0.25em; + background: #fff9d8 url(../../images/tab_note.gif) no-repeat left top; + border: none; + padding: 1em 1em 0.25em 48px; + margin-left: 0; + margin-top: 0.25em; } .info { - background: #d5e9f6 url(../../images/tab_info.gif) no-repeat left top; - border: none; - padding: 1em 1em 0.25em 48px; - margin-left: 0; - margin-top: 0.25em; + background: #d5e9f6 url(../../images/tab_info.gif) no-repeat left top; + border: none; + padding: 1em 1em 0.25em 48px; + margin-left: 0; + margin-top: 0.25em; } .warning { - background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; - border: none; - padding: 1em 1em 0.25em 48px; - margin-left: 0; - margin-top: 0.25em; + background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; + border: none; + padding: 1em 1em 0.25em 48px; + margin-left: 0; + margin-top: 0.25em; } -.warning tt, .note tt, .info tt {border:none; background: none; padding: 0;} +.warning tt, .note tt, .info tt { + border: none; + background: none; + padding: 0; +} em.highlight { - background: #fffcdb; - padding: 0 0.25em; + background: #fffcdb; + padding: 0 0.25em; } #mainCol ul li { - list-style:none; - background: url(../../images/grey_bullet.gif) no-repeat left 0.5em; - padding-left: 1em; - margin-left: 0; + list-style: none; + background: url(../../images/grey_bullet.gif) no-repeat left 0.5em; + padding-left: 1em; + margin-left: 0; } /* Clearing @@ -430,7 +563,15 @@ em.highlight { visibility: hidden; } -.clearfix {display: inline-block;} -* html .clearfix {height: 1%;} -.clearfix {display: block;} -.clear { clear:both; } +.clearfix { + display: inline-block; +} +* html .clearfix { + height: 1%; +} +.clearfix { + display: block; +} +.clear { + clear: both; +} diff --git a/railties/guides/files/stylesheets/print.css b/railties/guides/files/stylesheets/print.css index 98780ab029..628da105d4 100755 --- a/railties/guides/files/stylesheets/print.css +++ b/railties/guides/files/stylesheets/print.css @@ -49,4 +49,4 @@ blockquote { } .small { font-size: .9em; } -.large { font-size: 1.1em; } \ No newline at end of file +.large { font-size: 1.1em; } diff --git a/railties/guides/files/stylesheets/reset.css b/railties/guides/files/stylesheets/reset.css index cd5f8e846e..cb14fbcc55 100755 --- a/railties/guides/files/stylesheets/reset.css +++ b/railties/guides/files/stylesheets/reset.css @@ -40,4 +40,4 @@ blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; -} \ No newline at end of file +} diff --git a/railties/guides/files/stylesheets/syntax.css b/railties/guides/files/stylesheets/syntax.css index cf5df03494..55fc5b209f 100644 --- a/railties/guides/files/stylesheets/syntax.css +++ b/railties/guides/files/stylesheets/syntax.css @@ -28,4 +28,4 @@ .ruby .symbol { color: green; -} \ No newline at end of file +} -- cgit v1.2.3 From 0db6c3f51828e1a37e2c7b9245ffa8c12ac59c83 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sat, 28 Feb 2009 19:44:25 +0000 Subject: Merge docrails and update the release notes --- railties/guides/files/stylesheets/main.css | 700 ++++++++++++----------------- 1 file changed, 276 insertions(+), 424 deletions(-) (limited to 'railties/guides/files') diff --git a/railties/guides/files/stylesheets/main.css b/railties/guides/files/stylesheets/main.css index f8302505c5..5061b130e3 100644 --- a/railties/guides/files/stylesheets/main.css +++ b/railties/guides/files/stylesheets/main.css @@ -1,138 +1,70 @@ /* Guides.rubyonrails.org */ /* Main.css */ /* Created January 30, 2009 */ -/* Modified January 31, 2009 +/* Modified February 8, 2009 --------------------------------------- */ /* General --------------------------------------- */ -.left { - float: left; - margin-right: 1em; -} -.right { - float: right; - margin-left: 1em; -} -.small { - font-size: smaller; -} -.large { - font-size: larger; -} -.hide { - display: none; -} +.left {float: left; margin-right: 1em;} +.right {float: right; margin-left: 1em;} +.small {font-size: smaller;} +.large {font-size: larger;} +.hide {display: none;} -li ul, li ol { - margin: 0 1.5em; -} -ul, ol { - margin: 0 1.5em 1.5em 1.5em; -} +li ul, li ol { margin:0 1.5em; } +ul, ol { margin: 0 1.5em 1.5em 1.5em; } -ul { - list-style-type: disc; -} -ol { - list-style-type: decimal; -} +ul { list-style-type: disc; } +ol { list-style-type: decimal; } -dl { - margin: 0 0 1.5em 0; -} -dl dt { - font-weight: bold; -} -dd { - margin-left: 1.5em; -} +dl { margin: 0 0 1.5em 0; } +dl dt { font-weight: bold; } +dd { margin-left: 1.5em;} + +pre,code { margin: 1.5em 0; white-space: pre; overflow: auto; } +pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height: 1.5; } -pre,code { - margin: 1.5em 0; - white-space: pre; -} -pre,code { - font: 1em 'andale mono', 'lucida console', monospace; - line-height: 1.5; -} +abbr, acronym { border-bottom: 1px dotted #666; } +address { margin: 0 0 1.5em; font-style: italic; } +del { color:#666; } -abbr, acronym { - border-bottom: 1px dotted #666; -} -address { - margin: 0 0 1.5em; - font-style: italic; -} -del { - color: #666; -} +blockquote { margin: 1.5em; color: #666; font-style: italic; } +strong { font-weight: bold; } +em, dfn { font-style: italic; } +dfn { font-weight: bold; } +sup, sub { line-height: 0; } +p {margin: 0 0 1.5em;} -blockquote { - margin: 1.5em; - color: #666; - font-style: italic; -} -strong { - font-weight: bold; -} -em, dfn { - font-style: italic; -} -dfn { - font-weight: bold; -} -sup, sub { - line-height: 0; -} -p { - margin: 0 0 1.5em; -} - -label { - font-weight: bold; -} -fieldset { - padding: 1.4em; - margin: 0 0 1.5em 0; - border: 1px solid #ccc; -} -legend { - font-weight: bold; - font-size: 1.2em; -} +label { font-weight: bold; } +fieldset { padding:1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; } +legend { font-weight: bold; font-size:1.2em; } -input.text, input.title, textarea, select { - margin: 0.5em 0em; - border: 1px solid #bbb; +input.text, input.title, +textarea, select { + margin:0.5em 0; + border:1px solid #bbb; } table { - margin: 1em 0; - border: 1px solid #ddd; - background: #f4f4f4; - border-spacing: 0; + margin: 0 0 1.5em; + border: 2px solid #CCC; + background: #FFF; + border-collapse: collapse; } - + table th, table td { - padding: 0.25em; - border-right: 1px dotted #e0e0e0; - border-bottom: 1px dotted #e0e0e0; -} - -table th:last-child, table td:last-child { - border-right: none; + padding: 0.25em 1em; + border: 1px solid #CCC; + border-collapse: collapse; } table th { - border-bottom: 1px solid #ddd; - background: #f0f0f0; - font-weight: bold; -} - -table tt { - padding: 0.1em; + border-bottom: 2px solid #CCC; + background: #EEE; + font-weight: bold; + padding: 0.5em 1em; } @@ -140,438 +72,358 @@ table tt { --------------------------------------- */ body { - text-align: center; - font-family: Helvetica, Arial, sans-serif; - font-size: 87.5%; - line-height: 1.5em; - background: #222; - color: #999; -} + text-align: center; + font-family: Helvetica, Arial, sans-serif; + font-size: 87.5%; + line-height: 1.5em; + background: #222; + color: #999; + } .wrapper { - text-align: left; - margin: 0 auto; - width: 69em; -} + text-align: left; + margin: 0 auto; + width: 69em; + } #topNav { - padding: 1em 0; - color: #565656; + padding: 1em 0; + color: #565656; } #header { - background: #c52f24 url(../../images/header_tile.gif) repeat-x; - color: #FFF; - padding: 1.5em 0; - position: relative; - z-index: 99; -} + background: #c52f24 url(../../images/header_tile.gif) repeat-x; + color: #FFF; + padding: 1.5em 0; + position: relative; + z-index: 99; + } #feature { - background: #d5e9f6 url(../../images/feature_tile.gif) repeat-x; - color: #333; - padding: 0.5em 0 1.5em; + background: #d5e9f6 url(../../images/feature_tile.gif) repeat-x; + color: #333; + padding: 0.5em 0 1.5em; } #container { - background: #FFF; - color: #333; - padding: 0.5em 0 1.5em 0; -} + background: #FFF; + color: #333; + padding: 0.5em 0 1.5em 0; + } #mainCol { - width: 45em; - margin-left: 2em; -} + width: 45em; + margin-left: 2em; + } #subCol { - position: absolute; - z-index: 0; - top: 0; - right: 0; - background: #FFF; - padding: 1em 1.5em 1em 1.25em; - width: 17em; - font-size: 0.9285em; - line-height: 1.3846em; -} - -#extraCol { - display: none; -} + position: absolute; + z-index: 0; + top: 0; + right: 0; + background: #FFF; + padding: 1em 1.5em 1em 1.25em; + width: 17em; + font-size: 0.9285em; + line-height: 1.3846em; + } + +#extraCol {display: none;} #footer { - padding: 2em 0; - background: url(../../images/footer_tile.gif) repeat-x; -} + padding: 2em 0; + background: url(../../images/footer_tile.gif) repeat-x; + } #footer .wrapper { - padding-left: 2em; - width: 67em; + padding-left: 2em; + width: 67em; } -#header .wrapper, #topNav .wrapper, #feature .wrapper { - padding-left: 1em; - width: 68em; -} -#feature .wrapper { - width: 45em; - padding-right: 23em; - position: relative; - z-index: 0; -} +#header .wrapper, #topNav .wrapper, #feature .wrapper {padding-left: 1em; width: 68em;} +#feature .wrapper {width: 45em; padding-right: 23em; position: relative; z-index: 0;} /* Links --------------------------------------- */ a, a:link, a:visited { - color: #ee3f3f; - text-decoration: underline; -} + color: #ee3f3f; + text-decoration: underline; + } -#mainCol a, #subCol a { - color: #980905; -} +#mainCol a, #subCol a, #feature a {color: #980905;} /* Navigation --------------------------------------- */ -.nav { - margin: 0; - padding: 0; -} -.nav li { - display: inline; - list-style: none; -} +.nav {margin: 0; padding: 0;} +.nav li {display: inline; list-style: none;} #header .nav { - float: right; - margin-top: 1.5em; - font-size: 1.2857em; + float: right; + margin-top: 1.5em; + font-size: 1.2857em; } -#header .nav li { - margin: 0 0 0 0.5em; -} -#header .nav a { - color: #FFF; - text-decoration: none; -} -#header .nav a:hover { - text-decoration: underline; -} +#header .nav li {margin: 0 0 0 0.5em;} +#header .nav a {color: #FFF; text-decoration: none;} +#header .nav a:hover {text-decoration: underline;} #header .nav .index { - padding: 0.5em 1.5em; - border-radius: 1em; - -webkit-border-radius: 1em; - -moz-border-radius: 1em; - background: #980905; - position: relative; + padding: 0.5em 1.5em; + border-radius: 1em; + -webkit-border-radius: 1em; + -moz-border-radius: 1em; + background: #980905; + position: relative; } #header .nav .index a { - background: #980905 url(../../images/nav_arrow.gif) no-repeat right top; - padding-right: 1em; - position: relative; - z-index: 15; - padding-bottom: 0.125em; -} -#header .nav .index:hover a, #header .nav .index a:hover { - background-position: right -81px; + background: #980905 url(../../images/nav_arrow.gif) no-repeat right top; + padding-right: 1em; + position: relative; + z-index: 15; + padding-bottom: 0.125em; } +#header .nav .index:hover a, #header .nav .index a:hover {background-position: right -81px;} #guides { - width: 27em; - display: block; - background: #980905; - border-radius: 1em; - -webkit-border-radius: 1em; - -moz-border-radius: 1em; - -webkit-box-shadow: 0.25em 0.25em 1em rgba(0,0,0,0.25); - -moz-box-shadow: rgba(0,0,0,0.25) 0.25em 0.25em 1em; - color: #f1938c; - padding: 1.5em 2em; - position: absolute; - z-index: 10; - top: -0.25em; - right: 0; - padding-top: 2em; + width: 27em; + display: block; + background: #980905; + border-radius: 1em; + -webkit-border-radius: 1em; + -moz-border-radius: 1em; + -webkit-box-shadow: 0.25em 0.25em 1em rgba(0,0,0,0.25); + -moz-box-shadow: rgba(0,0,0,0.25) 0.25em 0.25em 1em; + color: #f1938c; + padding: 1.5em 2em; + position: absolute; + z-index: 10; + top: -0.25em; + right: 0; + padding-top: 2em; } #guides dt, #guides dd { - font-weight: normal; - font-size: 0.722em; - margin: 0; - padding: 0; -} -#guides dt { - padding: 0; - margin: 0.5em 0 0; -} -#guides a { - color: #FFF; - background: none !important; -} -#guides .L, #guides .R { - float: left; - width: 50%; - margin: 0; - padding: 0; -} -#guides .R { - float: right; -} + font-weight: normal; + font-size: 0.722em; + margin: 0; + padding: 0; +} +#guides dt {padding:0; margin: 0.5em 0 0;} +#guides a {color: #FFF; background: none !important;} +#guides .L, #guides .R {float: left; width: 50%; margin: 0; padding: 0;} +#guides .R {float: right;} #guides hr { - display: block; - border: none; - height: 1px; - color: #f1938c; - background: #f1938c; + display: block; + border: none; + height: 1px; + color: #f1938c; + background: #f1938c; } /* Headings --------------------------------------- */ h1 { - font-size: 2.5em; - line-height: 1em; - margin: 0.6em 0 .2em; - font-weight: bold; -} + font-size: 2.5em; + line-height: 1em; + margin: 0.6em 0 .2em; + font-weight: bold; + } h2 { - font-size: 2.1428em; - line-height: 1em; - margin: 0.7em 0 .2333em; - font-weight: bold; -} + font-size: 2.1428em; + line-height: 1em; + margin: 0.7em 0 .2333em; + font-weight: bold; + } h3 { - font-size: 1.7142em; - line-height: 1.286em; - margin: 0.875em 0 0.2916em; - font-weight: bold; -} - + font-size: 1.7142em; + line-height: 1.286em; + margin: 0.875em 0 0.2916em; + font-weight: bold; + } + h4 { - font-size: 1.2857em; - line-height: 1.2em; - margin: 1.6667em 0 .3887em; - font-weight: bold; -} + font-size: 1.2857em; + line-height: 1.2em; + margin: 1.6667em 0 .3887em; + font-weight: bold; + } h5 { - font-size: 1em; - line-height: 1.5em; - margin: 1em 0 .5em; - font-weight: bold; + font-size: 1em; + line-height: 1.5em; + margin: 1em 0 .5em; + font-weight: bold; } -h6 { - font-size: 1em; - line-height: 1.5em; - margin: 1em 0 .5em; - font-weight: normal; +h6 { + font-size: 1em; + line-height: 1.5em; + margin: 1em 0 .5em; + font-weight: normal; + } + +.section { + padding-bottom: 0.25em; + border-bottom: 1px solid #999; } /* Content --------------------------------------- */ .pic { - margin: 0 2em 2em 0; + margin: 0 2em 2em 0; } -#topNav strong { - color: #999; - margin-right: 0.5em; -} -#topNav strong a { - color: #FFF; -} +#topNav strong {color: #999; margin-right: 0.5em;} +#topNav strong a {color: #FFF;} #header h1 { - float: left; - background: url(../../images/ruby_guides_logo.gif) no-repeat; - width: 492px; - text-indent: -9999em; - margin: 0; - padding: 0; + float: left; + background: url(../../images/rails_guides_logo.gif) no-repeat; + width: 297px; + text-indent: -9999em; + margin: 0; + padding: 0; } #header h1 a { - text-decoration: none; - display: block; - height: 77px; + text-decoration: none; + display: block; + height: 77px; } #feature p { - font-size: 1.2857em; - margin-bottom: 0.75em; + font-size: 1.2857em; + margin-bottom: 0.75em; } -#feature ul { - margin-left: 0; -} +#feature ul {margin-left: 0;} #feature ul li { - list-style: none; - background: url(../../images/check_bullet.gif) no-repeat left 0.5em; - padding: 0.5em 1.75em 0.5em 1.75em; - font-size: 1.1428em; - font-weight: bold; + list-style: none; + background: url(../../images/check_bullet.gif) no-repeat left 0.5em; + padding: 0.5em 1.75em 0.5em 1.75em; + font-size: 1.1428em; + font-weight: bold; } #mainCol dd, #subCol dd { - padding: 0.25em 0 1em; - border-bottom: 1px solid #CCC; - margin-bottom: 1em; - margin-left: 0; - padding-left: 28px; + padding: 0.25em 0 1em; + border-bottom: 1px solid #CCC; + margin-bottom: 1em; + margin-left: 0; + /*padding-left: 28px;*/ + padding-left: 0; } #mainCol dt, #subCol dt { - font-size: 1.2857em; - padding: 0.125em 0 0.25em 28px; - margin-bottom: 0; - background: url(../../images/book_icon.gif) no-repeat left top; + font-size: 1.2857em; + padding: 0.125em 0 0.25em 0; + margin-bottom: 0; + /*background: url(../../images/book_icon.gif) no-repeat left top; + padding: 0.125em 0 0.25em 28px;*/ } #mainCol dd.ticket, #subCol dd.ticket { - background: #fff9d8 url(../../images/tab_yellow.gif) no-repeat left top; - border: none; - padding: 1.25em 1em 1.25em 48px; - margin-left: 0; - margin-top: 0.25em; + background: #fff9d8 url(../../images/tab_yellow.gif) no-repeat left top; + border: none; + padding: 1.25em 1em 1.25em 48px; + margin-left: 0; + margin-top: 0.25em; } #mainCol dd.warning, #subCol dd.warning { - background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; - border: none; - padding: 1.25em 1.25em 1.25em 48px; - margin-left: 0; - margin-top: 0.25em; -} - -#subCol .chapters { - color: #980905; -} -#subCol .chapters a { - font-weight: bold; -} -#subCol .chapters ul a { - font-weight: normal; -} -#subCol .chapters li { - margin-bottom: 0.75em; -} -#subCol h3.chapter { - margin-top: 0.25em; -} -#subCol h3.chapter img { - vertical-align: text-bottom; -} -#subCol .chapters ul { - margin-left: 0; - margin-top: 0.5em; -} + background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; + border: none; + padding: 1.25em 1.25em 1.25em 48px; + margin-left: 0; + margin-top: 0.25em; +} + +#subCol .chapters {color: #980905;} +#subCol .chapters a {font-weight: bold;} +#subCol .chapters ul a {font-weight: normal;} +#subCol .chapters li {margin-bottom: 0.75em;} +#subCol h3.chapter {margin-top: 0.25em;} +#subCol h3.chapter img {vertical-align: text-bottom;} +#subCol .chapters ul {margin-left: 0; margin-top: 0.5em;} #subCol .chapters ul li { - list-style: none; - padding: 0 0 0 1em; - background: url(../../images/bullet.gif) no-repeat left 0.45em; - margin-left: 0; - font-size: 1em; - font-weight: normal; -} -#subCol .chapters p { - font-size: 1em; + list-style: none; + padding: 0 0 0 1em; + background: url(../../images/bullet.gif) no-repeat left 0.45em; + margin-left: 0; + font-size: 1em; + font-weight: normal; } tt { - font-family: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace; + font-family: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace; } -code, pre { - font-family: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace; - background: #EEE url(../../images/tab_grey.gif) no-repeat left top; - border: none; - padding: 0.25em 1em 0.5em 48px; - margin-left: 0; - margin-top: 0.25em; - display: block; - min-height: 45px; - overflow: auto; +div.code_container { + background: #EEE url(../../images/tab_grey.gif) no-repeat left top; + padding: 0.25em 1em 0.5em 48px; } -.info code, .info pre { - background-image: none; - background-color: #C5D9E6; - padding: 0.25em 1em; - min-height: 1px; +code { + font-family: monaco, "Bitstream Vera Sans Mono", "Courier New", courier, monospace; + border: none; + margin: 0.25em 0 1.5em 0; + display: block; } .note { - background: #fff9d8 url(../../images/tab_note.gif) no-repeat left top; - border: none; - padding: 1em 1em 0.25em 48px; - margin-left: 0; - margin-top: 0.25em; + background: #fff9d8 url(../../images/tab_note.gif) no-repeat left top; + border: none; + padding: 1em 1em 0.25em 48px; + margin: 0.25em 0 1.5em 0; } .info { - background: #d5e9f6 url(../../images/tab_info.gif) no-repeat left top; - border: none; - padding: 1em 1em 0.25em 48px; - margin-left: 0; - margin-top: 0.25em; + background: #d5e9f6 url(../../images/tab_info.gif) no-repeat left top; + border: none; + padding: 1em 1em 0.25em 48px; + margin: 0.25em 0 1.5em 0; } -.warning { - background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; - border: none; - padding: 1em 1em 0.25em 48px; - margin-left: 0; - margin-top: 0.25em; -} +.note tt, .info tt {border:none; background: none; padding: 0;} -.warning tt, .note tt, .info tt { - border: none; - background: none; - padding: 0; +#mainCol ul li { + list-style:none; + background: url(../../images/grey_bullet.gif) no-repeat left 0.5em; + padding-left: 1em; + margin-left: 0; } -em.highlight { - background: #fffcdb; - padding: 0 0.25em; +#subCol .content { + font-size: 0.7857em; + line-height: 1.5em; } -#mainCol ul li { - list-style: none; - background: url(../../images/grey_bullet.gif) no-repeat left 0.5em; - padding-left: 1em; - margin-left: 0; +#subCol .content li { + font-weight: normal; + background: none; + padding: 0 0 1em; + font-size: 1.1667em; } - + /* Clearing --------------------------------------- */ .clearfix:after { - content: "."; - display: block; - height: 0; - clear: both; + content: "."; + display: block; + height: 0; + clear: both; visibility: hidden; } -.clearfix { - display: inline-block; -} -* html .clearfix { - height: 1%; -} -.clearfix { - display: block; -} -.clear { - clear: both; -} +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} +.clear { clear:both; } \ No newline at end of file -- cgit v1.2.3 From 18eb80ccc7e932f9a6c00462ceaeea648631b120 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Mon, 16 Mar 2009 11:28:36 +0000 Subject: Merge docrails --- railties/guides/files/stylesheets/main.css | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'railties/guides/files') diff --git a/railties/guides/files/stylesheets/main.css b/railties/guides/files/stylesheets/main.css index 5061b130e3..d377628d73 100644 --- a/railties/guides/files/stylesheets/main.css +++ b/railties/guides/files/stylesheets/main.css @@ -337,7 +337,7 @@ h6 { margin-top: 0.25em; } -#mainCol dd.warning, #subCol dd.warning { +#mainCol div.warning, #subCol dd.warning { background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; border: none; padding: 1.25em 1.25em 1.25em 48px; @@ -426,4 +426,16 @@ code { .clearfix {display: inline-block;} * html .clearfix {height: 1%;} .clearfix {display: block;} -.clear { clear:both; } \ No newline at end of file +.clear { clear:both; } + +/* Same bottom margin for special boxes than for regular paragraphs, this way +intermediate whitespace looks uniform. */ +div.code_container, div.important, div.caution, div.warning, div.note, div.info { + margin-bottom: 1.5em; +} + +/* Remove bottom margin of paragraphs in special boxes, otherwise they get a +spurious blank area below with the box background. */ +div.important p, div.caution p, div.warning p, div.note p, div.info p { + margin-bottom: 0px; +} -- cgit v1.2.3