website icon indicating copy to clipboard operation
website copied to clipboard

Restrict api methods with platform

Open trulysinclair opened this issue 1 year ago • 5 comments

Not sure how many people this could benefit, but the docs could benefit from being able to hide methods that are platform specific. For example, I'm currently hired to develop for Windows only, and have to scroll through many macOS specific methods. It would be nice to filter both the view and the sidebar to a specific platform for faster reading.

trulysinclair avatar Sep 13 '23 21:09 trulysinclair

Hi I would really like to work on this but do we have a design for the filter button or toggle?

DevanceJ avatar Mar 04 '24 18:03 DevanceJ

Hi, So I played around a little bit with the website's code and understood how docusaurus is working. In my opinion the filter feature can be implemented by using .mdx instead of normal markdown files, that way we will be able to put some js logic on our markdown also we would need to update all the files such that the headings that need to be filtered are wrapped with their tags such as mac, linux or windows. If you can think of a more simpler approach to this I would love to discuss and work on this.

DevanceJ avatar Mar 05 '24 04:03 DevanceJ

@DevanceJ I think we would want to do it with JavaScript on the website rather than modifying the source MDX files. The information is already embedded into the Markdown header for each API.

erickzhao avatar Mar 05 '24 04:03 erickzhao

By adding a Filter logic Plugin to docusaurus maybe what do you think. Should I try working on a filter logic?

DevanceJ avatar Mar 05 '24 09:03 DevanceJ

You mean a Remark plugin for the Docusaurus config? I'm not sure how it would look in practice off the top of my head but feel free to experiment!

erickzhao avatar Mar 05 '24 21:03 erickzhao