Installation & Setup

DevSnips is a dependency-free resource, which means there is no traditional installation process. You can use the snippets directly from the website or clone the repository for local access.

Cloning the Repository

If you want to have a local copy of all the snippets and the DevSnips website, you can clone the official GitHub repository. This is useful for offline access or for contributing to the project.

  1. Open your terminal or command prompt.
  2. Navigate to the directory where you want to store the project.
  3. Run the following command:
git clone https://github.com/developer8sarthak/DevSnips.git

Local Setup

Once you have cloned the repository, you can run the DevSnips website locally. This is a great way to explore the project and test any changes you might make.

  1. Navigate into the newly created `DevSnips` directory:
  2. cd DevSnips
  3. Since the website is built with static HTML, CSS, and JavaScript, you can simply open the `index.html` file in your browser. For the best experience, we recommend using a simple local server to avoid any potential issues with file paths. If you have Python installed, you can run:
  4. python3 -m http.server
  5. This will start a local server, and you can view the website by navigating to `http://localhost:8000` in your browser.

Folder Structure Explained

The DevSnips repository has a straightforward folder structure:

  • /: The root directory contains the main pages of the website, such as `index.html`, `snippets.html`, and `playground.html`.
  • /devsnips/: This is where the core snippet files are located, organized by language.
    • /devsnips/snippets/html-snippets/: Contains all HTML snippets.
    • /devsnips/snippets/css-snippets/: Contains all CSS snippets.
    • /devsnips/snippets/js-snippets/: Contains all JavaScript snippets.
  • /public/docs/: Contains all the documentation pages.
  • /stylesheets/: Contains the CSS files for the website.
  • /javascript-files/: Contains the JavaScript files that power the website's functionality.