reactjs-interview-questions icon indicating copy to clipboard operation
reactjs-interview-questions copied to clipboard

Table of Contents is too long maybe make it a collapsible section

Open sahilbakoru opened this issue 1 year ago • 5 comments

Table of Contents is too long maybe make it a collapsible section .

Just like shown below.

https://github.com/sudheerj/reactjs-interview-questions/assets/68190549/ecb2f42a-aee7-4c4d-b058-8d655ef7a351

Above video from this gist : https://gist.github.com/pierrejoubert73/902cc94d79424356a8d20be2b382e1ab#how-to-add-a-collapsible-section-in-markdown

sahilbakoru avatar Sep 28 '23 11:09 sahilbakoru

The table of contents is helpful to see all the questions at the same time. If we close it by default, reader may not get idea to expand them.

sudheerj avatar Sep 30 '23 04:09 sudheerj

In Markdown, you can create collapsible sections like the one you've shown using HTML

and elements, just as you've demonstrated in your example. Here's how to do it:

Use

and : These HTML elements are used to define the collapsible section. The element is the clickable header that users will click on to expand or collapse the content. 2.

Place your content inside the

element: You can include any Markdown content, such as headings, lists, code blocks, or paragraphs, within the
element. This content will be hidden by default when the section is collapsed. 3.

Keep the

element concise: The element should provide a brief and meaningful label for the collapsible section. Users will click on this label to toggle the visibility of the content. 4.

Use indentation: While it's not required, indenting the content within the

element helps improve readability and maintainability, especially for larger sections of content. 5.

Use backticks for code blocks: If you want to include code blocks, as you did in your example, use triple backticks (```) to define the code block and specify the language (e.g., js for JavaScript).

Remember that the support for HTML in Markdown may vary depending on the platform or renderer you're using. Most Markdown renderers should support

and , but it's a good idea to test your Markdown documents in the specific environment where you intend to use them to ensure proper rendering and interactivity.

On Tue, Oct 3, 2023 at 8:24 PM Sahil bakoru​ ​ @.***> wrote:

Closed #273 https://github.com/sudheerj/reactjs-interview-questions/issues/273 as completed.

— Reply to this email directly, view it on GitHub https://github.com/sudheerj/reactjs-interview-questions/issues/273#event-10539612218, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7GHGHU5MC4S3ZU4BXJXGALX5QRKRAVCNFSM6AAAAAA5KZPOAGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQGUZTSNRRGIZDCOA . You are receiving this because you are subscribed to this thread.Message ID: <sudheerj/reactjs-interview-questions/issue/273/issue_event/10539612218@ github.com>

sanketmali09 avatar Oct 03 '23 16:10 sanketmali09

chat GPT is that you ?

sahilbakoru avatar Oct 03 '23 17:10 sahilbakoru

Ok i will send you tomorrow

On Tue, 3 Oct, 2023, 10:43 pm Sahil bakoru​ ​, @.***> wrote:

Reopened #273 https://github.com/sudheerj/reactjs-interview-questions/issues/273.

— Reply to this email directly, view it on GitHub https://github.com/sudheerj/reactjs-interview-questions/issues/273#event-10541213730, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7GHGHXBP5UPOC4X27VT6S3X5RBU7AVCNFSM6AAAAAA5KZPOAGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQGU2DCMRRGM3TGMA . You are receiving this because you commented.Message ID: <sudheerj/reactjs-interview-questions/issue/273/issue_event/10541213730@ github.com>

sanketmali09 avatar Oct 03 '23 17:10 sanketmali09

I have made a pull request for that, video and code is also there.

check the pull request : https://github.com/sudheerj/reactjs-interview-questions/pull/274

sahilbakoru avatar Oct 04 '23 17:10 sahilbakoru

@sahilbakoru Thanks added

sudheerj avatar Apr 02 '24 09:04 sudheerj