Commit graph

712 commits

Author SHA1 Message Date
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
Masafumi Koba
62b4983416 [ruby/rdoc] [DOC] Improve CSS for "toggle source" hovering over one more method signatures
This commit improves the behavior of showing the "toggle source" element on mouseover.

For example, when a method has one more signatures by using `:call-seq:`,

```ruby
# :call-seq:
#   foo {|element| ... } -> self
#   foo -> new_enumeration
def foo
end
```

The current CSS doesn't show "toggle source" even when hovering the second signature `foo -> new_enumeration`.
But this change will show "toggle source" always when hovering over any signature.

For details about the `.method-header` element, see `lib/rdoc/generator/template/darkfish/class.rhtml`:
0e060c69f5/lib/rdoc/generator/template/darkfish/class.rhtml (L101-L124)

For example, see https://docs.ruby-lang.org/en/3.2/Array.html#method-i-delete
2023-07-05 04:09:08 +00:00
Vinicius Stock
f9288fb585 [ruby/rdoc] Add source_code, homepage and changelog uris to gemspec metadata [ci skip]
b93687fdd0
2023-07-05 04:08:17 +00:00
gemmaro
62754503d8 [ruby/rdoc] [DOC] Fix to use KeyboardEvent.key over keyCode
663edc807c
2023-07-05 03:39:18 +00:00
gemmaro
77fa4787bd [ruby/rdoc] Add keydown event listener to focus on search field
db62e47df2
2023-07-05 03:37:28 +00:00
Petrik
0c55ef1150 [ruby/rdoc] Use flat_map for better performance
76192a280d
2023-06-14 23:47:25 +00:00
Hiroshi SHIBATA
6e93320c1b
Update RDoc::RD parsers generated by racc-1.7.1 2023-06-14 12:56:34 +09:00
Hiroshi SHIBATA
7ef1a2387e
Re-generate RDoc::RD parsers with racc-1.7.0 2023-06-08 10:20:32 +09:00
Vinicius Stock
a4d92475f6 [ruby/rdoc] Auto-correct trailing new lines
4b68c0728a
2023-06-03 01:42:29 +00:00
Masafumi Koba
94e5ecbbdd [ruby/rdoc] Improve <summary> CSS on sidebar
- Use a smaller font size for the toggle symbol. (Currently, it seems a little too large)
- Use the child combinator (`>`) to unify selectors.
- Use `margin-left` instead of whitespace within the `content` property.
- Use `::` instead of outdated `:` for the pseudo-element symbol.
  (See https://developer.mozilla.org/en-US/docs/Web/CSS/::before)

61ce0a7d75
2023-05-26 16:26:46 +00:00
Masafumi Koba
54b7ce0bff [ruby/rdoc] Improve layout CSS
- Use the `grid` property for the page layout.
  - https://caniuse.com/css-grid
- Adjust the `<main>` margin.
- Make the sidebar responsive and resizable.
  - https://caniuse.com/css-math-functions
  - https://caniuse.com/css-resize

Note all modern browsers support the new CSS properties and functions used by this change.

2db5097c41
2023-05-26 16:24:57 +00:00
zzak
8b2884c0b5 [ruby/rdoc] Isolate root dir if specified
This ensures only files from the root directory are chosen, in order to allow a clean build from outside the source directory.

f3b389aa9e
2023-05-06 07:39:24 +00:00
Nobuyoshi Nakada
40438fc4d3 [ruby/rdoc] Drop the support for 2.5 or earlier because of CVE-2021-31799
26136138aa
2023-05-05 14:01:50 +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
e47aa27dc7 [ruby/rdoc] Section may not have label
945f0cb3e9
2023-05-02 05:42:37 +00:00
Nobuyoshi Nakada
3833d0fee6 [ruby/rdoc] Fix references to nested label in table_of_contents
Fixes https://github.com/ruby/rdoc/pull/1000

291e2b7e8b
2023-05-02 04:19:46 +00:00
Nobuyoshi Nakada
c2871161b4 [ruby/rdoc] Fix polynominal backtracking
Fix https://github.com/ruby/rdoc/pull/995

1311ca8c50
2023-04-29 16:55:37 +00:00
Nobuyoshi Nakada
85a9fd1902 [ruby/rdoc] Fix polynominal backtracking
Fix https://github.com/ruby/rdoc/pull/995

adfa7db5b9
2023-04-29 16:55:36 +00:00
Nobuyoshi Nakada
cd65e4adca [ruby/rdoc] Use File.binread
987c609df9
2023-03-31 01:14:34 +00:00
Hiroshi SHIBATA
103a65316c
Regenerate parsers with racc-1.6.2 2023-03-03 13:46:04 +09:00
Hiroshi SHIBATA
d3d8cd304f Prefer to use File.readlines instead of IO.readlines 2023-02-27 18:49:18 +09:00
Étienne Barrié
bc101f0fc1 [ruby/rdoc] Fix RDoc::Parser::Ruby not being documented
The calls to require prevent the class from being documented.

76283fc42e
2023-02-21 19:32:14 +09:00
zzak
b171e99791 [ruby/rdoc] Actually execute RDoc document task for coverage
7e70d41585
2023-02-06 23:09:05 +00:00
zzak
da9ee7bcf3 [ruby/rdoc] Add newline before return
6d609cb64c

Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
2023-02-03 23:41:06 +00:00
zzak
e04d20bc48 [ruby/rdoc] Add rdoc:coverage default task
157fbaf575
2023-02-03 23:41:06 +00:00
Hiroshi SHIBATA
cc25e81fb7 Update generated version of racc on parser headers 2022-12-26 15:09:21 +09:00
Hiroshi SHIBATA
4cbd3e1944 Merge RDoc-6.5.0 2022-12-09 16:36:22 +09:00
Nobuyoshi Nakada
bda070f016
[ruby/rdoc] Fix =end delimiter
e1679fa7e4
2022-12-09 15:40:05 +09:00
Nobuyoshi Nakada
acd857b989
[ruby/rdoc] Non-RD part feature has not been imported to RDoc
fe0159de2f
2022-12-09 15:40:04 +09:00
Nobuyoshi Nakada
b749bc05d0
[ruby/rdoc] Use Tempfile
0b9dde5ab4
2022-12-09 15:40:04 +09:00
Hiroshi SHIBATA
d7b00b55a9 [ruby/rdoc] Bump version to 6.4.0
c5e7ee03ac
2022-12-05 04:59:54 +00:00
Nobuyoshi Nakada
f0c9d2a0c8 [ruby/rdoc] Fix =end delimiter
e1679fa7e4
2022-12-01 02:36:20 +09:00
Nobuyoshi Nakada
99cad3fccd [ruby/rdoc] Non-RD part feature has not been imported to RDoc
fe0159de2f
2022-12-01 02:36:20 +09:00
Nobuyoshi Nakada
c87b3ee671 [ruby/rdoc] Use Tempfile
0b9dde5ab4
2022-12-01 02:36:20 +09:00
Sven Riedel
e0901f46b7 [ruby/rdoc] Add --no-skipping-tests option
33925f885f
2022-11-28 04:36:29 +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
nick evans
29862ce273 [ruby/rdoc] Darkfish: group method call-seq in div.method-header
This way, custom CSS styles can be easily applied to the entire method
header at once.  Otherwise, it can be tricky to make a border that goes
around the entire set of method call-seq, but not the method
description.

5db4bce01e
2022-11-27 17:24:17 +00:00
nick evans
ae3817bc61 [ruby/rdoc] Darkfish: Nest sidebar ToC as a tree of headings
This uses `<details><summary>heading</summary><ul>nested</ul></detail>`,
similar to how the classes and pages lists are now nested.

e57beff287
2022-11-27 17:18:16 +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
1b67c58f41 [ruby/rdoc] Pull up handle_tab_width to RDoc::Parser
To share with the duplicate code in RDoc::Parser::Ruby#initialize.

27829ac119
2022-11-27 16:35:07 +00:00
Shugo Maeda
5129ca3e05 [ruby/rdoc] Delay require "readline" in case the terminal is in raw mode 2022-10-27 08:16:06 +00:00
Nobuyoshi Nakada
39909d8c18 [ruby/rdoc] Escape search results
https://hackerone.com/reports/1321358

2ebf8fd510
2022-10-07 12:12:09 +09:00
Nobuyoshi Nakada
a3cb09c7d1 [ruby/rdoc] Escape file names
https://hackerone.com/reports/1321358

8c07cc4657
2022-10-07 12:12:08 +09:00
Nobuyoshi Nakada
8d0b2162a0 [ruby/rdoc] Escape main title
https://hackerone.com/reports/1187156

5dedb5741d
2022-10-07 12:09:23 +09: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
Takashi Kokubun
1f2c84de83
[ruby/rdoc] Remove trailing spaces to fix CI
5224898228

369e4fa32d
2022-10-06 11:56:05 -07:00
Nobuyoshi Nakada
cf3056be69 [ruby/rdoc] Add center align
512cc55a0e
2022-10-06 23:22:02 +09:00