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

Collapsible content and lazy loading / rendering. #2206

Closed
novaknole opened this issue Sep 1, 2023 · 2 comments
Closed

Collapsible content and lazy loading / rendering. #2206

novaknole opened this issue Sep 1, 2023 · 2 comments

Comments

@novaknole
Copy link

Feature request

Problem or desire

I have been writing some docs for my own use case. The library is amazing. Though I need ideas.

Some pages are quite long, so I got tired of scrolling to get to the bottom of the page. You might say that I can create other pages and separate them, but I don't want it. I need to have it on the same page.

I got 2 things I want to find a way about:

  • The page is big, so it's slow(kind of lagging)
  • Since page is long, I end up scrolling quite some time to get to the bottom.

I would love to have the following: some collapsibles such as you go to the page, and you see 15 collapsibles and clicking on each of them shows the contet later. I couldn't find anything through docsify, so I did it with my own html/css and some javascript and I solved the problem about "scrolling too long". But it's ofc still slow.

Proposal

Isn't there some way that I got collapsibles, though, whatever is hidden behind it is not loaded on the page load and only loaded once clicked ? This way, performance will be much better. Thoughts ?

@Koooooo-7
Copy link
Member

Hi @novaknole , I m trying to answer those questions above based on current docsify behaviors.

  1. Does docsify loads content separated from on single .md ?

Nope, docsify render the single md file to a single page in one time, there is no a simple mechanism to lazy load inside one page. Although it seems not that friendly to big content for now :( .


  1. Does there has a way to make content collapsible ?

Simply, markdown supports it already. i.e.

Click me

How to make it collapsible

Using <details> and <summary>

<details>
  <summary>Click me</summary>
  
  Using `<details>` and `<summary>`
  ### How to make it collapsible
  ...

</details>

@Koooooo-7 Koooooo-7 changed the title Collapsible content Collapsible content and lazy loading / rendering. Sep 5, 2023
@jhildenbiddle
Copy link
Member

Hi @novaknole.

Have you considered breaking your "quite long" pages into separate pages and/or leveraging the sidebar for efficiently navigating between sections on each page? This seems like the most obvious solution.

Collapsable content is available today as described in @Koooooo-7's comment above.

As for lazy-loading sections of page, this may help with performance issues when loading unusually long pages but it would introduce a number of new issues to consider. My initial reaction is that tackling these issues would add quite a bit of complexity to the page rendering process. Since page rendering performance is not something we hear Docsify users complain about much, I don't see this feature being prioritized any time soon.

For now and the foreseeable future, I think your best option is to revisit your "quite long" pages and break them up into smaller, more manageable content blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants