A static website containing reuseable code snippets with zero fluff.
- Make sure you have node.js installed along with npm.
- Clone this repository:
git clone https://github.com/sourcesnippet/sourcesnippet.github.io - Navigate into the repository folder:
cd sourcesnippet.github.io - Install Dependencies:
npm i - Run the start command & you will see the website on
localhost:3000npm run start
To add your own snippet do the following:
- Create a new folder inside
snippets/& make sure there is no whitespace in the folder name. - Inside the newly created folder create an
index.mdxfile, You can use the following template to get started:export const metaData = { title: 'Your Title', thumbnail: "your-thumbnail.webp", author: "Your Name", // Optional authorWebsite: "https://yourwebsite.com/", // Optional createdOnDate: new Date("2023-11-01"), editedOnDate: new Date("2023-11-12"), // Optional tags: ["your", "tags", "here"], keywords: ["your", "keywords", "here"] // Optional, These are used purely in searching }; How to write Hello World: <CodeTabs id={"My-Code-Block"} activeIndex={1} dropdown={true} childrenStyle={"background-color:blue"}> ```Python print("Hello World") ``` ```txt display-name="Custom Name" style="background-color:green; height:10rem" Hello World! ``` </CodeTabs>
- You can also create
styles.css&script.jsfiles for custom styling & scripting (They will automatically be linked). - Once you've created your snippet rebuild the site to make sure everything is working & follows the guidelines.
- Make sure your snippets are short and to the point (No one wants to hear your backstory).
- Add links for any references, sources, credits at the bottom if used.
- Make sure to give your files & folder a relevant name in
kebab-casewhile avoiding words like "a", "and", "the", "is", etc. - Tag names should follow stackoverflow's tags naming convention & ideally no more than 5 tags per snippet.
- Compress your images & gifs before adding them in your snippet. Videos have to be hosted externally and embedded into the snippet.
- Do not add any low effort AI generated slop otherwise you will be banned from any further contributions.
Note:
Before adding your own snippet take a look at existing snippets especially if you're not sure of any conventions.
MIT NON-AI © Manas Ravindra Makde
