Skip to content

Commit

Permalink
Feature : Added markdown-toc package to auto-generate toc with husky …
Browse files Browse the repository at this point in the history
…pre commit hook. (#1280)

* Included "update-toc" script in pre-commit hook (.husky/pre-commit) to automatically update TOC in INSTALLATION.md using markdown-toc package.

* Added auto-toc of content update-toc to update all markdown file toc

* moved update-toc.js to scritp directory

* added update-toc file to  script/githooks for auto-toc generation
  • Loading branch information
aialok authored Dec 29, 2023
1 parent eab9e4d commit d15cf33
Show file tree
Hide file tree
Showing 12 changed files with 588 additions and 59 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
npm run format:fix
npm run lint:fix
npm run typecheck
npm run update:toc

git add .
18 changes: 18 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Contributor Covenant Code of Conduct

# Table of Contents

<!-- toc -->

- [Our Pledge](#our-pledge)
- [Our Standards](#our-standards)
- [Enforcement Responsibilities](#enforcement-responsibilities)
- [Scope](#scope)
- [Enforcement](#enforcement)
- [Enforcement Guidelines](#enforcement-guidelines)
- [1. Correction](#1-correction)
- [2. Warning](#2-warning)
- [3. Temporary Ban](#3-temporary-ban)
- [4. Permanent Ban](#4-permanent-ban)
- [Attribution](#attribution)

<!-- tocstop -->

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
Expand Down
16 changes: 15 additions & 1 deletion CODE_STYLE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Talawa Admin Code Style

For Talawa Admin, most of the rules for the code style have been enforced with ESLint, but this document serves to provide an overview of the Code style used in Talawa Admin and the Rationale behind it.
Expand All @@ -7,6 +6,21 @@ The code style must be strictly adhered to, to ensure that there is consistency

code style should not be changed and must be followed.

# Table of Contents

<!-- toc -->

- [Tech Stack](#tech-stack)
- [Component Structure](#component-structure)
- [Code Style and Naming Conventions](#code-style-and-naming-conventions)
- [Test and Code Linting](#test-and-code-linting)
- [Folder/Directory Structure](#folderdirectory-structure)
- [Sub Directories of `src`](#sub-directories-of-src)
- [Imports](#imports)
- [Customising Bootstrap](#customising-bootstrap)

<!-- tocstop -->

## Tech Stack

- Typescript
Expand Down
26 changes: 14 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ If you are new to contributing to open source, please read the Open Source Guide

## Table of Contents

- [Contributing to Talawa-Admin](#contributing-to-talawa-admin)
- [Table of Contents](#table-of-contents)
- [Code of Conduct](#code-of-conduct)
- [Ways to Contribute](#ways-to-contribute)
- [Our Development Process](#our-development-process)
- [Issues](#issues)
- [Pull Requests](#pull-requests)
- [Branching Strategy](#branching-strategy)
- [Conflict Resolution](#conflict-resolution)
- [Contributing Code](#contributing-code)
- [Internships](#internships)
- [Community](#community)
<!-- toc -->

- [Code of Conduct](#code-of-conduct)
- [Ways to Contribute](#ways-to-contribute)
- [Our Development Process](#our-development-process)
- [Issues](#issues)
- [Pull Requests](#pull-requests)
- [Branching Strategy](#branching-strategy)
- [Conflict Resolution](#conflict-resolution)
- [Contributing Code](#contributing-code)
- [Internships](#internships)
- [Community](#community)

<!-- tocstop -->

## Code of Conduct

Expand Down
11 changes: 11 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Documentation
Welcome to our documentation guide. Here are some useful tips you need to know!

# Table of Contents

<!-- toc -->

- [Where to find our documentation](#where-to-find-our-documentation)
- [How to use Docusaurus](#how-to-use-docusaurus)
- [Other information](#other-information)

<!-- tocstop -->

## Where to find our documentation

Our documentation can be found in ONLY TWO PLACES:
Expand Down
36 changes: 16 additions & 20 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ This document provides instructions on how to set up and start a running instanc

# Table of Contents

- [Talawa-Admin Installation](#talawa-admin-installation)
- [Table of Contents](#table-of-contents)
<!-- toc -->

- [Prerequisites for Developers](#prerequisites-for-developers)
- [Installation](#installation)
- [Clone This Repository](#clone-this-repository)
- [Change Directory into the Cloned Repo](#change-directory-into-the-cloned-repo)
- [Setting up NPM](#setting-up-npm)
- [Setting up Typescript](#setting-up-typescript)
- [Setting up this repository](#setting-up-this-repository)
- [Setting up npm](#setting-up-npm)
- [Installing required packages/dependencies](#installing-required-packagesdependencies)
- [Configuration](#configuration)
- [Creating .env file](#creating-env-file)
Expand All @@ -30,6 +28,8 @@ This document provides instructions on how to set up and start a running instanc
- [pre-commit hook](#pre-commit-hook)
- [post-merge hook](#post-merge-hook)

<!-- tocstop -->

# Prerequisites for Developers

We recommend that you follow these steps before beginning development work on Talawa-Admin:
Expand All @@ -43,27 +43,25 @@ The INSTALLATION.md files in both repositories show you how. The Talawa-API INST

You will need to have copies of your code on your local system. Here's how to do that.

## Clone This Repository
## Setting up this repository

First you need a local copy of `talawa-admin`. Run the following command in the directory of choice on your local system.

```
git clone https://github.com/PalisadoesFoundation/talawa-admin
```

This will download a local copy of `talawa-admin` in that directory.

## Change Directory into the Cloned Repo

Right after cloning the repo you can change the directory of your current `terminal(shell)` to the root directory of cloned repository using this command:
1. Navigate to the folder where you want to setup the repository. Here, I will set it up in a folder called `talawa`.
2. Navigate to the folder and open a terminal in this folder (you can right-click and choose appropiate option based onn your OS). Next, we'll fork and clone the `talawa-admin` repository.
3. Navigate to [https://github.com/PalisadoesFoundation/talawa-admin/](hhttps://github.com/PalisadoesFoundation/talawa-admin/) and click on the `fork` button. It is placed on the right corner opposite the repository name `PalisadoesFoundation/talawa-admin`.
4. You should now see `talawa-admin` under your repositories. It will be marked as forked from `PalisadoesFoundation/talawa-admin`
5. Clone the repository to your local computer (replacing the values in `{{}}`):

```
cd talawa-admin
$ git clone https://github.com/{{YOUR GITHUB USERNAME}}/talawa-admin.git
```

This will setup the repository and the code files locally for you. For more detailed instructions on contributing code, and managing the versions of this repository with Git, checkout [CONTRIBUTING.md here](./CONTRIBUTING.md)

**NOTE:** `All the commands we're going to execute in the following instructions will assume you are in the root directory of the cloned talawa-admin project. If you fail to do so, the commands will not work.`

## Setting up NPM
## Setting up npm

Best way to install and manage `node.js` is making use of node version managers. Two most popular node version managers right now are [fnm](https://github.com/Schniz/fnm) and [nvm](https://github.com/nvm-sh/nvm). We'd recommend `fnm` because it's written in `rust` and is much faster than `nvm`. Install whichever one you want and follow their guide to set up `node.js` on your system.

Expand Down Expand Up @@ -207,7 +205,6 @@ npm run lint:fix

We are using the package `Husky` to run git hooks that run according to different git workflows.

<br/>

#### pre-commit hook

Expand All @@ -217,7 +214,6 @@ If you don't want these pre-commit checks running on each commit, you can manual

git commit -m "commit message" --no-verify

<br/>

#### post-merge hook

Expand Down
24 changes: 12 additions & 12 deletions ISSUE_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ In order to give everyone a chance to submit a issues reports and contribute to

___
## Table of Contents
<!-- TOC -->

- [Issue Report Guidelines](#issue-report-guidelines)
- [Table of Contents](#table-of-contents)
- [Issue Management](#issue-management)
- [New Issues](#new-issues)
- [Existing Issues](#existing-issues)
- [Feature Request Issues](#feature-request-issues)
- [Monitoring the Creation of New Issues](#monitoring-the-creation-of-new-issues)
- [General Guidelines](#general-guidelines)

<!-- /TOC -->

<!-- toc -->

- [Issue Management](#issue-management)
- [New Issues](#new-issues)
- [Existing Issues](#existing-issues)
- [Feature Request Issues](#feature-request-issues)
- [Monitoring the Creation of New Issues](#monitoring-the-creation-of-new-issues)
- [General Guidelines](#general-guidelines)

<!-- tocstop -->

___
## Issue Management

Expand Down
12 changes: 12 additions & 0 deletions PR_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@

In order to give everyone a chance to submit a pull request and contribute to the Talawa project, we have put restrictions in place. This section outlines the guidelines that should be imposed upon pull requests in the Talawa project.

# Table of Contents

<!-- toc -->

- [Pull Requests and Issues](#pull-requests-and-issues)
- [Linting and Formatting](#linting-and-formatting)
- [Testing](#testing)
- [Pull Request Processing](#pull-request-processing)
- [Only submit PRs against our `develop` branch, not the default `main` branch](#only-submit-prs-against-our-develop-branch-not-the-default-main-branch)

<!-- tocstop -->

## Pull Requests and Issues

1. Do not start working on any open issue and raise a PR unless the issue is assigned to you. PRs that don't meet these guidelines will be closed.
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ Core features include:

`talawa` is based on the original `quito` code created by the [Palisadoes Foundation][pfd] as part of its annual Calico Challenge program. Calico provides paid summer internships for Jamaican university students to work on selected open source projects. They are mentored by software professionals and receive stipends based on the completion of predefined milestones. Calico was started in 2015. Visit [The Palisadoes Foundation's website](http://www.palisadoes.org/) for more details on its origin and activities.

# Table of Contents

<!-- toc -->

- [Talawa Components](#talawa-components)
- [Documentation](#documentation)
- [Installation](#installation)

<!-- tocstop -->

# Talawa Components

`talawa` has these major software components:
Expand All @@ -37,4 +47,4 @@ Core features include:

# Installation

[Follow this guide](https://github.com/PalisadoesFoundation/talawa-admin/blob/develop/INSTALLATION.md)
[Follow this guide](https://github.com/PalisadoesFoundation/talawa-admin/blob/develop/INSTALLATION.md)
Loading

0 comments on commit d15cf33

Please sign in to comment.