Skip to content

Add markdown copy feature #187

@brookslybrand

Description

@brookslybrand

Why

Being able to copy a doc as markdown directly is a very useful feature when working with LLMs, chatbots, and AI-coding tools like Cursor.

Inspiration

Thanks Cloudflare and Vercel for the inspiration 🙏

What needs to be done

Thanks @kdcokenny for getting this started in #186 🤘

We want to take this opportunity to make some small tweaks to the docs pages on reactrouter.com

  • Create dropdown for copying/editing pages
  • Lift "edit" link into this dropdown
  • Re-use the same dropdown functionality that's used for the branch and theme selectors in the main nav
    • Note: this means that the feature should be open-able before JS has loaded (progressive enhancement)
    • Bonus points if the "copy page" is a link before JS has loaded, since it won't be functional without JS
  • Note: for the copy icon just use the existing icon in this repo. No need to switch to the svg in the design

Here are the various hover/focus states the dropdown can be in:

Image

And here is where we want to position the dropdown on the page (note: for mobile this should stack under the "mode legend"):

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions