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

Add button to expand all links? #49

Closed
robmarkcole opened this issue Mar 8, 2023 · 4 comments
Closed

Add button to expand all links? #49

robmarkcole opened this issue Mar 8, 2023 · 4 comments

Comments

@robmarkcole
Copy link
Collaborator

It would be nice to hit a button and expand all links, so the page could be searched without needing to dive into the raw markdown

@Spiruel
Copy link

Spiruel commented Mar 8, 2023

I don't think you can have javascript buttons on Github markdowns, but perhaps a bookmarklet would be a good solution?

Something like this would work, as long as the elements to be expanded can be filtered to the details elements in the markdown.

javascript:(function() {
  var detailsElements = document.getElementsByTagName('details');
  for (var i = 0; i < detailsElements.length; i++) {
    if (!detailsElements[i].hasAttribute('open')) {
      detailsElements[i].setAttribute('open', '');
    }
  }
})();

@robmarkcole
Copy link
Collaborator Author

Could you make a fork and try it out?

@robmarkcole
Copy link
Collaborator Author

Another option to reformat is to return all material out of the drop downs.
Format would be:

  • Introductions and images
  • Link to later section where links live

@robmarkcole
Copy link
Collaborator Author

Just removed the drop downs

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

No branches or pull requests

2 participants