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

Improve method source toggling #1176

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Commits on Sep 27, 2024

  1. Move method source block to the top

    Currently, if a method description is long (e.g. `Array.new`), users need
    to click the method toggle button next to the method title, and then scroll
    down to the source code expanded below the description.
    
    This commit changes the behavior so that the source code is expanded
    immediately below the method title.
    st0012 committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    f7d9ad6 View commit details
    Browse the repository at this point in the history
  2. Update method toggle's interface

    1. Display the method toggle button by default instead of displaying on hover
    2. Only toggle the source code when clicking the method toggle button, not
       when clicking the entire method title section. This will allow us to display
       an anchor link next to the method title
    3. Simplify the toggle source button's appearance
    st0012 committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    1e25a79 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    46de326 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    57a4738 View commit details
    Browse the repository at this point in the history
  5. Improve method controls' display on mobile

    By moving the method controls out of the method header, we can display
    them to the right of the method name on desktop, and below the method name
    on mobile.
    st0012 committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    ac7409b View commit details
    Browse the repository at this point in the history
  6. Add "Example" label to example code blocks

    The label should help users distinguish example code blocks from other
    code blocks, such as method source code.
    
    It's only applied to Ruby code examples.
    st0012 committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    69fc9ce View commit details
    Browse the repository at this point in the history