Skip to content

Use markdown format for docs - #890

Merged
st0012 merged 5 commits into
masterfrom
use-markdown-format-for-docs
Mar 16, 2024
Merged

st0012 merged 5 commits into
masterfrom
use-markdown-format-for-docs

Conversation

@st0012

@st0012 st0012 commented Feb 26, 2024

Copy link
Copy Markdown
Member

I used Rails's rdoc-to-md script for the majority of the conversion, and then manually tweaked a few issues that I found.

2 additional changes:

  • rake rdoc task is added to simplify the doc generation command.
  • Hide top-level methods like IRB.JobManager from the generated docs.

@st0012 st0012 self-assigned this Feb 26, 2024
@adam12

adam12 commented Feb 26, 2024

Copy link
Copy Markdown
Contributor

Out of curiosity, why the switch?

@st0012

st0012 commented Feb 26, 2024 •

Copy link
Copy Markdown
Member Author

I think markdown has basically become the universal format in writing technical content. For example, we use it to write README and contributing guides all the time.

If we keep writing Ruby docs in another format, it means both the maintainers and the contributors need to learn or maintain this knowledge too, which is a huge cost to pay (for example, it makes me think twice before touching the docs). So without seeing a clear benefit of using the rdoc format, I think we should stop paying this additional cost and make the document easier to contribute to, at least to most devs.

(As a reference, almost 2 years ago Ruby also changed its contributing doc from rdoc to markdown format, among other things (ruby/ruby#5899))

@adam12

adam12 commented Feb 26, 2024

Copy link
Copy Markdown
Contributor

I think markdown has basically become the universal format in writing technical content. For example, we use it to write README and contributing guides all the time.

100% agree.

If we keep writing Ruby docs in another format, it means both the maintainers and the contributors need to learn or maintain this knowledge too, which is a huge cost to pay (for example, it makes me think twice before touching the docs). So without seeing a clear benefit of using the rdoc format, I think we should stop paying this additional cost and make the document easier to contribute to, at least to most devs.

I also agree, 100%.

(As a reference, almost 2 years ago Ruby also changed its contributing doc from rdoc to markdown format, among other things (ruby/ruby#5899))

I remember seeing this PR, but I don't recall seeing that Markdown for source code documentation was also considered/encouraged in ruby/* projects, but I am presuming this is the maintainer's choice.

Not worth getting into in this thread, but Ruby documentation is my least favourite part of Ruby currently, so any type of PR that seems to resolve some pain around using RDoc currently piques my interest.

@hsbt

hsbt commented Feb 28, 2024

Copy link
Copy Markdown
Member

I'm +1 to convert this. But I'm not sure what is happened mixing md and rdoc format in ruby/ruby repository.

FYI: I have a plan to extract irb from ruby/ruby repo entirely at https://bugs.ruby-lang.org/issues/20309. After that, irb and reline don't have some of concerns related ruby/ruby repo's limitation.

@st0012

st0012 commented Feb 29, 2024

Copy link
Copy Markdown
Member Author

@hsbt Thanks for the reminder 👍
I tested it in ruby/ruby following the instruction here. And indeed, if we simply do the conversion it'd break Ruby's doc for IRB class. However, adding # :markup: markdown as the first comment (after the string literal frozen one) seems to fix the issue.

@st0012
st0012 force-pushed the use-markdown-format-for-docs branch from 2359991 to 5a50d04 Compare March 1, 2024 15:59
@st0012
st0012 force-pushed the use-markdown-format-for-docs branch from 5a50d04 to 091e541 Compare March 7, 2024 03:00

@hsbt hsbt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@st0012 I discussed this at DevMeeting 2024-03-14. No one against this proposal if there is no issue to mix rdoc and markdown formats. Go ahead this.

@st0012

st0012 commented Mar 16, 2024

Copy link
Copy Markdown
Member Author

@hsbt Thanks for raising this in the dev meeting 🙌

@st0012
st0012 merged commit e9a175e into master Mar 16, 2024
@st0012
st0012 deleted the use-markdown-format-for-docs branch March 16, 2024 13:51
matzbot pushed a commit to ruby/ruby that referenced this pull request Mar 16, 2024
(ruby/irb#890)

* Convert irb.rb's document into markdown format

* Hide should-be-private top-level methods from docs

* Skip xmp.rb's docs

* Declare lib/irb.rb's markup do it works in ruby/ruby too

* Ignore docs folder

ruby/irb@e9a175e06b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants