summaryrefslogtreecommitdiff
path: root/test/rdoc
AgeCommit message (Collapse)Author
2024-08-15[ruby/rdoc] Fix sidebar scroll again and add missing footer backStan Lo
(https://github.com/ruby/rdoc/pull/1154) * Add missing footers In #1152 the footer partial was only added to the index.rhtml file. This commit adds the footer partial to the other template files. * Remove unnecessary middle divs in nav * Simplify sidebar's overflow settings Because sidebar needs to be scrollable, its overflow should default to auto. Currently it's set to hidden and force individual elements to set overflow auto, which overcomplicates things. https://github.com/ruby/rdoc/commit/b8c2bcd8db
2024-08-05Sync rdocStan Lo
Notes: Merged: https://github.com/ruby/ruby/pull/11308
2024-07-31[ruby/rdoc] Add new ruby parser that uses Prismtomoya ishida
(https://github.com/ruby/rdoc/pull/1144) * Add a new ruby parser RDoc::Parser::PrismRuby * Add a new ruby parser testcase independent from parser's internal implementation * unknown meta method * Use MethodSignatureVisitor only to scan params, block_params and calls_super * Add calls_super test * Drop ruby 2.6. Prism requires ruby >= 2.7 * Remove duplicated documentation comment from prism_ruby.rb * Add test for wrong argument passed to metaprogramming method * Rename visit_call_[DSL_METHOD_NAME] to make it distinguishable from visit_[NODE_TYPE]_node * Method receiver switch of true/false/nil to a case statement * Extract common part of add_method(by def keyword) and add meta_comment method * Reuse consecutive comments array when collecting comments * Simplify DSL call_node handling * Refactor extracting method visibility arguments https://github.com/ruby/rdoc/commit/fde99f1be6
2024-07-31[ruby/rdoc] Drop unnecessary `file_name` parameter from `Parser.for`Stan Lo
method. (https://github.com/ruby/rdoc/pull/1135) * Unify top_level creation in tests * Remove unnecessary file_name param from Parser.for It should be always the same as the top_level's absolute_name, so there's no point of taking it as a separate parameter. https://github.com/ruby/rdoc/commit/97c497dfbb
2024-07-18Require space between hash/content in ATX heading (#1140)Hartley McGuire
While writing some Markdown documentation for Rails, I came across an interesting case where trying to link to an instance method at the start of a line would instead parse as an H1 heading: ```markdown #response_body= ``` Expected: ```html <a href=""><code>#response_body=</code></a> ``` Actual: ```html <h1>response_body=</h1> ``` According to the CommonMark spec: > At least one space or tab is required between the # characters and the > heading’s contents, unless the heading is empty. Note that many > implementations currently do not require the space. However, the space > was required by the original ATX implementation, and it helps prevent > things like the following from being parsed as headings: > > Example 64 So while some implementations do not follow this requirement, I believe RDoc should because it makes it easy to write text similar to Example 64 (which was used in the new test) and it also enables automatically linking to instance methods at the start of a line.
2024-07-01[ruby/rdoc] Fix some typos (https://github.com/ruby/rdoc/pull/1129)Yudai Takada
* constist ==> consist * Tidyness ==> Tidiness * Currentry ==> Currently * valus ==> values https://github.com/ruby/rdoc/commit/8412705721
2024-03-15[ruby/rdoc] test: Add tests for RDoc::TokenStream#add_tokens, add_token ↵toshimaru
,collect_tokens and pop_token https://github.com/ruby/rdoc/commit/9ed530b8f9
2024-03-11[ruby/rdoc] Allow rich definition list labels for MarkdownHartley McGuire
Previously, any sort of "rich" markup for a definition list's label would cause the Markdown parser to not recognize a definition list: ```ruby md = <<~md `one` : This is a definition md doc = RDoc::Markdown.parse(md) doc # => [doc: [para: "<code>one</code>\n: This is a definition"]] ``` This commit tweaks the grammar for Markdown definition lists so that labels can include "rich" markup such as bold (`**`), code (```), etc: ```ruby md = <<~md `one` : This is a definition md doc = RDoc::Markdown.parse(md) doc # => [doc: [list: NOTE [item: ["<code>one</code>"]; [para: "This is a definition"]]]] ``` The [PHP Markdown Extra][1] Spec does not seem to specify whether or not this should be allowed, but it is allowed in the RDoc format: ```ruby rdoc = <<~rdoc +code+:: This is a definition rdoc doc = RDoc::Markup.parse(rdoc) doc # => [doc: [list: NOTE [item: ["+code+"]; [para: "This is a definition"]]]] ``` so accepting this change increases the parity of the two formats. [1]: https://michelf.ca/projects/php-markdown/extra/#def-list https://github.com/ruby/rdoc/commit/8f943bbba4
2024-03-09[ruby/rdoc] Fix ToRdoc generating incorrect {label,name}-listsHartley McGuire
Previously, trying to round-trip label-list and name-lists with the ToRdoc converter was not possible: ```ruby doc = <<~RDOC foo :: bar :: hi RDOC markup = RDoc::Markup.parse(doc) markup # => [doc: [list: NOTE [item: ["foo ", "bar"]; [para: "hi"]]]] rt = RDoc::Markup::ToRdoc.new.convert(markup) rt # => "foo\nbar:\n hi\n\n" rt_markup = RDoc::Markup.parse(rt) rt_markup # => [doc: [para: "foo ", "bar:"], [verb: "hi\n"]] ``` This commit addresses the issue by fixing ToRdoc to generate output that can be properly reparsed by RDoc. ToRdoc tests additionally needed to be updated for the new output. The old implementation of `accept_list_item_start` was copied to ToBs because those tests did not pass with the new changes and I am unfamiliar with the `backspace` format. After: ```ruby doc = <<~RDOC foo :: bar :: hi RDOC markup = RDoc::Markup.parse(doc) markup # => [doc: [list: NOTE [item: ["foo ", "bar"]; [para: "hi"]]]] rt = RDoc::Markup::ToRdoc.new.convert(markup) rt # => "foo::\nbar::\n hi\n\n" rt_markup = RDoc::Markup.parse(rt) rt_markup # => [doc: [list: NOTE [item: ["foo", "bar"]; [para: "hi"], blankline]]] ``` https://github.com/ruby/rdoc/commit/c6c51aa900
2024-03-08[ruby/rdoc] Fix ToMarkdown missing newlines for label-listsHartley McGuire
Previously, using ToMarkdown on a label-list would generate output that could not be reparsed by the RDoc::Markdown parser: ``` md = <<~MD apple : a red fruit banana : a yellow fruit MD doc = RDoc::Markdown.parse(md) doc # => [doc: [list: NOTE [item: ["apple"]; [para: "a red fruit"]], [item: ["banana"]; [para: "a yellow fruit"]]]] new_md = doc.accept(RDoc::Markup::ToMarkdown.new) new_md # => "apple\n: a red fruit\nbanana\n: a yellow fruit\n\n" new_doc = RDoc::Markdown.parse(new_md) new_doc # => [doc: [list: NOTE [item: ["apple"]; [para: "a red fruit\nbanana\n: a yellow fruit"]]]] ``` The issue is that the [PHP Markdown Extra spec][1] requires a newline after each definition list item, but ToMarkdown was not putting newlines between label-list items. This commit fixes the issue by properly appending a newline after each label-list item so that the output of ToMarkdown can be reparsed by RDoc::Markdown: ``` md = <<~MD apple : a red fruit banana : a yellow fruit MD doc = RDoc::Markdown.parse(mdoc) doc # => [doc: [list: NOTE [item: ["apple"]; [para: "a red fruit"]], [item: ["banana"]; [para: "a yellow fruit"]]]] new_md = doc.accept(RDoc::Markup::ToMarkdown.new) new_md # => "apple\n: a red fruit\n\nbanana\n: a yellow fruit\n\n" new_doc = RDoc::Markdown.parse(new_md) new_doc # => [doc: [list: NOTE [item: ["apple"]; [para: "a red fruit"]], [item: ["banana"]; [para: "a yellow fruit"]]]] ``` [1]: https://michelf.ca/projects/php-markdown/extra/#def-list https://github.com/ruby/rdoc/commit/c65266437c
2024-02-09[ruby/rdoc] Don't document aliases with trailing `:nodoc` directivePetrik
Attribute readers and writers can be marked as `:nodoc` to keep them undocumented: ```ruby attr_reader :name # :nodoc: ``` For aliases this behaviour should be the same: ```ruby alias_method :old :new # :nodoc: ``` https://github.com/ruby/rdoc/commit/30f14e8271
2024-01-11[ruby/rdoc] Undo accidentally deleted linesNobuyoshi Nakada
https://github.com/ruby/rdoc/commit/4e14158255
2024-01-11[ruby/rdoc] Respect modeline to detect parserNobuyoshi Nakada
https://github.com/ruby/rdoc/commit/485468f06f
2024-01-07[ruby/rdoc] Visibility should begin from `public` for each scopeNobuyoshi Nakada
Even for singleton class definition such as `class << self` that shares the same container with the outer scope, its visibility is separated and set to `public` by default. https://github.com/ruby/rdoc/commit/baf26363b9
2024-01-07[ruby/rdoc] Singleton method visibility should be isolatedNobuyoshi Nakada
Each singleton method definition of the form `def recv.method` has visibility separate from the outer scope and is set to `public` by default. https://github.com/ruby/rdoc/commit/810913a7ea
2024-01-06[ruby/rdoc] Rename and move the tests for `--locale` option [ci skip]Nobuyoshi Nakada
https://github.com/ruby/rdoc/commit/b2a35ee39d
2024-01-06[ruby/rdoc] Ignore `locale` at `write_options`Nobuyoshi Nakada
`@locale` is set from `@locale_name` and loaded from `@locale_dir` after `write_options`, and `RDoc::I18n::Locale` does not seem to expected to be loaded. https://github.com/ruby/rdoc/commit/fd610f7023
2023-12-31[ruby/rdoc] Allow empty name rdoc-ref as a local linkNobuyoshi Nakada
https://github.com/ruby/rdoc/commit/914a6af137
2023-12-25[ruby/rdoc] Fix support for `rb_file_const` and `rb_curses_define_const`Nobuyoshi Nakada
Constant definitions using these functions have been supported, but since RDoc::Parser::C#gen_const_table did not consider other than `rb_define_const` the documents for them have not been found, without `Document-const` direvtive. Fixes https://github.com/ruby/rdoc/issues/1067 https://github.com/ruby/rdoc/commit/cdad51a60b
2023-12-06[ruby/rdoc] Only word-ending colon separates new definitionNobuyoshi Nakada
When followed by non-space characters, rather it looks like a URL or a path name on Windows. https://github.com/ruby/rdoc/commit/72c6560773
2023-12-06[ruby/rdoc] Use single quotes to keep backslash literallyNobuyoshi Nakada
https://github.com/ruby/rdoc/commit/4ac9be7f48
2023-12-05[ruby/rdoc] Allow any single-word token upto 2 before C method implementationNobuyoshi Nakada
Previously only unknown word `intern` is allowed between a single-word token before a C method. Now any single-word token, such as `inline` which is used for `ArithmeticSequence` in enumerator.c, is allowed instead. https://github.com/ruby/rdoc/commit/3a214c1dd1
2023-12-05[ruby/rdoc] fix: fix `NoMethodError` when `token_stream` is niltoshimaru
The change in #1055 might be a breaking change. So, just simply wrap `token_stream` with `Array` https://github.com/ruby/rdoc/commit/d8c19d7fa1 Co-authored-by: Jonathan Hefner <[email protected]>
2023-12-02[ruby/rdoc] Markup punctuations need to be separated with a spaceNobuyoshi Nakada
https://github.com/ruby/rdoc/commit/83f0149fc1
2023-11-30[ruby/rdoc] Get rid of `Kernel#open`Nobuyoshi Nakada
https://github.com/ruby/rdoc/commit/dc56f6d0bd
2023-11-27[ruby/rdoc] Place a space between certain character class letters onlyNobuyoshi Nakada
https://github.com/ruby/rdoc/commit/1f568e049d
2023-11-16[ruby/rdoc] fix: Fix NoMethodError for `tokens_to_s` methodtoshimaru
Calling `tokens_to_s` gets an error if `token_stream` is nil: ``` undefined method `compact' for nil:NilClass (NoMethodError) ``` So, fall back to an empty array if `@token_stream` is nil. https://github.com/ruby/rdoc/commit/452e4a2600
2023-11-14[ruby/rdoc] Fix TIDYLINK after bracesNobuyoshi Nakada
(https://github.com/ruby/rdoc/pull/1015) TIDYLINK multi-word label should not include braces. https://github.com/ruby/rdoc/commit/41ad3191e9
2023-11-03[ruby/rdoc] test/rdoc/test_rdoc_generator_json_index.rb: pend in ↵Jun Aruga
test_generate in ppc64le. We observed that this test randomly fails in the ruby/ruby Travis ppc64le case. This commit is to pend the test_generate if the assertion for the generated file's modified time fails in a ppc64le environment. Note that I didn't use the word "Travis CI" or Travis CI specific environment variables such as `TRAVIS` and `TRAVIS_CPU_ARCH`[1] in the code. Because I wanted to prioritize the rdoc's independence from the ruby/ruby. [1] https://docs.travis-ci.com/user/environment-variables/#default-environment-variables https://github.com/ruby/rdoc/commit/42cdad1cf2
2023-10-30[ruby/rdoc] test/rdoc/test_rdoc_generator_json_index.rb: Use assert_equal ↵Jun Aruga
instead of assert. It's better because assert_equal prints the values when it fails. https://github.com/ruby/rdoc/commit/91d40ce8f8
2023-09-05[ruby/rdoc] Omit descriptions and parameter lists for methods defined in C ↵Jeremy Evans
not mentioned in call-seq This allows RDoc to better generate documentation for methods following the Ruby core documentation guide (which omits aliases in call-seq in most cases). This makes documentation for methods defined in C more similar to methods defined in Ruby. For methods defined in Ruby, the method description of the aliased method is already not used (you have to explicitly document the alias to use it). Internally, this adds AnyMethod#has_call_seq? and #skip_description?, and updates Darkfish to: * only show the method name if there is a call-seq for the method, but the call-seq omits the method * to omit the method description if the method is an alias or has aliases and has a call-seq that does not include the method See discussion in https://github.com/ruby/ruby/pull/7316 for details. https://github.com/ruby/rdoc/commit/e3688de49b
2023-09-05[ruby/rdoc] handle symbols declared with `%s`theo-squadracer
https://github.com/ruby/rdoc/commit/ed91c4b784
2023-06-14[ruby/rdoc] Use flat_map for better performancePetrik
https://github.com/ruby/rdoc/commit/76192a280d
2023-06-03[ruby/rdoc] Auto-correct trailing new linesVinicius Stock
https://github.com/ruby/rdoc/commit/4b68c0728a
2023-05-02[ruby/rdoc] Fix references to nested label in table_of_contentsNobuyoshi Nakada
Fixes https://github.com/ruby/rdoc/pull/1000 https://github.com/ruby/rdoc/commit/291e2b7e8b
2023-04-29[ruby/rdoc] Fix polynominal backtrackingNobuyoshi Nakada
Fix https://github.com/ruby/rdoc/pull/995 https://github.com/ruby/rdoc/commit/1311ca8c50
2023-04-29[ruby/rdoc] Fix polynominal backtrackingNobuyoshi Nakada
Fix https://github.com/ruby/rdoc/pull/995 https://github.com/ruby/rdoc/commit/adfa7db5b9
2023-03-31[ruby/rdoc] Read generated files in binary modeNobuyoshi Nakada
So that fixes crash with "invalid byte sequence in US-ASCII" on ci.rvm.jp and some RubyCIs. https://github.com/ruby/rdoc/commit/4b416644f0
2023-02-06[ruby/rdoc] Add test coverage for -C flagzzak
https://github.com/ruby/rdoc/commit/564be08f4b
2023-02-03[ruby/rdoc] Add rdoc:coverage default taskzzak
https://github.com/ruby/rdoc/commit/157fbaf575
2022-12-23[ruby/rdoc] Fix fragile testsNobuyoshi Nakada
When the temporary path is long enough, the formatter may fold the path and may hit a hyphen at the end of line, and miscounted. https://github.com/ruby/rdoc/commit/5f46479543
2022-12-23Debug for zlinux CI [ci skip]Nobuyoshi Nakada
2022-12-23[ruby/rdoc] Clean up home directories for each testNobuyoshi Nakada
https://github.com/ruby/rdoc/commit/f067c174da
2022-12-01[ruby/rdoc] Non-RD part feature has not been imported to RDocNobuyoshi Nakada
https://github.com/ruby/rdoc/commit/fe0159de2f Notes: Merged: https://github.com/ruby/ruby/pull/6835
2022-11-28[ruby/rdoc] Add `--no-skipping-tests` optionSven Riedel
https://github.com/ruby/rdoc/commit/33925f885f
2022-11-27Skip a broken RDoc testTakashi Kokubun
http://ci.rvm.jp/results/trunk-yjit@phosphorus-docker/4309535 http://ci.rvm.jp/results/trunk-random0@phosphorus-docker/4309536 http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/4309538 http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/4309541 http://ci.rvm.jp/results/trunk-random3@phosphorus-docker/4309544 http://ci.rvm.jp/results/trunk-no-mjit@phosphorus-docker/4309550 http://ci.rvm.jp/results/trunk-yjit@phosphorus-docker/4309556 http://ci.rvm.jp/results/trunk-random0@phosphorus-docker/4309562 http://ci.rvm.jp/results/trunk-random1@phosphorus-docker/4309564 http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/4309567 http://ci.rvm.jp/results/trunk-random3@phosphorus-docker/4309570 http://rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20221127T200003Z.fail.html.gz http://ci.rvm.jp/results/trunk-random-repeat@phosphorus-docker/4309581 http://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20221127T203002Z.fail.html.gz http://ci.rvm.jp/results/trunk-yjit@phosphorus-docker/4309588
2022-11-27[ruby/rdoc] Revert "Refactor `RDoc::Markup::Parser#tokenize`"Nobuyoshi Nakada
This reverts commit https://github.com/ruby/rdoc/commit/41ceae93b3bc. https://github.com/ruby/rdoc/commit/5d2c47e8b8
2022-11-27[ruby/rdoc] Refactor `RDoc::Markup::Parser#tokenize`Nobuyoshi Nakada
Make verbatims text or newline only, and simplify `build_verbatim`. https://github.com/ruby/rdoc/commit/41ceae93b3
2022-11-27[ruby/rdoc] Darkfish: Nest sidebar ToC as a tree of headingsnick evans
This uses `<details><summary>heading</summary><ul>nested</ul></detail>`, similar to how the classes and pages lists are now nested. https://github.com/ruby/rdoc/commit/e57beff287
2022-10-07[ruby/rdoc] Special characters are prohibited as filename on WindowsNobuyoshi Nakada
https://github.com/ruby/rdoc/commit/13b9da5932