Skip to content

Commit

Permalink
Added script to generate table of content (#1587)
Browse files Browse the repository at this point in the history
* Added script to generate table of content

* git hook to generate toc when markdown files are changed.

* script for toc
  • Loading branch information
Veer0x1 authored Dec 28, 2023
1 parent e5db82d commit 74a9f67
Show file tree
Hide file tree
Showing 11 changed files with 791 additions and 93 deletions.
7 changes: 7 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@ npm run lint:fix

npm run gen:schema

# Check if any markdown files have been changed
if git diff --cached --name-only | grep -E '\.md$'
then
# Generate table of contents for markdown files in root directory
npm run generate:toc
fi

# Add the changes made to the stage
git add .
19 changes: 18 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,6 +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
66 changes: 41 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,34 @@ If you are new to contributing to open source, please read the Open Source Guide

## Table of Contents

- [Contributing to Talawa API](#contributing-to-talawa-api)
- [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)
- [Upgrading Code](#upgrading-code)
- [Setting up Upstream and Origin](#setting-up-upstream-and-origin)
- [Creating a Pull Request - Process Overview](#creating-a-pull-request---process-overview)
- [Type checking and code quality](#type-checking-and-code-quality)
- [Type checking code files](#type-checking-code-files)
- [Linting code files](#linting-code-files)
- [Formatting code files](#formatting-code-files)
- [Automation using husky](#automation-using-husky)
- [Pre-Commit hook](#pre-commit-hook)
- [Post-Merge hook](#post-merge-hook)
- [GraphQL Voyager](#graphql-voyager)
- [GraphQL Markdown](#graphql-markdown)
- [Running Queries with talawa-api](#running-queries-with-talawa-api)
- [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)
- [Upgrading Code](#upgrading-code)
+ [Setting up Upstream and Origin](#setting-up-upstream-and-origin)
+ [Creating a Pull Request - Process Overview](#creating-a-pull-request---process-overview)
- [Type checking and code quality](#type-checking-and-code-quality)
* [Type checking code files](#type-checking-code-files)
* [Linting code files](#linting-code-files)
* [Formatting code files](#formatting-code-files)
* [Generating Table of Contents](#generating-table-of-contents)
* [Automation using husky](#automation-using-husky)
+ [Pre-Commit hook](#pre-commit-hook)
+ [Post-Merge hook](#post-merge-hook)
* [GraphQL Voyager](#graphql-voyager)
* [GraphQL Markdown](#graphql-markdown)
* [Running Queries with talawa-api](#running-queries-with-talawa-api)
- [Internships](#internships)
- [Community](#community)

<!-- tocstop -->

## Code of Conduct

Expand Down Expand Up @@ -237,6 +240,19 @@ To fix formatting issues in code use this command:-
<br/>
### Generating Table of Contents
To generate table of contents for markdown files use this command:-
```bash
npm run generate:toc
```
And if you want to generate table of content for specific file you can use the `markdown-toc` package directly as shown:-
```bash
npx markdown-toc -i README.md
```
Remember to replace `README.md` with the name of the file you want to generate table of contents for.
</br>
For more information on how to use `markdown-toc` package, visit [this link](https://www.npmjs.com/package/markdown-toc).

### Automation using husky

<br/>
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
100 changes: 51 additions & 49 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,71 @@ This document provides instructions on how to set up and start a running instanc

# Table of Contents

<!-- TOC -->
<!-- toc -->

- [Prerequisites](#prerequisites)
- [Install Node.js](#install-nodejs)
- [Install npm](#install-npm)
- [Install TypeScript](#install-typescript)
- [Install Git](#install-git)
- [Setting Up This Repository](#setting-up-this-repository)
- [Install the Required Packages](#install-the-required-packages)
- [Installation with Docker](#installation-using-docker)
* [Install node.js](#install-nodejs)
* [Install npm](#install-npm)
* [Install TypeScript](#install-typescript)
* [Install git](#install-git)
* [Setting up this repository](#setting-up-this-repository)
* [Install the Required Packages](#install-the-required-packages)
- [Setting up .env file](#setting-up-env-file)
- [Installation Using Docker](#installation-using-docker)
- [Installation without Docker](#installation-without-docker)
- [Install MongoDB](#install-mongodb)
- [Setting up the mongoDB database](#setting-up-the-mongodb-database)
- [Install Redis](#install-redis)
- [Setting Up Redis](#setting-up-redis)
- [Benchmark For Performance Benefits](#performance-benefits)
* [Install MongoDB](#install-mongodb)
+ [Setting up the mongoDB database](#setting-up-the-mongodb-database)
* [Install Redis](#install-redis)
+ [Performance Benefits](#performance-benefits)
+ [Setting Up Redis](#setting-up-redis)
- [Configuration](#configuration)
- [The .env Configuration File](#the-env-configuration-file)
- [Generating Token Secrets](#generating-token-secrets)
- [Setting up ACCESS_TOKEN_SECRET in .env file](#setting-up-access_token_secret-in-env-file)
* [The .env Configuration File](#the-env-configuration-file)
* [Changing the environment of talawa-api](#changing-the-environment-of-talawa-api)
* [Generating Token Secrets](#generating-token-secrets)
+ [Setting up ACCESS_TOKEN_SECRET in .env file](#setting-up-access_token_secret-in-env-file)
- [Linux](#linux)
- [Windows](#windows)
- [Setting up REFRESH_TOKEN_SECRET in .env file](#setting-up-refresh_token_secret-in-env-file)
- [Configuring MongoDB](#configuring-mongodb)
- [Setting up the MONGODB_URL in .env file](#setting-up-the-mongodb_url-in-env-file)
- [Using the CLI to get the MONGODB_URL Connection String](#using-the-cli-to-get-the-mongodb_url-connection-string)
- [Using Microsoft Windows to get the MONGODB_URL Connection String](#using-microsoft-windows-to-get-the-mongodb_url-connection-string)
- [Configuring Redis](#configuring-redis)
- [For Local Setup (Linux and WSL)](#for-local-setup-linux-and-wsl)
- [For Remote Setup (Redis Cloud)](#for-remote-setup-redis-cloud)
- [Setting up .env LAST_RESORT_SUPERADMIN_EMAIL parameter](#setting-up-env-last_resort_superadmin_email-parameter)
- [Configuring Google ReCAPTCHA](#configuring-google-recaptcha)
- [Setting up RECAPTCHA_SECRET_KEY in .env file](#setting-up-recaptcha_secret_key-in-env-file)
- [Setting up .env MAIL_USERNAME and MAIL_PASSWORD ReCAPTCHA Parameters](#setting-up-env-mail_username-and-mail_password-recaptcha-parameters)
- [Setting up .env SMTP Variables](#setting-up-env-smtp-variables)
- [Setting up Logger configurations _(optional)_](#setting-up-logger-configurations-optional)
- [Setting up COLORIZE_LOGS in .env file](#setting-up-colorize_logs-in-env-file)
- [Setting up LOG_LEVEL in .env file](#setting-up-log_level-in-env-file)
+ [Setting up REFRESH_TOKEN_SECRET in .env file](#setting-up-refresh_token_secret-in-env-file)
* [Configuring MongoDB](#configuring-mongodb)
+ [Setting up the MONGODB_URL in .env file](#setting-up-the-mongodb_url-in-env-file)
+ [Using the CLI to get the MONGODB_URL Connection String](#using-the-cli-to-get-the-mongodb_url-connection-string)
+ [Using Microsoft Windows to get the MONGODB_URL Connection String](#using-microsoft-windows-to-get-the-mongodb_url-connection-string)
* [Configuring Redis](#configuring-redis)
+ [For Local Setup (Linux and WSL)](#for-local-setup-linux-and-wsl)
+ [For Remote Setup (Redis Cloud)](#for-remote-setup-redis-cloud)
* [Setting up .env LAST_RESORT_SUPERADMIN_EMAIL parameter](#setting-up-env-last_resort_superadmin_email-parameter)
* [Configuring Google ReCAPTCHA](#configuring-google-recaptcha)
+ [Setting up RECAPTCHA_SECRET_KEY in .env file](#setting-up-recaptcha_secret_key-in-env-file)
+ [Setting up .env MAIL_USERNAME and MAIL_PASSWORD ReCAPTCHA Parameters](#setting-up-env-mail_username-and-mail_password-recaptcha-parameters)
+ [Setting up .env SMTP Variables](#setting-up-env-smtp-variables)
* [Setting up Logger configurations _(optional)_](#setting-up-logger-configurations-_optional_)
+ [Setting up COLORIZE_LOGS in .env file](#setting-up-colorize_logs-in-env-file)
+ [Setting up LOG_LEVEL in .env file](#setting-up-log_level-in-env-file)
- [Importing Sample Database](#importing-sample-database)
- [Syntax:](#syntax)
- [Examples:](#examples)
- [Sample Data Overview:](#sample-data-overview)
- [User Accounts and Organizations:](#user-accounts-and-organizations)
- [Posts](#posts)
- [Events](#events)
* [Syntax:](#syntax)
* [Examples:](#examples)
* [Sample Data Overview:](#sample-data-overview)
+ [User Accounts and Organizations:](#user-accounts-and-organizations)
+ [Posts](#posts)
+ [Events](#events)
- [Running Talawa-API](#running-talawa-api)
- [How to Access the Talawa-API URL](#how-to-access-the-talawa-api-url)
- [For Talawa-API Developers](#for-talawa-api-developers)
- [For Mobile App Developers](#for-mobile-app-developers)
- [On Android Virtual Device](#on-android-virtual-device)
- [On a Real Mobile Device](#on-a-real-mobile-device)
- [For Talawa-Admin Developers](#for-talawa-admin-developers)
* [For Talawa-API Developers](#for-talawa-api-developers)
* [For Mobile App Developers](#for-mobile-app-developers)
+ [On Android Virtual Device](#on-android-virtual-device)
+ [On a Real Mobile Device](#on-a-real-mobile-device)
* [For Talawa-Admin Developers](#for-talawa-admin-developers)
- [Accessing MongoDB](#accessing-mongodb)
- [Managing MongoDB using the MongoDB Compass GUI](#managing-mongodb-using-the-mongodb-compass-gui)
- [Managing MongoDB using the VSCode extension](#managing-mongodb-using-the-vscode-extension)
* [Managing MongoDB using the MongoDB Compass GUI](#managing-mongodb-using-the-mongodb-compass-gui)
* [Managing MongoDB using the VSCode extension](#managing-mongodb-using-the-vscode-extension)
- [Manually Adding The First Super Admin User](#manually-adding-the-first-super-admin-user)
- [Using MongoDB Compass](#using-mongodb-compass)
- [Using Mongo Shell](#using-mongo-shell)
* [Using MongoDB Compass](#using-mongodb-compass)
* [Using Mongo Shell](#using-mongo-shell)
- [Other](#other)
- [Changing default talawa-api port](#changing-default-talawa-api-port)
* [Changing default talawa-api port](#changing-default-talawa-api-port)
- [Testing](#testing)

<!-- /TOC -->
<!-- tocstop -->

# Prerequisites

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
@@ -1,3 +1,15 @@
## Table of Contents

<!-- toc -->

- [Pull Request Guidelines](#pull-request-guidelines)
* [Pull Requests and Issues](#pull-requests-and-issues)
* [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 Request Guidelines

:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@


<!-- toc -->

- [Talawa API](#talawa-api)
* [Talawa Components](#talawa-components)
* [Documentation](#documentation)
* [Installation](#installation)
* [Image Upload](#image-upload)

<!-- tocstop -->

# Talawa API
💬 Join the community on Slack. The link can be found in the `Talawa` [README.md](https://github.com/PalisadoesFoundation/talawa) file.

Expand Down
Loading

0 comments on commit 74a9f67

Please sign in to comment.