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

Display main page's Table of Contents when viewed from the index page #1250

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Dec 22, 2024

When the main page document is viewed as a standalone page, Darkfish displays the Table of Contents. When viewed from the index page, it does not.

This page changes the behaviour to also display the Table of Contents when the main page document is viewed from the index page.

Before

Screenshot 2024-12-22 at 16 30 45

After

Screenshot 2024-12-22 at 16 31 14

In ruby/ruby

Screenshot 2024-12-22 at 16 34 10

lib/rdoc/generator/darkfish.rb Show resolved Hide resolved

index_html = File.binread('index.html')

# If there is no main page, the index page should not have a table of contents
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not though? Is there a reason why we can't or don't want to display the table of contents every time?

Copy link
Member Author

Choose a reason for hiding this comment

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

The lack of main page here means it'll literally only have one title This is the API documentation for My awesome Ruby project. and nothing else.

When the main page document is viewed as a standalone page, Darkfish
displays the Table of Contents. When viewed from the index page,
it does not.

This page changes the behaviour to also display the Table of Contents
when the main page document is viewed from the index page.
@st0012 st0012 force-pushed the display-main-page-tocs branch from b499478 to 190c909 Compare January 21, 2025 10:31
@st0012 st0012 merged commit f6289b7 into master Jan 21, 2025
51 checks passed
@st0012 st0012 deleted the display-main-page-tocs branch January 21, 2025 11:04
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.

2 participants