Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsbrex/gpt-markdown-switch
https://github.com/itsbrex/gpt-markdown-switch
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/itsbrex/gpt-markdown-switch
- Owner: itsbrex
- License: mit
- Created: 2023-05-09T18:25:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T08:31:20.000Z (about 1 year ago)
- Last Synced: 2025-01-06T12:09:16.681Z (about 2 months ago)
- Language: Python
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
GPT Markdown Switch 🪄A simple Python script to generate and convert ChatGPT-compatible Markdown that won't render inline fenced code blocks on the page.
![]()
![]()
![]()
![]()
Overview • Demo • Requirements • Usage • Features • Contributing • License
## Overview
GPT Markdown Switch has two main components. The first is a custom prompt to generate *actual* single codeblock README files that can easily be copy and pasted into your project. The second is a Python script that allows you to toggle between custom markdown format and standard markdown format. The custom markdown format uses headers represented by `H1`, `H2`, `H3`, etc., triple single quotes `'''` for fenced code blocks, and single backticks for inline code snippets so that you *actually* get back single code blocks instead of multiple rendered markdown code blocks.
## Demo
https://github.com/itsbrex/gpt-markdown-switch/assets/9772694/06700b20-5079-4a6a-845c-ce9d9c25f816
![]()
### Why did I make this?
It's annoying when ChatGPT renders fenced code blocks within Markdown directly on the page, making it hard to copy everything at once. I wanted a way to create README files for my projects that I could easily copy and paste, so I created a custom prompt that tells ChatGPT to replace traditional Markdown syntax with custom syntax so it doesn't render on the page. This worked, but the custom Markdown format still needed to be converted back to regular markdown for the actual README file. To fix this, I made a Python script that automatically detects the current format and switches everything accordingly. Badabing! With GPT Markdown Switch, you can now generate full code block README files (or any other Markdown content) that are easy to copy and paste.
## Features- Toggle between custom markdown format and standard markdown format
- Replace headers with custom format (H1, H2, H3, etc.)
- Replace triple backticks with triple single quotes for fenced code blocks
- Keep single backticks for inline code snippets## Requirements
- Python 3.6+
## Usage
### GPT README Prompt🔥 Use this prompt to get a single markdown code block responses 🔥
```
Write a readme for my repository named "REPOSITORY NAME" based on the following code and using the custom markdown format where headers are represented by H1, H2, H3, etc., triple single quotes (''') are used for fenced code blocks, and single backticks (`) are used for inline code snippets:PASTE YOUR CODE HERE
```1. Once you are ready to generate a `README` for your project, go to [ChatGPT](https://chat.openai.com/) and enter the prompt above, followed by the code for your main script and/or `package.json` file to provide more context.
2. Save the response as `README.md` in the root of your project directory.
3. Run the script in the same directory as your `README.md` file with the following command:```
python3 gpt_markdown_switch.py
```
> Add this as an alias to your `zshrc` or `bashrc` file to run the script from anywhere:
`alias switch-md="python3 ~/github/gpt-markdown-switch/gpt_markdown_switch.py"`The script will automatically detect if your `README.md` is in custom markdown format or standard markdown format and convert it accordingly.
## Todo
- [x] push v1 to GitHub
- [ ] publish to PyPi## Contributing
If you find any bugs or want to suggest new features, please feel free to contribute by submitting an [issue](https://github.com/gpt-markdown-switch/issues) or a [pull request](https://github.com/gpt-markdown-switch/pulls).
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://github.com/all-contributors/all-contributorsH1emoji-key)):[](#Contributing)
This project follows the [all-contributors](https://allcontributors.org/) specification. Contributions of any kind welcome!
## License
Licensed under the MIT license. See the [LICENSE](./LICENSE) file for more information.
If you found this project interesting or helpful, please consider [sponsoring me](https://github.com/sponsors/gpt-markdown-switch) or following me on twitter
![]()