A web application with two tools built using Next.js, Mantine, and Tailwind CSS:
- AI Text Parser: Cleans AI-generated text by removing hashtags (#, ##, ###, etc.) and double asterisks (**).
- Code Comment Remover: Removes comments from code in various programming languages, with options to select comment types or specify exceptions.
The app features a responsive UI with a navbar for navigation, autosize textareas, and copy/reset functionality.
- Input for pasting AI-generated text
- Removes hashtags and double asterisks
- Side-by-side input/output layout
- Reset button to clear input/output
- Copy button for cleaned text
- Preserves newlines and normalizes whitespace
- Input for pasting code
- Removes single-line (//, #, --, ;, %), multi-line (/* */), and XML/HTML () comments
- Multiselect to choose comment types or remove all (default)
- Optional regex pattern to preserve specific comments (e.g., //eslint-disabled-next-line)
- Side-by-side input/output layout
- Reset button to clear input/output
- Copy button for cleaned code
- Preserves code structure and newlines
- Next.js: React framework for server-side rendering and routing
- Mantine: UI component library for React
- Tailwind CSS: Utility-first CSS framework for styling
- TypeScript: For type-safe JavaScript development
- Tabler Icons: Icon library for React
- Node.js (v16 or higher)
- npm (v7 or higher)
-
Clone the repository (if applicable) or create a new Next.js project:
npx create-next-app@latest ai-parser cd ai-parser
-
Install dependencies:
npm install @mantine/core @mantine/hooks @tabler/icons-react tailwindcss postcss autoprefixer
-
Initialize Tailwind CSS:
npx tailwindcss init -p
-
Run the development server:
npm run dev
Open http://localhost:3000 for the AI Text Parser or http://localhost:3000/comment-remover for the Code Comment Remover.
- Navigate to the root URL (
/
) using the navbar. - Paste AI-generated text with hashtags or double asterisks into the textarea.
- Click "Clean Text" to remove hashtags and double asterisks.
- View the cleaned text in the right-hand output area.
- Use the "Copy" button to copy the cleaned text or "Reset" to clear all fields.
- Navigate to
/comment-remover
using the navbar. - Paste code with comments into the textarea.
- Select comment types to remove (e.g., "All Comments," "Single-line," "Multi-line," "XML/HTML") via the multiselect.
- Optionally enter a regex pattern (e.g.,
//eslint-disabled-next-line
) to preserve specific comments. - Click "Remove Comments" to process the code.
- View the cleaned code in the right-hand output area.
- Use the "Copy" button to copy the cleaned code or "Reset" to clear all fields.
app/page.tsx
: AI Text Parser page with text cleaning logicapp/comment-remover/page.tsx
: Code Comment Remover page with comment removal logicapp/layout.tsx
: Root layout with Mantine provider and navbarapp/globals.css
: Global styles with Tailwind CSS setuptailwind.config.js
: Tailwind CSS configurationpostcss.config.js
: PostCSS configuration for Tailwind
- Add real-time text cleaning for both tools
- Support more comment types (e.g., Lua, MATLAB)
- Enhance exception handling for comment remover with predefined patterns
- Implement file upload for batch processing
- Add mobile-friendly collapsible navbar
- Highlight active navbar link with distinct styling
Submit issues or pull requests to enhance functionality or fix bugs. Ensure code follows the existing style and includes tests.
This project is licensed under the MIT License.