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

Deprecate main and title directives #1218

Merged
merged 6 commits into from
Dec 5, 2024

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Nov 29, 2024

Both main page and default title of a documentation should be global and immutable settings for the target project. Allowing users to override them in the middle of the documentation makes RDoc error-prone (see #426) and doesn't encourage the right behaviour.

We should deprecate these directives and remove them in the 7.0 release.

@st0012 st0012 self-assigned this Nov 29, 2024
@st0012 st0012 modified the milestone: v7.0.0 Nov 29, 2024
@st0012 st0012 force-pushed the deprecate-main-and-title-directives branch from ead41d2 to c197c94 Compare November 30, 2024 12:21
@colby-swandale
Copy link
Member

I tried to do a quick test to see how the :title: directive currently works, but wasn't able to see where it comes out in the Darkish output.

Does the :title: directive allow a person to customise the title element in Darkish?

@st0012
Copy link
Member Author

st0012 commented Dec 2, 2024

Does the :title: directive allow a person to customise the title element in Darkish?

Yes it's the same as the title option you can use in flags, .rdoc_options, and the rake task. These are their usages in the darkfish.

@st0012 st0012 force-pushed the deprecate-main-and-title-directives branch from 1e03e16 to 83a3561 Compare December 2, 2024 12:03
@st0012 st0012 requested a review from colby-swandale December 2, 2024 12:03
@colby-swandale
Copy link
Member

It seems (please correct me if I'm wrong) that this directive allows you to customise the title for each document generated from RDoc, which could be pretty useful for SEO. I remember that we just merged something recently that now lets us customise keyboards and meta descriptions. Would the :title directive fall under the same sort of functionality?

@st0012
Copy link
Member Author

st0012 commented Dec 3, 2024

Before #1091, :title: is only used in the ToC page and index page, not each document. So it's not designed for per-page usage from the beginning yet it allows individual pages to change the global value, which is why I think this directive is not a well-designed feature.

Even after #1091 started using it for SEO tags, the option.title value should still be considered a global value, not a way to customize each page's title by keep mutating it.

For SEO customization in the future, I think adding new :meta: or :meta-[keywords|description] directives which's value are attached to individual documents will be better.

@st0012 st0012 merged commit e2d4ac9 into master Dec 5, 2024
51 checks passed
@st0012 st0012 deleted the deprecate-main-and-title-directives branch December 5, 2024 11:36
matzbot pushed a commit to ruby/ruby that referenced this pull request Dec 5, 2024
(ruby/rdoc#1218)

* Deprecate :main: directive

* Deprecate :title: direcive

* Update documentation

* Remove :main: directive's usage

* Update test cases

* Add '.rdoc_options' to suggested alternatives

ruby/rdoc@e2d4ac9dad
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.

3 participants