This is an AI-powered content editor with text manipulation features and automatic link suggestion functionality built with Next.js, OpenAI, and Jina AI.
- Select any portion of text (words, sentences, paragraphs)
- Apply various transformations:
- Rewrite (rephrase while maintaining meaning)
- Simplify (reduce complexity of language)
- Make longer (expand content with additional relevant details)
- Uses OpenAI API for text transformations
- Add contextually relevant external links to selected text
- Refine link suggestions with custom keywords
- Powered by Jina AI's search capabilities
- Insert links with appropriate anchor text and formatting
- Node.js 18.x or later
- OpenAI API key
- Jina AI API key
- Clone the repository
git clone https://github.com/yourusername/ai-powered-content-editor.git
cd ai-powered-content-editor- Install dependencies
npm install-
Configure environment variables
- Rename
.env.local.exampleto.env.local - Add your API keys:
NEXT_PUBLIC_OPENAI_API_KEY=your_openai_api_key_here NEXT_PUBLIC_JINA_API_KEY=your_jina_api_key_here
- Rename
-
Run the development server
npm run dev- Open http://localhost:3000 with your browser to see the result.
- Select any text in the editor
- Use the toolbar buttons to:
- Transform selected text (rewrite, simplify, or extend)
- Get link suggestions for selected text
- Accept or reject the transformations and link suggestions
- Next.js - React framework
- Tailwind CSS - Styling
- OpenAI API - Text transformations
- Jina AI - Smart link suggestion
- React Icons - UI icons
- Headless UI - Accessible UI components
This project is licensed under the MIT License - see the LICENSE file for details.
- Select any text in the editor
- Click the "Transform Text" button in the toolbar
- Choose from available transformations (rewrite, simplify, extend)
- The AI will transform your text while maintaining context
- Select any text in the editor that you want to link
- Click the "Add Links" button in the toolbar
- The editor will use Jina.ai's DeepSearch API to find relevant links for your selected text
- A menu will appear showing suggested links based on your selection
- You can:
- Click the "Apply" button beside any link to immediately apply that single link
- Check the checkbox beside multiple links and then click "Apply Selected Link" to apply the first selected link
- Use the checkboxes to select multiple links, which will be inserted as a markdown list
- The selected text will be converted into a hyperlink or a list of links depending on your selection
- You can refine results by entering comma-separated keywords in the search box
If you want to quickly select content, you can use the "Select Paragraph" button, which will randomly select one paragraph from your content.
This project uses OpenAI for text transformations and Jina.ai for link suggestions. You need to configure API keys in your .env.local file:
NEXT_PUBLIC_OPENAI_API_KEY=your_openai_api_key_here
NEXT_PUBLIC_JINA_API_KEY=your_jina_api_key_here
- Clone the repository
- Install dependencies:
npm install - Create
.env.localand add your API keys - Run the development server:
npm run dev - Open http://localhost:3000 in your browser
The link suggestion feature uses Jina.ai's DeepSearch API to find relevant links based on your selected text. When you select text and click "Add Links", the application:
- Extracts keywords from your selection
- Sends a search request to the Jina.ai API
- Displays the most relevant results in a dropdown menu
- When you click "Add Link", it wraps your selected text in an HTML anchor tag with the target URL
You can also provide custom keywords to refine the search results if the automatic suggestions aren't relevant enough.