Skip to content

jsh9/chatgpt-to-markdown

Repository files navigation

chatgpt-to-markdown

This is a Chrome and Edge extension to download the ChatGPT Q&A page into a markdown file.

1. Installation

To install it from the Chrome Web Store, go to this URL: https://chrome.google.com/webstore/detail/chatgpt-to-markdown/ajogklnjecgpjfalkokkencdlbnhiohb

(Extensions on the Chrome Web Store can also be directly installed to Edge too.)

Alternatively, if you'd like to use this extension in the developer mode, following the steps below to install it:

  1. Download this extension. You can choose either options:

    • Download the latest stable release from the Releases page
    • Clone this repository (which may contain newer-than-stable features). Here is how to clone a Github repository.
  2. Manually load the downloaded/cloned files into the browser:

2. How to use

Navigate to ChatGPT, and to the conversation that you'd like to save as markdown.

Then click on the icon of this extension, or use the following keyboard shortcut:

  • Windows and Linux: Alt + Shift + 5
  • macOS: Option + Shift + 5

A markdown file will automatically be saved to your Downloads folder.

3. Local debugging and testing (for developers)

You can clone this repository, make small tweaks to it (if you code Javascript) as you'd like.

3.1. Building the project

To install and lock the dependencies, run:

npm install

To build the code, run:

npm run build

3.2. Testing

To run unit tests, first install dependencies, and then:

npx jest

3.3 Auto-format code

Run this command in the terminal:

npm run auto-format

And then check the file diffs.

3.4. CI/CD

Every pull request will trigger a CI/CD pipeline run, the steps of which are defined in ./.github/workflows/pipeline.yml.

The pipeline automatically checks for the following:

  • The package version (in package.json) is consistent with the locked-down version (in package-lock.json)
  • Versions in manifest.json and package.json are consistent
  • The unit tests can all pass
  • The minified script in dist is up to date with the code in src
  • The code sytles are correct (running Prettier does not product any file diff)

4. Acknowledgement

  • The core code is adapted from code files in https://github.com/ryanschiang/chatgpt-export
    • The original license is included on the top of the files, if they are partially or fully from the original repository
  • ChatGPT helped draw the icon of this extension
    • The folder icon_drawing_scripts contains the chat transcript, the Python script for drawing the icon, and all draft icons