Commit graph

127 commits

Author SHA1 Message Date
Nobuyoshi Nakada
20f4f00764 [ruby/rdoc] [DOC] nodoc for probably internal methods
f7dd147a8c
2023-12-16 00:26:39 +09:00
Nobuyoshi Nakada
e15d690db1 [ruby/rdoc] [DOC] Add missing documents
e4c90340d0
2023-12-16 00:26:37 +09:00
Nobuyoshi Nakada
196c4aeb76 [ruby/rdoc] Place a space between certain character class letters only
1f568e049d
2023-11-27 15:58:31 +00:00
Nobuyoshi Nakada
9935512275 [ruby/rdoc] Fix TIDYLINK after braces
(https://github.com/ruby/rdoc/pull/1015)

TIDYLINK multi-word label should not include braces.

41ad3191e9
2023-11-14 07:59:56 +00:00
Benoit Daloze
df5330b04e [ruby/rdoc] Use a more portable way to check if code is parseable
* The same as used in irb: https://github.com/ruby/irb/pull/134/files
* This works on all Ruby implementations, unlike `return` in BEGIN which
  can be quite difficult to support.

d19f7c66fe
2023-07-29 15:31:48 +00:00
Petrik
0c55ef1150 [ruby/rdoc] Use flat_map for better performance
76192a280d
2023-06-14 23:47:25 +00:00
Vinicius Stock
a4d92475f6 [ruby/rdoc] Auto-correct trailing new lines
4b68c0728a
2023-06-03 01:42:29 +00:00
Nobuyoshi Nakada
32cc6301b3 [ruby/rdoc] [DOC] stop documenting fallback MatchData#match_length
Also empty document of `Object`.

ce32a3102b
2023-05-02 17:06:36 +00:00
Nobuyoshi Nakada
5b1db79129 [ruby/rdoc] Revert "Refactor RDoc::Markup::Parser#tokenize"
This reverts commit 41ceae93b3.

5d2c47e8b8
2022-11-27 19:46:12 +00:00
Nobuyoshi Nakada
21977b95e2 [ruby/rdoc] Refactor RDoc::Markup::Parser#tokenize
Make verbatims text or newline only, and simplify `build_verbatim`.

41ceae93b3
2022-11-27 17:24:38 +00:00
Nobuyoshi Nakada
511864d1a7 [ruby/rdoc] Refine regexp usages and reduce substring allocations
a976fb9d39
2022-11-27 16:35:08 +00:00
Nobuyoshi Nakada
586e18b946 [ruby/rdoc] Escape HYPERLINKs
ac35485be6
2022-10-07 12:09:22 +09:00
Nobuyoshi Nakada
9e3ab9da7f [ruby/rdoc] Escape RDOCLINKs
https://hackerone.com/reports/1187156

7cecf1efae
2022-10-07 12:09:21 +09:00
Nobuyoshi Nakada
deaa656608 [ruby/rdoc] Escape TIDYLINKs
https://hackerone.com/reports/1187156

1ad2dd3ca2
2022-10-07 12:09:20 +09:00
Nobuyoshi Nakada
75a53f6be0 [ruby/rdoc] Allow RDoc markups in table cells
b16d3f1727
2022-10-06 18:24:44 +09:00
Nobuyoshi Nakada
af265d73fb [ruby/rdoc] Fix blockquote with word in verbatim
75eee668a5
2022-07-30 11:04:11 +09:00
Nobuyoshi Nakada
f29f1d22c3 [ruby/rdoc] Fix formatting blockquote in verbatim
Reported at https://github.com/ruby/rdoc/pull/907#discussion_r932505816

86384ac7f9
2022-07-29 09:21:33 +09:00
Nobuyoshi Nakada
5397dd2e76 [ruby/rdoc] Apply matching word pairs to underscore-methods
Protected characters with `PROTECT_ATTR` should not have special
roles.

c318af0ea2
2022-04-14 16:37:14 +09:00
Peter Zhu
aaac279de0 [ruby/rdoc] Only parse valid URLs
Only valid characters for URLs should be used for generating URLs.

A list of valid characters can be found in sections 2.2 and 2.3 of IETF
RFC 3986 (https://www.ietf.org/rfc/rfc3986.txt).

2bd8fcdd4f
2022-04-13 22:25:33 +09:00
Yusuke Endoh
ae8a8b184e [ruby/rdoc] Prefer require 'cgi/util' instead of require 'cgi'
RDoc is using only CGI.escape, escapeHTML, and unescape.
We don't have to load the whole source code of cgi gem.

d096222cc2
2022-02-22 17:08:52 +09:00
Nobuyoshi Nakada
8013250136 [ruby/rdoc] Simplify attribute exclusiveness conditions
45e33c4b85
2022-02-09 22:22:46 +09:00
Mike Dalessio
7aec65add4 [ruby/rdoc] feat: add support for :category: on C functions
45c92005fe
2021-10-16 01:39:36 +09:00
Nobuyoshi Nakada
3dacc14fd3 [ruby/rdoc] Fix links without paths
424bd5db4d
2021-07-05 11:34:37 +09:00
Nobuyoshi Nakada
f88a9097a4 [ruby/rdoc] Fix for explicit http link
caf234665c
2021-07-05 11:34:35 +09:00
Nobuyoshi Nakada
7c8aa0a5d2 [ruby/rdoc] Allow a label in a link to another document text
85bb2d33bb
2021-07-05 11:34:33 +09:00
Nobuyoshi Nakada
64b991b0cd [ruby/rdoc] Links to document texts without "rdoc-ref:" prefix
While links to generated HTML from RDoc file needs to be prefixed
by "rdoc-ref:" currently, in case of explicit references this
seems just redundant.

Also GitHub RDoc support does not work with this prefix.

This patch lets links to such document texts (".rb", ".rdoc" and
".md" now) refer URLs generated by `RDoc::TopLevel#http_url`
without the prefix.

f18b27b69d
2021-04-03 01:22:09 +09:00
aycabta
61e1cf23ac [ruby/rdoc] Treat emphasis tags as excluding other notations
And exclusive notations don't exclude other exclusive notations.

b8baa9a435
2021-04-03 01:21:50 +09:00
aycabta
e84d275fe6 [ruby/rdoc] Treat other tags as word boundaries
8222f85a17
2021-04-03 01:21:38 +09:00
aycabta
54aa11efa8 [ruby/rdoc] Disable other notations in <code> tags
0cd3b55210
2021-04-03 01:21:12 +09:00
Nobuyoshi Nakada
3651f678a7 [ruby/rdoc] Support GFM table
9dc933df16
2021-03-16 15:47:27 +09:00
Nobuyoshi Nakada
3198e7abd7
Separate send into public_send and __send__ 2020-10-27 16:12:45 +09:00
hyrious
02951a45f0 [ruby/rdoc] Create link to unary operator methods correctly
54500cf12a
2020-07-22 02:35:12 +09:00
aycabta
f52a4690f8 [ruby/rdoc] Process crossref before tidylink
The crossref must be linked before tidylink because Klass.method[:sym] will be
processed as a tidylink first and will be broken.

0f47baf6d2
2020-05-24 23:47:24 +09:00
Nate Matykiewicz
c79f9ea606 [ruby/rdoc] Escape method names in HTML
The following is invalid HTML:
<a href="Array.html#method-i-3C-3C"><code><<</code></a></p>

Incorrect:
<code><<</code>

Correct:
<code>&lt;&lt;</code>

Fixes #761

b120d087f6
2020-05-24 23:47:24 +09:00
Nobuyoshi Nakada
2b7409a2f2
Specify explicit separator not to be affected by $; 2020-03-08 17:38:37 +09:00
Yusuke Endoh
bc1e2271af lib/rdoc/markup/parser.rb: remove a unused variable initialization 2019-08-19 10:07:05 +09:00
Hiroshi SHIBATA
79fe84edf5 Removed test_case files from lib directory. 2019-08-17 20:20:04 +09:00
Hiroshi SHIBATA
e87e10e5e7 Use test/unit instead of test-unit. Because test-unit is only provided standalone gem. 2019-08-16 06:07:11 +09:00
Nobuyoshi Nakada
1a5304228a Use test-unit instead of minitest
Minitest 6 will err `assert_equal` with `nil`.
https://github.com/seattlerb/minitest/issues/779
2019-08-16 06:07:11 +09:00
aycabta
64f9f512c5 Treat linking to Markdown label correctly 2019-08-16 06:02:45 +09:00
Yusuke Endoh
0a0760aa63 Refactor and improve performance of RDoc::Markup::Parser
This change introduces a wrapper of StringScanner that is aware of the
current position (column and lineno).
It has two advantages: faster and more modular.

The old code frequently runs `@input.byteslice(0, byte_offset).length`
to get the current position, but it was painfully slow.  This change
keeps track of the position at each scan, which reduces about half of
time of "Generating RI format into ..." in Ruby's `make rdoc`
(5.5 sec -> 3.0 sec).

And the old code used four instance variables (`@input`, `@line`,
`@line_pos`, and `@s`) to track the position.  This change factors them
out into MyStringScanner, so now only one variable (`@s`) is needed.
2019-08-16 06:02:45 +09:00
Maxime Lapointe
b67b07bd5b Fix links to headings
A previous change made the header's id be fully referenced (for the sidebar I believe) but this broke links to them.
This fixes the issue.
2019-07-14 17:46:16 +09:00
aycabta
18911e99d2 Merge RDoc 6.1.0.beta3 from upstream
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-08 17:39:52 +00:00
mame
03cde6c805 lib/rdoc/markup/: Remove wrong call to =~ against Array
`@res` is an Array, so `@res =~ /\n\z/` calls `Object#=~` which always
returns nil.
I guess it should be `@res.last =~ /\n\z/`, but the change causes test
failures.

This bug was found during work for removal of `Object#=~`.
[Feature #15231]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26 05:32:50 +00:00
nobu
b9ca9169ba Mark up code inside link text as <code>
Merged https://github.com/ruby/rdoc/pull/660

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-29 06:23:21 +00:00
aycabta
1b43644edc Merge rdoc-6.1.0.beta2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-17 06:28:20 +00:00
hsbt
95e213d354 Merge rdoc-6.1.0.beta1.
* https://github.com/ruby/rdoc/compare/v6.0.4...v6.1.0.beta1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-27 01:30:18 +00:00
hsbt
98c7058bf7 Merge RDoc 6.0.3 from upstream.
It fixed the several bugs that was found after RDoc 6 releasing.

From: SHIBATA Hiroshi <hsbt@ruby-lang.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-26 05:56:26 +00:00
hsbt
5551871086 Merge rdoc-6.0.0.beta4 from upstream.
It version applied `frozen_string_literal: true`

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-27 10:45:24 +00:00
hsbt
db6c51ec4f Merge rdoc-6.0.0.beta3.
* It version introduced did you mean? feature for ri command:
    https://github.com/ruby/rdoc/pull/533
  * Removed obbsoleted ruby_token.rbb.
    [Bug #13990][ruby-core:83180]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-10 02:01:00 +00:00