|
1 | | -# What is this? |
| 1 | +# Source Code to Website Converter |
2 | 2 |
|
3 | | -The github.dev web-based editor is a lightweight editing experience that runs entirely in your browser. You can navigate files and source code repositories from GitHub, and make and commit code changes. |
| 3 | +A Next.js application that allows you to convert HTML source code into a functional website preview with the ability to extract and download images. |
4 | 4 |
|
5 | | -There are two ways to go directly to a VS Code environment in your browser and start coding: |
| 5 | +## Features |
6 | 6 |
|
7 | | -* Press the . key on any repository or pull request. |
8 | | -* Swap `.com` with `.dev` in the URL. For example, this repo https://github.com/github/dev becomes http://github.dev/github/dev |
| 7 | +- Paste HTML source code and instantly preview the rendered result |
| 8 | +- Extract all images from the HTML source |
| 9 | +- Select and download images individually or in bulk |
| 10 | +- Responsive design that works on desktop and mobile devices |
| 11 | +- Sandbox mode for safe script execution in the preview |
9 | 12 |
|
10 | | -Preview the gif below to get a quick demo of github.dev in action. |
| 13 | +## Tech Stack |
11 | 14 |
|
12 | | - |
| 15 | +- [Next.js](https://nextjs.org/) - React framework |
| 16 | +- [React](https://reactjs.org/) - UI library |
| 17 | +- [TypeScript](https://www.typescriptlang.org/) - Type safety |
| 18 | +- [Tailwind CSS](https://tailwindcss.com/) - Styling |
| 19 | +- [shadcn/ui](https://ui.shadcn.com/) - UI components |
| 20 | +- [Radix UI](https://www.radix-ui.com/) - Headless UI primitives |
| 21 | +- [Lucide React](https://lucide.dev/) - Icon library |
13 | 22 |
|
14 | | -# Why? |
15 | | -It’s a quick way to edit and navigate code. It's especially useful if you want to edit multiple files at a time or take advantage of all the powerful code editing features of Visual Studio Code when making a quick change. For more information, see our [documentation](https://github.co/codespaces-editor-help). |
| 23 | +## Prerequisites |
| 24 | + |
| 25 | +- Node.js 18.x or later |
| 26 | +- npm or yarn or pnpm |
| 27 | + |
| 28 | +## Getting Started |
| 29 | + |
| 30 | +### Clone the repository |
| 31 | + |
| 32 | +```bash |
| 33 | +git clone https://github.com/yourusername/source-code-converter.git |
| 34 | +cd source-code-converter |
| 35 | + |
| 36 | + |
| 37 | +## Step one Install dependencies |
| 38 | + |
| 39 | +```npm install |
| 40 | +# or |
| 41 | +yarn install |
| 42 | +# or |
| 43 | +pnpm Install |
| 44 | +
|
| 45 | +## Step two Run Development server |
| 46 | +
|
| 47 | +```npm run dev |
| 48 | +# or |
| 49 | +yarn dev |
| 50 | +# or |
| 51 | +pnpm dev |
| 52 | + |
| 53 | +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 54 | + |
| 55 | +## Usage |
| 56 | + |
| 57 | +1. Paste your HTML source code into the left textarea |
| 58 | +2. Click the "Convert" button |
| 59 | +3. View the rendered HTML in the "Preview" tab |
| 60 | +4. Switch to the "Images" tab to see all images found in the HTML |
| 61 | +5. Select the images you want to download |
| 62 | +6. Click "Download Selected" to save the images to your device |
| 63 | + |
| 64 | +## Project Structure |
| 65 | + |
| 66 | +source-code-converter/ |
| 67 | +├── app/ |
| 68 | +│ ├── layout.tsx # Main layout component |
| 69 | +│ └── page.tsx # Home page component |
| 70 | +├── components/ |
| 71 | +│ ├── ui/ # UI components from shadcn/ui |
| 72 | +│ └── SourceCodeConverter.tsx # Main converter component |
| 73 | +├── styles/ |
| 74 | +│ └── globals.css # Global styles and Tailwind directives |
| 75 | +└── lib/ |
| 76 | + └── utils.ts # Utility functions |
| 77 | + |
| 78 | + |
| 79 | +## Customization |
| 80 | + |
| 81 | +You can customize the UI by modifying the Tailwind theme in `tailwind.config.ts` and the global styles in `styles/globals.css`. |
| 82 | + |
| 83 | +## Deployment |
| 84 | + |
| 85 | +This project can be easily deployed to Vercel: [https://vercel.com/](Vercel) |
0 commit comments