Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure IRB's documentation #1053

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Restructure IRB's documentation #1053

wants to merge 1 commit into from

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Dec 22, 2024

Currently, part of the documentation lives in lib/irb.rb as RDoc comments, and the rest lives in README.md.

The RDoc comments are not for viewing on GitHub, while README.md is. So this means users need to read part of the documentation on https://ruby.github.io/irb/, and the rest on GitHub. This is not a great user experience.

This PR restructures the documentation so all major documentation is in doc/index.md that will become the main documentation for IRB on https://ruby.github.io/irb/.

This solves a 2 main problems:

  1. Users can read IRB documentation all in one place, on https://ruby.github.io/irb/.
  2. It makes updating the documentation easier, especially the content that currently lives in lib/irb.rb.

Next Steps

What This PR Does NOT Do

This PR is a foundation for future documentation changes. It does not include fact-checking existing documentation or correcting existing errors...etc.

Demo (generated with ruby/rdoc#1250)

Screen.Recording.2024-12-23.at.23.51.41.mov

@st0012 st0012 self-assigned this Dec 22, 2024
@st0012 st0012 force-pushed the new-docs branch 4 times, most recently from 573d030 to e38bfca Compare December 22, 2024 17:53
Copy link
Member Author

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

RDoc setting related changes are all for achieving the followings all at once:

  • All doc files should live under doc folder
  • When RDoc generates these files' pages, they should NOT be put under doc folder, but treated as top-level pages in the sidebar
  • doc/index.md should be the main page
  • Documentation under lib should be generated as usual

The current implementation is the only set of configurations I could make this work. RDoc really needs to be a better tool 😞

@@ -0,0 +1,2 @@
page_dir: doc
warn_missing_rdoc_ref: true
Copy link
Member Author

Choose a reason for hiding this comment

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

These settings can't be specified in RDoc's rake task so we need this file.

rdoc.title = "IRB Documentation"
rdoc.main = "index.md"
rdoc.rdoc_dir = "_site"
rdoc.options.push("lib")
Copy link
Member Author

Choose a reason for hiding this comment

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

We also need this task because we now need to use lib as the target folder, not the root folder.

@st0012 st0012 force-pushed the new-docs branch 4 times, most recently from 00de801 to 600e8ce Compare December 23, 2024 23:27
Currently, part of the documentation lives in `lib/irb.rb` as RDoc comments,
and the rest lives in `README.md`.

The RDoc comments are not for viewing on GitHub, while README.md is. So
this means users need to read part of the documentation on
https://ruby.github.io/irb/, and the rest on GitHub. This is not a great
user experience.

This commit restructures the documentation so all major documentation is
in `doc/index.md` that will become the main documentation for IRB on
https://ruby.github.io/irb/.

This solves a 2 main problems:

1. Users can read IRB documentation all in one place, on https://ruby.github.io/irb/.
2. It makes updating the documentation easier, especially the content that
   currently lives in `lib/irb.rb`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant