From 4260aa1dc399e1bb4a2147409ed1139112cfefb8 Mon Sep 17 00:00:00 2001 From: drbrain Date: Sun, 7 Dec 2014 01:22:37 +0000 Subject: * lib/rdoc: Update to RDoc 4.2.0. * test/rdoc: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc.rb | 2 +- lib/rdoc/generator/darkfish.rb | 5 +- lib/rdoc/generator/json_index.rb | 44 ++ lib/rdoc/generator/template/darkfish/_head.rhtml | 4 +- lib/rdoc/generator/template/darkfish/css/fonts.css | 167 ++++++ lib/rdoc/generator/template/darkfish/css/rdoc.css | 590 +++++++++++++++++++++ lib/rdoc/generator/template/darkfish/fonts.css | 167 ------ lib/rdoc/generator/template/darkfish/rdoc.css | 590 --------------------- lib/rdoc/known_classes.rb | 1 + lib/rdoc/markdown.rb | 178 ++++++- lib/rdoc/markup/to_html.rb | 9 +- lib/rdoc/markup/to_label.rb | 2 +- lib/rdoc/parser/c.rb | 8 +- lib/rdoc/rd/block_parser.rb | 122 ++--- lib/rdoc/rd/inline_parser.rb | 98 ++-- lib/rdoc/ri/task.rb | 71 +++ lib/rdoc/single_class.rb | 4 + lib/rdoc/stats.rb | 4 + lib/rdoc/test_case.rb | 2 +- 19 files changed, 1183 insertions(+), 885 deletions(-) create mode 100644 lib/rdoc/generator/template/darkfish/css/fonts.css create mode 100644 lib/rdoc/generator/template/darkfish/css/rdoc.css delete mode 100644 lib/rdoc/generator/template/darkfish/fonts.css delete mode 100644 lib/rdoc/generator/template/darkfish/rdoc.css create mode 100644 lib/rdoc/ri/task.rb (limited to 'lib') diff --git a/lib/rdoc.rb b/lib/rdoc.rb index 87ed2df9b6..a99e5dc309 100644 --- a/lib/rdoc.rb +++ b/lib/rdoc.rb @@ -64,7 +64,7 @@ module RDoc ## # RDoc version you are using - VERSION = '4.2.0.alpha' + VERSION = '4.2.0' ## # Method visibilities diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb index bd37b60668..024040466d 100644 --- a/lib/rdoc/generator/darkfish.rb +++ b/lib/rdoc/generator/darkfish.rb @@ -62,14 +62,14 @@ class RDoc::Generator::Darkfish BUILTIN_STYLE_ITEMS = # :nodoc: %w[ - fonts.css + css/fonts.css fonts/Lato-Light.ttf fonts/Lato-LightItalic.ttf fonts/Lato-Regular.ttf fonts/Lato-RegularItalic.ttf fonts/SourceCodePro-Bold.ttf fonts/SourceCodePro-Regular.ttf - rdoc.css + css/rdoc.css ] ## @@ -246,6 +246,7 @@ class RDoc::Generator::Darkfish generate_file_files generate_table_of_contents @json_index.generate + @json_index.generate_gzipped copy_static diff --git a/lib/rdoc/generator/json_index.rb b/lib/rdoc/generator/json_index.rb index c303b2effb..9d6f0d4356 100644 --- a/lib/rdoc/generator/json_index.rb +++ b/lib/rdoc/generator/json_index.rb @@ -1,4 +1,5 @@ require 'json' +require 'zlib' ## # The JsonIndex generator is designed to complement an HTML generator and @@ -152,6 +153,49 @@ class RDoc::Generator::JsonIndex end end + ## + # Compress the search_index.js file using gzip + + def generate_gzipped + debug_msg "Compressing generated JSON index" + out_dir = @base_dir + @options.op_dir + + search_index_file = out_dir + SEARCH_INDEX_FILE + outfile = out_dir + "#{search_index_file}.gz" + + debug_msg "Reading the JSON index file from %s" % search_index_file + search_index = search_index_file.read + + debug_msg "Writing gzipped search index to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| + gz.mtime = File.mtime(search_index_file) + gz.orig_name = search_index_file.to_s + gz.write search_index + gz.close + end + + # GZip the rest of the js files + Dir.chdir @template_dir do + Dir['**/*.js'].each do |source| + dest = out_dir + source + outfile = out_dir + "#{dest}.gz" + + debug_msg "Reading the original js file from %s" % dest + data = dest.read + + debug_msg "Writing gzipped file to %s" % outfile + + Zlib::GzipWriter.open(outfile) do |gz| + gz.mtime = File.mtime(dest) + gz.orig_name = dest.to_s + gz.write data + gz.close + end + end + end + end + ## # Adds classes and modules to the index diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml index c87ba95096..70f1c188d6 100644 --- a/lib/rdoc/generator/template/darkfish/_head.rhtml +++ b/lib/rdoc/generator/template/darkfish/_head.rhtml @@ -9,8 +9,8 @@ - - + + <% if @options.template_stylesheets.flatten.any? then %> <% @options.template_stylesheets.flatten.each do |stylesheet| %> diff --git a/lib/rdoc/generator/template/darkfish/css/fonts.css b/lib/rdoc/generator/template/darkfish/css/fonts.css new file mode 100644 index 0000000000..e9e721183b --- /dev/null +++ b/lib/rdoc/generator/template/darkfish/css/fonts.css @@ -0,0 +1,167 @@ +/* + * Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + * with Reserved Font Name "Source". All Rights Reserved. Source is a + * trademark of Adobe Systems Incorporated in the United States and/or other + * countries. + * + * This Font Software is licensed under the SIL Open Font License, Version + * 1.1. + * + * This license is copied below, and is also available with a FAQ at: + * http://scripts.sil.org/OFL + */ + +@font-face { + font-family: "Source Code Pro"; + font-style: normal; + font-weight: 400; + src: local("Source Code Pro"), + local("SourceCodePro-Regular"), + url("fonts/SourceCodePro-Regular.ttf") format("truetype"); +} + +@font-face { + font-family: "Source Code Pro"; + font-style: normal; + font-weight: 700; + src: local("Source Code Pro Bold"), + local("SourceCodePro-Bold"), + url("fonts/SourceCodePro-Bold.ttf") format("truetype"); +} + +/* + * Copyright (c) 2010, Łukasz Dziedzic (dziedzic@typoland.com), + * with Reserved Font Name Lato. + * + * This Font Software is licensed under the SIL Open Font License, Version + * 1.1. + * + * This license is copied below, and is also available with a FAQ at: + * http://scripts.sil.org/OFL + */ + +@font-face { + font-family: "Lato"; + font-style: normal; + font-weight: 300; + src: local("Lato Light"), + local("Lato-Light"), + url("fonts/Lato-Light.ttf") format("truetype"); +} + +@font-face { + font-family: "Lato"; + font-style: italic; + font-weight: 300; + src: local("Lato Light Italic"), + local("Lato-LightItalic"), + url("fonts/Lato-LightItalic.ttf") format("truetype"); +} + +@font-face { + font-family: "Lato"; + font-style: normal; + font-weight: 700; + src: local("Lato Regular"), + local("Lato-Regular"), + url("fonts/Lato-Regular.ttf") format("truetype"); +} + +@font-face { + font-family: "Lato"; + font-style: italic; + font-weight: 700; + src: local("Lato Italic"), + local("Lato-Italic"), + url("fonts/Lato-RegularItalic.ttf") format("truetype"); +} + +/* + * ----------------------------------------------------------- + * SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 + * ----------------------------------------------------------- + * + * PREAMBLE + * The goals of the Open Font License (OFL) are to stimulate worldwide + * development of collaborative font projects, to support the font creation + * efforts of academic and linguistic communities, and to provide a free and + * open framework in which fonts may be shared and improved in partnership + * with others. + * + * The OFL allows the licensed fonts to be used, studied, modified and + * redistributed freely as long as they are not sold by themselves. The + * fonts, including any derivative works, can be bundled, embedded, + * redistributed and/or sold with any software provided that any reserved + * names are not used by derivative works. The fonts and derivatives, + * however, cannot be released under any other type of license. The + * requirement for fonts to remain under this license does not apply + * to any document created using the fonts or their derivatives. + * + * DEFINITIONS + * "Font Software" refers to the set of files released by the Copyright + * Holder(s) under this license and clearly marked as such. This may + * include source files, build scripts and documentation. + * + * "Reserved Font Name" refers to any names specified as such after the + * copyright statement(s). + * + * "Original Version" refers to the collection of Font Software components as + * distributed by the Copyright Holder(s). + * + * "Modified Version" refers to any derivative made by adding to, deleting, + * or substituting -- in part or in whole -- any of the components of the + * Original Version, by changing formats or by porting the Font Software to a + * new environment. + * + * "Author" refers to any designer, engineer, programmer, technical + * writer or other person who contributed to the Font Software. + * + * PERMISSION & CONDITIONS + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of the Font Software, to use, study, copy, merge, embed, modify, + * redistribute, and sell modified and unmodified copies of the Font + * Software, subject to the following conditions: + * + * 1) Neither the Font Software nor any of its individual components, + * in Original or Modified Versions, may be sold by itself. + * + * 2) Original or Modified Versions of the Font Software may be bundled, + * redistributed and/or sold with any software, provided that each copy + * contains the above copyright notice and this license. These can be + * included either as stand-alone text files, human-readable headers or + * in the appropriate machine-readable metadata fields within text or + * binary files as long as those fields can be easily viewed by the user. + * + * 3) No Modified Version of the Font Software may use the Reserved Font + * Name(s) unless explicit written permission is granted by the corresponding + * Copyright Holder. This restriction only applies to the primary font name as + * presented to the users. + * + * 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font + * Software shall not be used to promote, endorse or advertise any + * Modified Version, except to acknowledge the contribution(s) of the + * Copyright Holder(s) and the Author(s) or with their explicit written + * permission. + * + * 5) The Font Software, modified or unmodified, in part or in whole, + * must be distributed entirely under this license, and must not be + * distributed under any other license. The requirement for fonts to + * remain under this license does not apply to any document created + * using the Font Software. + * + * TERMINATION + * This license becomes null and void if any of the above conditions are + * not met. + * + * DISCLAIMER + * THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + * OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL + * DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM + * OTHER DEALINGS IN THE FONT SOFTWARE. + */ + diff --git a/lib/rdoc/generator/template/darkfish/css/rdoc.css b/lib/rdoc/generator/template/darkfish/css/rdoc.css new file mode 100644 index 0000000000..2f4dca7e08 --- /dev/null +++ b/lib/rdoc/generator/template/darkfish/css/rdoc.css @@ -0,0 +1,590 @@ +/* + * "Darkfish" Rdoc CSS + * $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $ + * + * Author: Michael Granger + * + */ + +/* vim: ft=css et sw=2 ts=2 sts=2 */ +/* Base Green is: #6C8C22 */ + +* { padding: 0; margin: 0; } + +body { + background: #fafafa; + font-family: Lato, sans-serif; + font-weight: 300; +} + +h1 span, +h2 span, +h3 span, +h4 span, +h5 span, +h6 span { + position: relative; + + display: none; + padding-left: 1em; + line-height: 0; + vertical-align: baseline; + font-size: 10px; +} + +h1 span { top: -1.3em; } +h2 span { top: -1.2em; } +h3 span { top: -1.0em; } +h4 span { top: -0.8em; } +h5 span { top: -0.5em; } +h6 span { top: -0.5em; } + +h1:hover span, +h2:hover span, +h3:hover span, +h4:hover span, +h5:hover span, +h6:hover span { + display: inline; +} + +:link, +:visited { + color: #6C8C22; + text-decoration: none; +} + +:link:hover, +:visited:hover { + border-bottom: 1px dotted #6C8C22; +} + +code, +pre { + font-family: "Source Code Pro", Monaco, monospace; +} + +/* @group Generic Classes */ + +.initially-hidden { + display: none; +} + +#search-field { + width: 98%; + background: white; + border: none; + height: 1.5em; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + text-align: left; +} +#search-field:focus { + background: #f1edba; +} +#search-field:-moz-placeholder, +#search-field::-webkit-input-placeholder { + font-weight: bold; + color: #666; +} + +.missing-docs { + font-size: 120%; + background: white url(images/wrench_orange.png) no-repeat 4px center; + color: #ccc; + line-height: 2em; + border: 1px solid #d00; + opacity: 1; + padding-left: 20px; + text-indent: 24px; + letter-spacing: 3px; + font-weight: bold; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; +} + +.target-section { + border: 2px solid #dcce90; + border-left-width: 8px; + padding: 0 1em; + background: #fff3c2; +} + +/* @end */ + +/* @group Index Page, Standalone file pages */ +.table-of-contents ul { + margin: 1em; + list-style: none; +} + +.table-of-contents ul ul { + margin-top: 0.25em; +} + +.table-of-contents ul :link, +.table-of-contents ul :visited { + font-size: 16px; +} + +.table-of-contents li { + margin-bottom: 0.25em; +} + +.table-of-contents li .toc-toggle { + width: 16px; + height: 16px; + background: url(images/add.png) no-repeat; +} + +.table-of-contents li .toc-toggle.open { + background: url(images/delete.png) no-repeat; +} + +/* @end */ + +/* @group Top-Level Structure */ + +nav { + float: left; + width: 260px; + font-family: Helvetica, sans-serif; + font-size: 14px; +} + +main { + display: block; + margin: 0 2em 5em 260px; + padding-left: 20px; + min-width: 340px; + font-size: 16px; +} + +main h1, +main h2, +main h3, +main h4, +main h5, +main h6 { + font-family: Helvetica, sans-serif; +} + +.table-of-contents main { + margin-left: 2em; +} + +#validator-badges { + clear: both; + margin: 1em 1em 2em; + font-size: smaller; +} + +/* @end */ + +/* @group navigation */ +nav { + margin-bottom: 1em; +} + +nav .nav-section { + margin-top: 2em; + border-top: 2px solid #aaa; + font-size: 90%; + overflow: hidden; +} + +nav h2 { + margin: 0; + padding: 2px 8px 2px 8px; + background-color: #e8e8e8; + color: #555; + font-size: 125%; + text-align: center; +} + +nav h3, +#table-of-contents-navigation { + margin: 0; + padding: 2px 8px 2px 8px; + text-align: right; + background-color: #e8e8e8; + color: #555; +} + +nav ul, +nav dl, +nav p { + padding: 4px 8px 0; + list-style: none; +} + +#project-navigation .nav-section { + margin: 0; + border-top: 0; +} + +#home-section h2 { + text-align: center; +} + +#table-of-contents-navigation { + font-size: 1.2em; + font-weight: bold; + text-align: center; +} + +#search-section { + margin-top: 0; + border-top: 0; +} + +#search-field-wrapper { + border-top: 1px solid #aaa; + border-bottom: 1px solid #aaa; + padding: 3px 8px; + background-color: #e8e8e8; + color: #555; +} + +ul.link-list li { + white-space: nowrap; + line-height: 1.4em; +} + +ul.link-list .type { + font-size: 8px; + text-transform: uppercase; + color: white; + background: #969696; + padding: 2px 4px; + -webkit-border-radius: 5px; +} + +.calls-super { + background: url(images/arrow_up.png) no-repeat right center; +} + +/* @end */ + +/* @group Documentation Section */ +main { + color: #333; +} + +main > h1:first-child, +main > h2:first-child, +main > h3:first-child, +main > h4:first-child, +main > h5:first-child, +main > h6:first-child { + margin-top: 0px; +} + +main sup { + vertical-align: super; + font-size: 0.8em; +} + +/* The heading with the class name */ +main h1[class] { + margin-top: 0; + margin-bottom: 1em; + font-size: 2em; + color: #6C8C22; +} + +main h1 { + margin: 2em 0 0.5em; + font-size: 1.7em; +} + +main h2 { + margin: 2em 0 0.5em; + font-size: 1.5em; +} + +main h3 { + margin: 2em 0 0.5em; + font-size: 1.2em; +} + +main h4 { + margin: 2em 0 0.5em; + font-size: 1.1em; +} + +main h5 { + margin: 2em 0 0.5em; + font-size: 1em; +} + +main h6 { + margin: 2em 0 0.5em; + font-size: 1em; +} + +main p { + margin: 0 0 0.5em; + line-height: 1.4em; +} + +main pre { + margin: 1.2em 0.5em; + padding: 1em; + font-size: 0.8em; +} + +main hr { + margin: 1.5em 1em; + border: 2px solid #ddd; +} + +main blockquote { + margin: 0 2em 1.2em 1.2em; + padding-left: 0.5em; + border-left: 2px solid #ddd; +} + +main ol, +main ul { + margin: 1em 2em; +} + +main li > p { + margin-bottom: 0.5em; +} + +main dl { + margin: 1em 0.5em; +} + +main dt { + margin-bottom: 0.5em; + font-weight: bold; +} + +main dd { + margin: 0 1em 1em 0.5em; +} + +main header h2 { + margin-top: 2em; + border-width: 0; + border-top: 4px solid #bbb; + font-size: 130%; +} + +main header h3 { + margin: 2em 0 1.5em; + border-width: 0; + border-top: 3px solid #bbb; + font-size: 120%; +} + +.documentation-section-title { + position: relative; +} +.documentation-section-title .section-click-top { + position: absolute; + top: 6px; + left: 12px; + font-size: 10px; + color: #9b9877; + visibility: hidden; + padding-left: 0.5px; +} + +.documentation-section-title:hover .section-click-top { + visibility: visible; +} + +.constants-list > dl { + margin: 1em 0 2em; + border: 0; +} + +.constants-list > dl dt { + margin-bottom: 0.75em; + padding-left: 0; + font-family: "Source Code Pro", Monaco, monospace; + font-size: 110%; +} + +.constants-list > dl dt a { + color: inherit; +} + +.constants-list > dl dd { + margin: 0 0 2em 0; + padding: 0; + color: #666; +} + +.documentation-section h2 { + position: relative; +} + +.documentation-section h2 a { + position: absolute; + top: 8px; + right: 10px; + font-size: 12px; + color: #9b9877; + visibility: hidden; +} + +.documentation-section h2:hover a { + visibility: visible; +} + +/* @group Method Details */ + +main .method-source-code { + display: none; +} + +main .method-description .method-calls-super { + color: #333; + font-weight: bold; +} + +main .method-detail { + margin-bottom: 2.5em; + cursor: pointer; +} + +main .method-detail:target { + margin-left: -10px; + border-left: 10px solid #f1edba; +} + +main .method-heading { + position: relative; + font-family: "Source Code Pro", Monaco, monospace; + font-size: 110%; + font-weight: bold; + color: #333; +} +main .method-heading :link, +main .method-heading :visited { + color: inherit; +} +main .method-click-advice { + position: absolute; + top: 2px; + right: 5px; + font-size: 12px; + color: #9b9877; + visibility: hidden; + padding-right: 20px; + line-height: 20px; + background: url(images/zoom.png) no-repeat right top; +} +main .method-heading:hover .method-click-advice { + visibility: visible; +} + +main .method-alias .method-heading { + color: #666; +} + +main .method-description, +main .aliases { + margin-top: 0.75em; + color: #333; +} + +main .aliases { + padding-top: 4px; + font-style: italic; + cursor: default; +} +main .method-description ul { + margin-left: 1.5em; +} + +main #attribute-method-details .method-detail:hover { + background-color: transparent; + cursor: default; +} +main .attribute-access-type { + text-transform: uppercase; + padding: 0 1em; +} +/* @end */ + +/* @end */ + +/* @group Source Code */ + +pre { + margin: 0.5em 0; + border: 1px dashed #999; + padding: 0.5em; + background: #262626; + color: white; + overflow: auto; +} + +.ruby-constant { color: #7fffd4; background: transparent; } +.ruby-keyword { color: #00ffff; background: transparent; } +.ruby-ivar { color: #eedd82; background: transparent; } +.ruby-operator { color: #00ffee; background: transparent; } +.ruby-identifier { color: #ffdead; background: transparent; } +.ruby-node { color: #ffa07a; background: transparent; } +.ruby-comment { color: #dc0000; background: transparent; } +.ruby-regexp { color: #ffa07a; background: transparent; } +.ruby-value { color: #7fffd4; background: transparent; } + +/* @end */ + + +/* @group search results */ +#search-results { + font-family: Lato, sans-serif; + font-weight: 300; +} + +#search-results .search-match { + font-family: Helvetica, sans-serif; + font-weight: normal; +} + +#search-results .search-selected { + background: #e8e8e8; + border-bottom: 1px solid transparent; +} + +#search-results li { + list-style: none; + border-bottom: 1px solid #aaa; + margin-bottom: 0.5em; +} + +#search-results li:last-child { + border-bottom: none; + margin-bottom: 0; +} + +#search-results li p { + padding: 0; + margin: 0.5em; +} + +#search-results .search-namespace { + font-weight: bold; +} + +#search-results li em { + background: yellow; + font-style: normal; +} + +#search-results pre { + margin: 0.5em; + font-family: "Source Code Pro", Monaco, monospace; +} + +/* @end */ + diff --git a/lib/rdoc/generator/template/darkfish/fonts.css b/lib/rdoc/generator/template/darkfish/fonts.css deleted file mode 100644 index e9e721183b..0000000000 --- a/lib/rdoc/generator/template/darkfish/fonts.css +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), - * with Reserved Font Name "Source". All Rights Reserved. Source is a - * trademark of Adobe Systems Incorporated in the United States and/or other - * countries. - * - * This Font Software is licensed under the SIL Open Font License, Version - * 1.1. - * - * This license is copied below, and is also available with a FAQ at: - * http://scripts.sil.org/OFL - */ - -@font-face { - font-family: "Source Code Pro"; - font-style: normal; - font-weight: 400; - src: local("Source Code Pro"), - local("SourceCodePro-Regular"), - url("fonts/SourceCodePro-Regular.ttf") format("truetype"); -} - -@font-face { - font-family: "Source Code Pro"; - font-style: normal; - font-weight: 700; - src: local("Source Code Pro Bold"), - local("SourceCodePro-Bold"), - url("fonts/SourceCodePro-Bold.ttf") format("truetype"); -} - -/* - * Copyright (c) 2010, Łukasz Dziedzic (dziedzic@typoland.com), - * with Reserved Font Name Lato. - * - * This Font Software is licensed under the SIL Open Font License, Version - * 1.1. - * - * This license is copied below, and is also available with a FAQ at: - * http://scripts.sil.org/OFL - */ - -@font-face { - font-family: "Lato"; - font-style: normal; - font-weight: 300; - src: local("Lato Light"), - local("Lato-Light"), - url("fonts/Lato-Light.ttf") format("truetype"); -} - -@font-face { - font-family: "Lato"; - font-style: italic; - font-weight: 300; - src: local("Lato Light Italic"), - local("Lato-LightItalic"), - url("fonts/Lato-LightItalic.ttf") format("truetype"); -} - -@font-face { - font-family: "Lato"; - font-style: normal; - font-weight: 700; - src: local("Lato Regular"), - local("Lato-Regular"), - url("fonts/Lato-Regular.ttf") format("truetype"); -} - -@font-face { - font-family: "Lato"; - font-style: italic; - font-weight: 700; - src: local("Lato Italic"), - local("Lato-Italic"), - url("fonts/Lato-RegularItalic.ttf") format("truetype"); -} - -/* - * ----------------------------------------------------------- - * SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 - * ----------------------------------------------------------- - * - * PREAMBLE - * The goals of the Open Font License (OFL) are to stimulate worldwide - * development of collaborative font projects, to support the font creation - * efforts of academic and linguistic communities, and to provide a free and - * open framework in which fonts may be shared and improved in partnership - * with others. - * - * The OFL allows the licensed fonts to be used, studied, modified and - * redistributed freely as long as they are not sold by themselves. The - * fonts, including any derivative works, can be bundled, embedded, - * redistributed and/or sold with any software provided that any reserved - * names are not used by derivative works. The fonts and derivatives, - * however, cannot be released under any other type of license. The - * requirement for fonts to remain under this license does not apply - * to any document created using the fonts or their derivatives. - * - * DEFINITIONS - * "Font Software" refers to the set of files released by the Copyright - * Holder(s) under this license and clearly marked as such. This may - * include source files, build scripts and documentation. - * - * "Reserved Font Name" refers to any names specified as such after the - * copyright statement(s). - * - * "Original Version" refers to the collection of Font Software components as - * distributed by the Copyright Holder(s). - * - * "Modified Version" refers to any derivative made by adding to, deleting, - * or substituting -- in part or in whole -- any of the components of the - * Original Version, by changing formats or by porting the Font Software to a - * new environment. - * - * "Author" refers to any designer, engineer, programmer, technical - * writer or other person who contributed to the Font Software. - * - * PERMISSION & CONDITIONS - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of the Font Software, to use, study, copy, merge, embed, modify, - * redistribute, and sell modified and unmodified copies of the Font - * Software, subject to the following conditions: - * - * 1) Neither the Font Software nor any of its individual components, - * in Original or Modified Versions, may be sold by itself. - * - * 2) Original or Modified Versions of the Font Software may be bundled, - * redistributed and/or sold with any software, provided that each copy - * contains the above copyright notice and this license. These can be - * included either as stand-alone text files, human-readable headers or - * in the appropriate machine-readable metadata fields within text or - * binary files as long as those fields can be easily viewed by the user. - * - * 3) No Modified Version of the Font Software may use the Reserved Font - * Name(s) unless explicit written permission is granted by the corresponding - * Copyright Holder. This restriction only applies to the primary font name as - * presented to the users. - * - * 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font - * Software shall not be used to promote, endorse or advertise any - * Modified Version, except to acknowledge the contribution(s) of the - * Copyright Holder(s) and the Author(s) or with their explicit written - * permission. - * - * 5) The Font Software, modified or unmodified, in part or in whole, - * must be distributed entirely under this license, and must not be - * distributed under any other license. The requirement for fonts to - * remain under this license does not apply to any document created - * using the Font Software. - * - * TERMINATION - * This license becomes null and void if any of the above conditions are - * not met. - * - * DISCLAIMER - * THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT - * OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL - * DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM - * OTHER DEALINGS IN THE FONT SOFTWARE. - */ - diff --git a/lib/rdoc/generator/template/darkfish/rdoc.css b/lib/rdoc/generator/template/darkfish/rdoc.css deleted file mode 100644 index 2f4dca7e08..0000000000 --- a/lib/rdoc/generator/template/darkfish/rdoc.css +++ /dev/null @@ -1,590 +0,0 @@ -/* - * "Darkfish" Rdoc CSS - * $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $ - * - * Author: Michael Granger - * - */ - -/* vim: ft=css et sw=2 ts=2 sts=2 */ -/* Base Green is: #6C8C22 */ - -* { padding: 0; margin: 0; } - -body { - background: #fafafa; - font-family: Lato, sans-serif; - font-weight: 300; -} - -h1 span, -h2 span, -h3 span, -h4 span, -h5 span, -h6 span { - position: relative; - - display: none; - padding-left: 1em; - line-height: 0; - vertical-align: baseline; - font-size: 10px; -} - -h1 span { top: -1.3em; } -h2 span { top: -1.2em; } -h3 span { top: -1.0em; } -h4 span { top: -0.8em; } -h5 span { top: -0.5em; } -h6 span { top: -0.5em; } - -h1:hover span, -h2:hover span, -h3:hover span, -h4:hover span, -h5:hover span, -h6:hover span { - display: inline; -} - -:link, -:visited { - color: #6C8C22; - text-decoration: none; -} - -:link:hover, -:visited:hover { - border-bottom: 1px dotted #6C8C22; -} - -code, -pre { - font-family: "Source Code Pro", Monaco, monospace; -} - -/* @group Generic Classes */ - -.initially-hidden { - display: none; -} - -#search-field { - width: 98%; - background: white; - border: none; - height: 1.5em; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - text-align: left; -} -#search-field:focus { - background: #f1edba; -} -#search-field:-moz-placeholder, -#search-field::-webkit-input-placeholder { - font-weight: bold; - color: #666; -} - -.missing-docs { - font-size: 120%; - background: white url(images/wrench_orange.png) no-repeat 4px center; - color: #ccc; - line-height: 2em; - border: 1px solid #d00; - opacity: 1; - padding-left: 20px; - text-indent: 24px; - letter-spacing: 3px; - font-weight: bold; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; -} - -.target-section { - border: 2px solid #dcce90; - border-left-width: 8px; - padding: 0 1em; - background: #fff3c2; -} - -/* @end */ - -/* @group Index Page, Standalone file pages */ -.table-of-contents ul { - margin: 1em; - list-style: none; -} - -.table-of-contents ul ul { - margin-top: 0.25em; -} - -.table-of-contents ul :link, -.table-of-contents ul :visited { - font-size: 16px; -} - -.table-of-contents li { - margin-bottom: 0.25em; -} - -.table-of-contents li .toc-toggle { - width: 16px; - height: 16px; - background: url(images/add.png) no-repeat; -} - -.table-of-contents li .toc-toggle.open { - background: url(images/delete.png) no-repeat; -} - -/* @end */ - -/* @group Top-Level Structure */ - -nav { - float: left; - width: 260px; - font-family: Helvetica, sans-serif; - font-size: 14px; -} - -main { - display: block; - margin: 0 2em 5em 260px; - padding-left: 20px; - min-width: 340px; - font-size: 16px; -} - -main h1, -main h2, -main h3, -main h4, -main h5, -main h6 { - font-family: Helvetica, sans-serif; -} - -.table-of-contents main { - margin-left: 2em; -} - -#validator-badges { - clear: both; - margin: 1em 1em 2em; - font-size: smaller; -} - -/* @end */ - -/* @group navigation */ -nav { - margin-bottom: 1em; -} - -nav .nav-section { - margin-top: 2em; - border-top: 2px solid #aaa; - font-size: 90%; - overflow: hidden; -} - -nav h2 { - margin: 0; - padding: 2px 8px 2px 8px; - background-color: #e8e8e8; - color: #555; - font-size: 125%; - text-align: center; -} - -nav h3, -#table-of-contents-navigation { - margin: 0; - padding: 2px 8px 2px 8px; - text-align: right; - background-color: #e8e8e8; - color: #555; -} - -nav ul, -nav dl, -nav p { - padding: 4px 8px 0; - list-style: none; -} - -#project-navigation .nav-section { - margin: 0; - border-top: 0; -} - -#home-section h2 { - text-align: center; -} - -#table-of-contents-navigation { - font-size: 1.2em; - font-weight: bold; - text-align: center; -} - -#search-section { - margin-top: 0; - border-top: 0; -} - -#search-field-wrapper { - border-top: 1px solid #aaa; - border-bottom: 1px solid #aaa; - padding: 3px 8px; - background-color: #e8e8e8; - color: #555; -} - -ul.link-list li { - white-space: nowrap; - line-height: 1.4em; -} - -ul.link-list .type { - font-size: 8px; - text-transform: uppercase; - color: white; - background: #969696; - padding: 2px 4px; - -webkit-border-radius: 5px; -} - -.calls-super { - background: url(images/arrow_up.png) no-repeat right center; -} - -/* @end */ - -/* @group Documentation Section */ -main { - color: #333; -} - -main > h1:first-child, -main > h2:first-child, -main > h3:first-child, -main > h4:first-child, -main > h5:first-child, -main > h6:first-child { - margin-top: 0px; -} - -main sup { - vertical-align: super; - font-size: 0.8em; -} - -/* The heading with the class name */ -main h1[class] { - margin-top: 0; - margin-bottom: 1em; - font-size: 2em; - color: #6C8C22; -} - -main h1 { - margin: 2em 0 0.5em; - font-size: 1.7em; -} - -main h2 { - margin: 2em 0 0.5em; - font-size: 1.5em; -} - -main h3 { - margin: 2em 0 0.5em; - font-size: 1.2em; -} - -main h4 { - margin: 2em 0 0.5em; - font-size: 1.1em; -} - -main h5 { - margin: 2em 0 0.5em; - font-size: 1em; -} - -main h6 { - margin: 2em 0 0.5em; - font-size: 1em; -} - -main p { - margin: 0 0 0.5em; - line-height: 1.4em; -} - -main pre { - margin: 1.2em 0.5em; - padding: 1em; - font-size: 0.8em; -} - -main hr { - margin: 1.5em 1em; - border: 2px solid #ddd; -} - -main blockquote { - margin: 0 2em 1.2em 1.2em; - padding-left: 0.5em; - border-left: 2px solid #ddd; -} - -main ol, -main ul { - margin: 1em 2em; -} - -main li > p { - margin-bottom: 0.5em; -} - -main dl { - margin: 1em 0.5em; -} - -main dt { - margin-bottom: 0.5em; - font-weight: bold; -} - -main dd { - margin: 0 1em 1em 0.5em; -} - -main header h2 { - margin-top: 2em; - border-width: 0; - border-top: 4px solid #bbb; - font-size: 130%; -} - -main header h3 { - margin: 2em 0 1.5em; - border-width: 0; - border-top: 3px solid #bbb; - font-size: 120%; -} - -.documentation-section-title { - position: relative; -} -.documentation-section-title .section-click-top { - position: absolute; - top: 6px; - left: 12px; - font-size: 10px; - color: #9b9877; - visibility: hidden; - padding-left: 0.5px; -} - -.documentation-section-title:hover .section-click-top { - visibility: visible; -} - -.constants-list > dl { - margin: 1em 0 2em; - border: 0; -} - -.constants-list > dl dt { - margin-bottom: 0.75em; - padding-left: 0; - font-family: "Source Code Pro", Monaco, monospace; - font-size: 110%; -} - -.constants-list > dl dt a { - color: inherit; -} - -.constants-list > dl dd { - margin: 0 0 2em 0; - padding: 0; - color: #666; -} - -.documentation-section h2 { - position: relative; -} - -.documentation-section h2 a { - position: absolute; - top: 8px; - right: 10px; - font-size: 12px; - color: #9b9877; - visibility: hidden; -} - -.documentation-section h2:hover a { - visibility: visible; -} - -/* @group Method Details */ - -main .method-source-code { - display: none; -} - -main .method-description .method-calls-super { - color: #333; - font-weight: bold; -} - -main .method-detail { - margin-bottom: 2.5em; - cursor: pointer; -} - -main .method-detail:target { - margin-left: -10px; - border-left: 10px solid #f1edba; -} - -main .method-heading { - position: relative; - font-family: "Source Code Pro", Monaco, monospace; - font-size: 110%; - font-weight: bold; - color: #333; -} -main .method-heading :link, -main .method-heading :visited { - color: inherit; -} -main .method-click-advice { - position: absolute; - top: 2px; - right: 5px; - font-size: 12px; - color: #9b9877; - visibility: hidden; - padding-right: 20px; - line-height: 20px; - background: url(images/zoom.png) no-repeat right top; -} -main .method-heading:hover .method-click-advice { - visibility: visible; -} - -main .method-alias .method-heading { - color: #666; -} - -main .method-description, -main .aliases { - margin-top: 0.75em; - color: #333; -} - -main .aliases { - padding-top: 4px; - font-style: italic; - cursor: default; -} -main .method-description ul { - margin-left: 1.5em; -} - -main #attribute-method-details .method-detail:hover { - background-color: transparent; - cursor: default; -} -main .attribute-access-type { - text-transform: uppercase; - padding: 0 1em; -} -/* @end */ - -/* @end */ - -/* @group Source Code */ - -pre { - margin: 0.5em 0; - border: 1px dashed #999; - padding: 0.5em; - background: #262626; - color: white; - overflow: auto; -} - -.ruby-constant { color: #7fffd4; background: transparent; } -.ruby-keyword { color: #00ffff; background: transparent; } -.ruby-ivar { color: #eedd82; background: transparent; } -.ruby-operator { color: #00ffee; background: transparent; } -.ruby-identifier { color: #ffdead; background: transparent; } -.ruby-node { color: #ffa07a; background: transparent; } -.ruby-comment { color: #dc0000; background: transparent; } -.ruby-regexp { color: #ffa07a; background: transparent; } -.ruby-value { color: #7fffd4; background: transparent; } - -/* @end */ - - -/* @group search results */ -#search-results { - font-family: Lato, sans-serif; - font-weight: 300; -} - -#search-results .search-match { - font-family: Helvetica, sans-serif; - font-weight: normal; -} - -#search-results .search-selected { - background: #e8e8e8; - border-bottom: 1px solid transparent; -} - -#search-results li { - list-style: none; - border-bottom: 1px solid #aaa; - margin-bottom: 0.5em; -} - -#search-results li:last-child { - border-bottom: none; - margin-bottom: 0; -} - -#search-results li p { - padding: 0; - margin: 0.5em; -} - -#search-results .search-namespace { - font-weight: bold; -} - -#search-results li em { - background: yellow; - font-style: normal; -} - -#search-results pre { - margin: 0.5em; - font-family: "Source Code Pro", Monaco, monospace; -} - -/* @end */ - diff --git a/lib/rdoc/known_classes.rb b/lib/rdoc/known_classes.rb index a04068a435..ddc932c7c0 100644 --- a/lib/rdoc/known_classes.rb +++ b/lib/rdoc/known_classes.rb @@ -59,6 +59,7 @@ module RDoc "rb_eZeroDivError" => "ZeroDivError", "rb_mComparable" => "Comparable", + "rb_mDL" => "DL", "rb_mEnumerable" => "Enumerable", "rb_mErrno" => "Errno", "rb_mFConst" => "File::Constants", diff --git a/lib/rdoc/markdown.rb b/lib/rdoc/markdown.rb index 63c9a9076f..2a24387ef4 100644 --- a/lib/rdoc/markdown.rb +++ b/lib/rdoc/markdown.rb @@ -2822,6 +2822,172 @@ class RDoc::Markdown return _tmp end + # HtmlOpenAnchor = "<" Spnl ("a" | "A") Spnl HtmlAttribute* ">" + def _HtmlOpenAnchor + + _save = self.pos + while true # sequence + _tmp = match_string("<") + unless _tmp + self.pos = _save + break + end + _tmp = apply(:_Spnl) + unless _tmp + self.pos = _save + break + end + + _save1 = self.pos + while true # choice + _tmp = match_string("a") + break if _tmp + self.pos = _save1 + _tmp = match_string("A") + break if _tmp + self.pos = _save1 + break + end # end choice + + unless _tmp + self.pos = _save + break + end + _tmp = apply(:_Spnl) + unless _tmp + self.pos = _save + break + end + while true + _tmp = apply(:_HtmlAttribute) + break unless _tmp + end + _tmp = true + unless _tmp + self.pos = _save + break + end + _tmp = match_string(">") + unless _tmp + self.pos = _save + end + break + end # end sequence + + set_failed_rule :_HtmlOpenAnchor unless _tmp + return _tmp + end + + # HtmlCloseAnchor = "<" Spnl "/" ("a" | "A") Spnl ">" + def _HtmlCloseAnchor + + _save = self.pos + while true # sequence + _tmp = match_string("<") + unless _tmp + self.pos = _save + break + end + _tmp = apply(:_Spnl) + unless _tmp + self.pos = _save + break + end + _tmp = match_string("/") + unless _tmp + self.pos = _save + break + end + + _save1 = self.pos + while true # choice + _tmp = match_string("a") + break if _tmp + self.pos = _save1 + _tmp = match_string("A") + break if _tmp + self.pos = _save1 + break + end # end choice + + unless _tmp + self.pos = _save + break + end + _tmp = apply(:_Spnl) + unless _tmp + self.pos = _save + break + end + _tmp = match_string(">") + unless _tmp + self.pos = _save + end + break + end # end sequence + + set_failed_rule :_HtmlCloseAnchor unless _tmp + return _tmp + end + + # HtmlAnchor = HtmlOpenAnchor (HtmlAnchor | !HtmlCloseAnchor .)* HtmlCloseAnchor + def _HtmlAnchor + + _save = self.pos + while true # sequence + _tmp = apply(:_HtmlOpenAnchor) + unless _tmp + self.pos = _save + break + end + while true + + _save2 = self.pos + while true # choice + _tmp = apply(:_HtmlAnchor) + break if _tmp + self.pos = _save2 + + _save3 = self.pos + while true # sequence + _save4 = self.pos + _tmp = apply(:_HtmlCloseAnchor) + _tmp = _tmp ? nil : true + self.pos = _save4 + unless _tmp + self.pos = _save3 + break + end + _tmp = get_byte + unless _tmp + self.pos = _save3 + end + break + end # end sequence + + break if _tmp + self.pos = _save2 + break + end # end choice + + break unless _tmp + end + _tmp = true + unless _tmp + self.pos = _save + break + end + _tmp = apply(:_HtmlCloseAnchor) + unless _tmp + self.pos = _save + end + break + end # end sequence + + set_failed_rule :_HtmlAnchor unless _tmp + return _tmp + end + # HtmlBlockOpenAddress = "<" Spnl ("address" | "ADDRESS") Spnl HtmlAttribute* ">" def _HtmlBlockOpenAddress @@ -8289,11 +8455,14 @@ class RDoc::Markdown return _tmp end - # HtmlBlockInTags = (HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript) + # HtmlBlockInTags = (HtmlAnchor | HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript) def _HtmlBlockInTags _save = self.pos while true # choice + _tmp = apply(:_HtmlAnchor) + break if _tmp + self.pos = _save _tmp = apply(:_HtmlBlockAddress) break if _tmp self.pos = _save @@ -15120,7 +15289,7 @@ class RDoc::Markdown self.pos = _save break end - @result = begin; + @result = begin; ref = [:inline, @note_order.length] @footnotes[ref] = paragraph a @@ -15748,6 +15917,9 @@ class RDoc::Markdown Rules[:_Enumerator] = rule_info("Enumerator", "@NonindentSpace [0-9]+ \".\" @Spacechar+") Rules[:_OrderedList] = rule_info("OrderedList", "&Enumerator (ListTight | ListLoose):a { RDoc::Markup::List.new(:NUMBER, *a) }") Rules[:_ListBlockLine] = rule_info("ListBlockLine", "!@BlankLine !(Indent? (Bullet | Enumerator)) !HorizontalRule OptionallyIndentedLine") + Rules[:_HtmlOpenAnchor] = rule_info("HtmlOpenAnchor", "\"<\" Spnl (\"a\" | \"A\") Spnl HtmlAttribute* \">\"") + Rules[:_HtmlCloseAnchor] = rule_info("HtmlCloseAnchor", "\"<\" Spnl \"/\" (\"a\" | \"A\") Spnl \">\"") + Rules[:_HtmlAnchor] = rule_info("HtmlAnchor", "HtmlOpenAnchor (HtmlAnchor | !HtmlCloseAnchor .)* HtmlCloseAnchor") Rules[:_HtmlBlockOpenAddress] = rule_info("HtmlBlockOpenAddress", "\"<\" Spnl (\"address\" | \"ADDRESS\") Spnl HtmlAttribute* \">\"") Rules[:_HtmlBlockCloseAddress] = rule_info("HtmlBlockCloseAddress", "\"<\" Spnl \"/\" (\"address\" | \"ADDRESS\") Spnl \">\"") Rules[:_HtmlBlockAddress] = rule_info("HtmlBlockAddress", "HtmlBlockOpenAddress (HtmlBlockAddress | !HtmlBlockCloseAddress .)* HtmlBlockCloseAddress") @@ -15847,7 +16019,7 @@ class RDoc::Markdown Rules[:_HtmlBlockOpenScript] = rule_info("HtmlBlockOpenScript", "\"<\" Spnl (\"script\" | \"SCRIPT\") Spnl HtmlAttribute* \">\"") Rules[:_HtmlBlockCloseScript] = rule_info("HtmlBlockCloseScript", "\"<\" Spnl \"/\" (\"script\" | \"SCRIPT\") Spnl \">\"") Rules[:_HtmlBlockScript] = rule_info("HtmlBlockScript", "HtmlBlockOpenScript (!HtmlBlockCloseScript .)* HtmlBlockCloseScript") - Rules[:_HtmlBlockInTags] = rule_info("HtmlBlockInTags", "(HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript)") + Rules[:_HtmlBlockInTags] = rule_info("HtmlBlockInTags", "(HtmlAnchor | HtmlBlockAddress | HtmlBlockBlockquote | HtmlBlockCenter | HtmlBlockDir | HtmlBlockDiv | HtmlBlockDl | HtmlBlockFieldset | HtmlBlockForm | HtmlBlockH1 | HtmlBlockH2 | HtmlBlockH3 | HtmlBlockH4 | HtmlBlockH5 | HtmlBlockH6 | HtmlBlockMenu | HtmlBlockNoframes | HtmlBlockNoscript | HtmlBlockOl | HtmlBlockP | HtmlBlockPre | HtmlBlockTable | HtmlBlockUl | HtmlBlockDd | HtmlBlockDt | HtmlBlockFrameset | HtmlBlockLi | HtmlBlockTbody | HtmlBlockTd | HtmlBlockTfoot | HtmlBlockTh | HtmlBlockThead | HtmlBlockTr | HtmlBlockScript)") Rules[:_HtmlBlock] = rule_info("HtmlBlock", "< (HtmlBlockInTags | HtmlComment | HtmlBlockSelfClosing | HtmlUnclosed) > @BlankLine+ { if html? then RDoc::Markup::Raw.new text end }") Rules[:_HtmlUnclosed] = rule_info("HtmlUnclosed", "\"<\" Spnl HtmlUnclosedType Spnl HtmlAttribute* Spnl \">\"") Rules[:_HtmlUnclosedType] = rule_info("HtmlUnclosedType", "(\"HR\" | \"hr\")") diff --git a/lib/rdoc/markup/to_html.rb b/lib/rdoc/markup/to_html.rb index 823b023e72..2b1216ef2a 100644 --- a/lib/rdoc/markup/to_html.rb +++ b/lib/rdoc/markup/to_html.rb @@ -286,7 +286,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter @res << to_html(heading.text) unless @options.pipe then @res << "" - @res << " " + @res << " " end @res << "\n" end @@ -379,11 +379,12 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter end ## - # Returns true if Ripper is available it can create a sexp from +text+ + # Returns true if text is valid ruby syntax def parseable? text - text =~ /\b(def|class|module|require) |=>|\{\s?\||do \|/ and - text !~ /<%|%>/ + eval("BEGIN {return true}\n#{text}") + rescue SyntaxError + false end ## diff --git a/lib/rdoc/markup/to_label.rb b/lib/rdoc/markup/to_label.rb index ace89c324a..6fbe4a3dbd 100644 --- a/lib/rdoc/markup/to_label.rb +++ b/lib/rdoc/markup/to_label.rb @@ -31,7 +31,7 @@ class RDoc::Markup::ToLabel < RDoc::Markup::Formatter def convert text label = convert_flow @am.flow text - CGI.escape label + CGI.escape(label).gsub('%', '-').sub(/^-/, '') end ## diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb index dd3ba5efdb..fd336f5f5b 100644 --- a/lib/rdoc/parser/c.rb +++ b/lib/rdoc/parser/c.rb @@ -745,11 +745,11 @@ class RDoc::Parser::C < RDoc::Parser elsif @content =~ %r%Document-(?:class|module):\s+#{class_name}\s*? (?:<\s+[:,\w]+)?\n((?>.*?\*/))%xm then comment = "/*\n#{$1}" - elsif @content =~ %r%.*((?>/\*.*?\*/\s+)) - ([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(#{class_name})"%xm then + elsif @content =~ %r%((?>/\*.*?\*/\s+)) + ([\w\.\s]+\s* = \s+)?rb_define_(class|module)[\t (]*?"(#{class_name})"%xm then comment = $1 - elsif @content =~ %r%.*((?>/\*.*?\*/\s+)) - ([\w\.\s]+\s* = \s+)?rb_define_(class|module)_under.*?"(#{class_name.split('::').last})"%xm then + elsif @content =~ %r%((?>/\*.*?\*/\s+)) + ([\w\. \t]+ = \s+)?rb_define_(class|module)_under[\t\w, (]*?"(#{class_name.split('::').last})"%xm then comment = $1 else comment = '' diff --git a/lib/rdoc/rd/block_parser.rb b/lib/rdoc/rd/block_parser.rb index a495ca4e1e..284fb07c84 100644 --- a/lib/rdoc/rd/block_parser.rb +++ b/lib/rdoc/rd/block_parser.rb @@ -1,6 +1,6 @@ # # DO NOT MODIFY!!!! -# This file is automatically generated by Racc 1.4.11 +# This file is automatically generated by Racc 1.4.12 # from Racc grammer file "". # @@ -677,54 +677,54 @@ Racc_debug_parser = false # reduce 0 omitted def _reduce_1(val, _values, result) - result = RDoc::Markup::Document.new(*val[0]) + result = RDoc::Markup::Document.new(*val[0]) result end def _reduce_2(val, _values, result) - raise ParseError, "file empty" + raise ParseError, "file empty" result end def _reduce_3(val, _values, result) - result = val[0].concat val[1] + result = val[0].concat val[1] result end def _reduce_4(val, _values, result) - result = val[0] + result = val[0] result end def _reduce_5(val, _values, result) - result = val + result = val result end def _reduce_6(val, _values, result) - result = val + result = val result end # reduce 7 omitted def _reduce_8(val, _values, result) - result = val + result = val result end def _reduce_9(val, _values, result) - result = val + result = val result end def _reduce_10(val, _values, result) - result = [RDoc::Markup::BlankLine.new] + result = [RDoc::Markup::BlankLine.new] result end def _reduce_11(val, _values, result) - result = val[0].parts + result = val[0].parts result end @@ -732,30 +732,30 @@ def _reduce_12(val, _values, result) # val[0] is like [level, title] title = @inline_parser.parse(val[0][1]) result = RDoc::Markup::Heading.new(val[0][0], title) - + result end def _reduce_13(val, _values, result) result = RDoc::Markup::Include.new val[0], @include_path - + result end def _reduce_14(val, _values, result) # val[0] is Array of String result = paragraph val[0] - + result end def _reduce_15(val, _values, result) - result << val[1].rstrip + result << val[1].rstrip result end def _reduce_16(val, _values, result) - result = [val[0].rstrip] + result = [val[0].rstrip] result end @@ -766,7 +766,7 @@ def _reduce_17(val, _values, result) # imform to lexer. @in_verbatim = false - + result end @@ -777,25 +777,25 @@ def _reduce_18(val, _values, result) # imform to lexer. @in_verbatim = false - + result end def _reduce_19(val, _values, result) result << val[1] - + result end def _reduce_20(val, _values, result) result.concat val[2] - + result end def _reduce_21(val, _values, result) result << "\n" - + result end @@ -803,7 +803,7 @@ def _reduce_22(val, _values, result) result = val # inform to lexer. @in_verbatim = true - + result end @@ -817,89 +817,89 @@ end def _reduce_27(val, _values, result) result = val[0] - + result end def _reduce_28(val, _values, result) result = val[1] - + result end def _reduce_29(val, _values, result) result = val[1].push(val[2]) - + result end def _reduce_30(val, _values, result) - result = val[0] << val[1] + result = val[0] << val[1] result end def _reduce_31(val, _values, result) - result = [val[0]] + result = [val[0]] result end def _reduce_32(val, _values, result) result = RDoc::Markup::List.new :BULLET, *val[0] - + result end def _reduce_33(val, _values, result) - result.push(val[1]) + result.push(val[1]) result end def _reduce_34(val, _values, result) - result = val + result = val result end def _reduce_35(val, _values, result) result = RDoc::Markup::ListItem.new nil, val[0], *val[1] - + result end def _reduce_36(val, _values, result) result = RDoc::Markup::List.new :NUMBER, *val[0] - + result end def _reduce_37(val, _values, result) - result.push(val[1]) + result.push(val[1]) result end def _reduce_38(val, _values, result) - result = val + result = val result end def _reduce_39(val, _values, result) result = RDoc::Markup::ListItem.new nil, val[0], *val[1] - + result end def _reduce_40(val, _values, result) result = RDoc::Markup::List.new :NOTE, *val[0] - + result end def _reduce_41(val, _values, result) - result.push(val[1]) + result.push(val[1]) result end def _reduce_42(val, _values, result) - result = val + result = val result end @@ -907,77 +907,77 @@ def _reduce_43(val, _values, result) term = @inline_parser.parse val[0].strip result = RDoc::Markup::ListItem.new term, *val[1] - + result end def _reduce_44(val, _values, result) result = RDoc::Markup::List.new :LABEL, *val[0] - + result end def _reduce_45(val, _values, result) - result.push(val[1]) + result.push(val[1]) result end def _reduce_46(val, _values, result) - result = val + result = val result end def _reduce_47(val, _values, result) result = RDoc::Markup::ListItem.new "#{val[0].strip}", *val[1] - + result end def _reduce_48(val, _values, result) result = [val[1]].concat(val[2]) - + result end def _reduce_49(val, _values, result) result = [val[1]] - + result end def _reduce_50(val, _values, result) result = val[2] - + result end def _reduce_51(val, _values, result) result = [] - + result end def _reduce_52(val, _values, result) - result.concat val[1] + result.concat val[1] result end # reduce 53 omitted def _reduce_54(val, _values, result) - result = val + result = val result end def _reduce_55(val, _values, result) - result = val + result = val result end # reduce 56 omitted def _reduce_57(val, _values, result) - result = [] + result = [] result end @@ -991,58 +991,58 @@ end def _reduce_62(val, _values, result) result = paragraph [val[0]].concat(val[1]) - + result end def _reduce_63(val, _values, result) result = paragraph [val[0]] - + result end def _reduce_64(val, _values, result) result = paragraph [val[0]].concat(val[1]) - + result end def _reduce_65(val, _values, result) result = paragraph [val[0]] - + result end def _reduce_66(val, _values, result) result = [val[0]].concat(val[1]) - + result end def _reduce_67(val, _values, result) - result.concat val[1] + result.concat val[1] result end def _reduce_68(val, _values, result) - result = val[1] + result = val[1] result end def _reduce_69(val, _values, result) - result = val + result = val result end # reduce 70 omitted def _reduce_71(val, _values, result) - result = [] + result = [] result end def _reduce_72(val, _values, result) - result = [] + result = [] result end diff --git a/lib/rdoc/rd/inline_parser.rb b/lib/rdoc/rd/inline_parser.rb index 80d029cc21..9c5db9348c 100644 --- a/lib/rdoc/rd/inline_parser.rb +++ b/lib/rdoc/rd/inline_parser.rb @@ -1,6 +1,6 @@ # # DO NOT MODIFY!!!! -# This file is automatically generated by Racc 1.4.11 +# This file is automatically generated by Racc 1.4.12 # from Racc grammer file "". # @@ -732,12 +732,12 @@ Racc_debug_parser = false # reduce 1 omitted def _reduce_2(val, _values, result) - result.append val[1] + result.append val[1] result end def _reduce_3(val, _values, result) - result = val[0] + result = val[0] result end @@ -762,28 +762,28 @@ end def _reduce_13(val, _values, result) content = val[1] result = inline "#{content}", content - + result end def _reduce_14(val, _values, result) content = val[1] result = inline "#{content}", content - + result end def _reduce_15(val, _values, result) content = val[1] result = inline "+#{content}+", content - + result end def _reduce_16(val, _values, result) content = val[1] result = inline "#{content}", content - + result end @@ -791,13 +791,13 @@ def _reduce_17(val, _values, result) label = val[1] @block_parser.add_label label.reference result = "#{label}" - + result end def _reduce_18(val, _values, result) result = "{#{val[1]}}[#{val[2].join}]" - + result end @@ -805,13 +805,13 @@ def _reduce_19(val, _values, result) scheme, inline = val[1] result = "{#{inline}}[#{scheme}#{inline.reference}]" - + result end def _reduce_20(val, _values, result) result = [nil, inline(val[1])] - + result end @@ -820,25 +820,25 @@ def _reduce_21(val, _values, result) 'rdoc-label:', inline("#{val[0].reference}/#{val[1].reference}") ] - + result end def _reduce_22(val, _values, result) result = ['rdoc-label:', val[0].reference] - + result end def _reduce_23(val, _values, result) result = ['rdoc-label:', "#{val[0].reference}/"] - + result end def _reduce_24(val, _values, result) result = [nil, inline(val[1])] - + result end @@ -847,92 +847,92 @@ def _reduce_25(val, _values, result) 'rdoc-label:', inline("#{val[0].reference}/#{val[1].reference}") ] - + result end def _reduce_26(val, _values, result) result = ['rdoc-label:', val[0]] - + result end def _reduce_27(val, _values, result) ref = val[0].reference result = ['rdoc-label:', inline(ref, "#{ref}/")] - + result end # reduce 28 omitted def _reduce_29(val, _values, result) - result = val[1] + result = val[1] result end def _reduce_30(val, _values, result) - result = val[1] + result = val[1] result end def _reduce_31(val, _values, result) result = inline val[0] - + result end def _reduce_32(val, _values, result) result = inline "\"#{val[1]}\"" - + result end def _reduce_33(val, _values, result) result = inline val[0] - + result end def _reduce_34(val, _values, result) result = inline "\"#{val[1]}\"" - + result end # reduce 35 omitted def _reduce_36(val, _values, result) - result = val[1] + result = val[1] result end def _reduce_37(val, _values, result) - result = inline val[1] + result = inline val[1] result end def _reduce_38(val, _values, result) result = val[0].append val[1] - + result end def _reduce_39(val, _values, result) result = val[0].append val[1] - + result end def _reduce_40(val, _values, result) result = val[0] - + result end def _reduce_41(val, _values, result) result = inline val[0] - + result end @@ -940,25 +940,25 @@ end def _reduce_43(val, _values, result) result = val[0].append val[1] - + result end def _reduce_44(val, _values, result) result = inline val[0] - + result end def _reduce_45(val, _values, result) result = val[0].append val[1] - + result end def _reduce_46(val, _values, result) result = val[0] - + result end @@ -984,24 +984,24 @@ end def _reduce_57(val, _values, result) result = val[0] - + result end def _reduce_58(val, _values, result) result = inline val[0] - + result end def _reduce_59(val, _values, result) result = inline val[0] - + result end def _reduce_60(val, _values, result) - result << val[1] + result << val[1] result end @@ -1009,7 +1009,7 @@ end def _reduce_62(val, _values, result) result << val[1] - + result end @@ -1017,7 +1017,7 @@ end def _reduce_64(val, _values, result) result << val[1] - + result end @@ -1048,7 +1048,7 @@ end # reduce 77 omitted def _reduce_78(val, _values, result) - result << val[1] + result << val[1] result end @@ -1099,13 +1099,13 @@ end def _reduce_101(val, _values, result) index = @block_parser.add_footnote val[1].rdoc result = "{*#{index}}[rdoc-label:foottext-#{index}:footmark-#{index}]" - + result end def _reduce_102(val, _values, result) result = inline "#{val[1]}", val[1] - + result end @@ -1122,7 +1122,7 @@ end # reduce 108 omitted def _reduce_109(val, _values, result) - result << val[1] + result << val[1] result end @@ -1130,24 +1130,24 @@ end def _reduce_111(val, _values, result) result = inline val[0] - + result end # reduce 112 omitted def _reduce_113(val, _values, result) - result = val[1] + result = val[1] result end def _reduce_114(val, _values, result) - result = val[1] + result = val[1] result end def _reduce_115(val, _values, result) - result = val[1] + result = val[1] result end @@ -1192,7 +1192,7 @@ end # reduce 135 omitted def _reduce_136(val, _values, result) - result << val[1] + result << val[1] result end diff --git a/lib/rdoc/ri/task.rb b/lib/rdoc/ri/task.rb new file mode 100644 index 0000000000..e545d4ac1e --- /dev/null +++ b/lib/rdoc/ri/task.rb @@ -0,0 +1,71 @@ +require 'rubygems' +begin + gem 'rdoc' +rescue Gem::LoadError +end unless defined?(RDoc) + +require 'rdoc/task' + +## +# RDoc::RI::Task creates ri data in ./.rdoc for your project. +# +# It contains the following tasks: +# +# [ri] +# Build ri data +# +# [clobber_ri] +# Delete ri data files. This target is automatically added to the main +# clobber target. +# +# [reri] +# Rebuild the ri data from scratch even if they are not out of date. +# +# Simple example: +# +# require 'rdoc/ri/task' +# +# RDoc::RI::Task.new do |ri| +# ri.main = 'README.rdoc' +# ri.rdoc_files.include 'README.rdoc', 'lib/**/*.rb' +# end +# +# For further configuration details see RDoc::Task. + +class RDoc::RI::Task < RDoc::Task + + DEFAULT_NAMES = { # :nodoc: + :clobber_rdoc => :clobber_ri, + :rdoc => :ri, + :rerdoc => :reri, + } + + ## + # Create an ri task with the given name. See RDoc::Task for documentation on + # setting names. + + def initialize name = DEFAULT_NAMES # :yield: self + super + end + + def clobber_task_description # :nodoc: + "Remove RI data files" + end + + ## + # Sets default task values + + def defaults + super + + @rdoc_dir = '.rdoc' + end + + def rdoc_task_description # :nodoc: + 'Build RI data files' + end + + def rerdoc_task_description # :nodoc: + 'Rebuild RI data files' + end +end diff --git a/lib/rdoc/single_class.rb b/lib/rdoc/single_class.rb index 9e77a65c73..358e1f38eb 100644 --- a/lib/rdoc/single_class.rb +++ b/lib/rdoc/single_class.rb @@ -10,6 +10,10 @@ class RDoc::SingleClass < RDoc::ClassModule superclass ? super + [superclass] : super end + def aref_prefix # :nodoc: + 'sclass' + end + ## # The definition of this singleton class, class << MyClassName diff --git a/lib/rdoc/stats.rb b/lib/rdoc/stats.rb index b5a21915b4..94fdd279c7 100644 --- a/lib/rdoc/stats.rb +++ b/lib/rdoc/stats.rb @@ -4,6 +4,8 @@ class RDoc::Stats + include RDoc::Text + ## # Output level for the coverage report @@ -438,6 +440,8 @@ class RDoc::Stats params = method.param_list + params = params.map { |param| param.gsub(/^\*\*?/, '') } + return 0, [] if params.empty? document = parse method.comment diff --git a/lib/rdoc/test_case.rb b/lib/rdoc/test_case.rb index 245e4ef1c5..4989516b7a 100644 --- a/lib/rdoc/test_case.rb +++ b/lib/rdoc/test_case.rb @@ -2,7 +2,7 @@ require 'rubygems' begin gem 'minitest', '~> 4.0' unless defined?(Test::Unit) -rescue NoMethodError +rescue NoMethodError, Gem::LoadError # for ruby tests end -- cgit v1.2.3