How can I view docs in markdown format in GitHub flavour
- User
How can I view docs in markdown format in GitHub flavour
- Assistant
Viewing documentation in Markdown format using GitHub Flavored Markdown (GFM) is straightforward. Here are some steps to ensure your Markdown docs are properly displayed on GitHub:
-
Filename Extension: Make sure your document has the appropriate file extension. Typically, Markdown files have
.mdor.markdownextensions. -
Text Editors: You can write your Markdown content in any plain text editor. Some popular editors that offer good Markdown support include:
- Visual Studio Code: Offers excellent support with live preview extensions.
- Atom: Has built-in Markdown preview.
- Typora: A Markdown editor with live preview.
-
Push to Repository: Once your Markdown file is ready, push it to your GitHub repository. If you’re not familiar with git commands, here’s a basic workflow:
git add yourfile.md git commit -m "Add documentation" git push origin your-branch -
Viewing on GitHub: Navigate to the file in your GitHub repository. GitHub automatically renders
.mdfiles using GitHub Flavored Markdown, which includes:- Headers: Defined using
#,##,###, etc. - Lists: Both ordered and unordered lists.
- Links:
[link text](URL) - Code Blocks: Fenced by triple backticks (```) or indented by four spaces.
- Tables: Created using
|and-.
- Headers: Defined using
-
GFM Features: GitHub Flavored Markdown has a few extensions beyond standard Markdown:
- Task Lists:
- [ ]for unchecked boxes and- [x]for checked boxes. - Syntax Highlighting for Code Blocks: Use triple backticks followed by the language name.
- Strikethrough: Use
~~strikethrough~~to strike through text. - Tables: Use pipes (
|) to create tables.
- Task Lists:
Here is an example Markdown document with various features:
# My Project Documentation ## Table of Contents 1. [Introduction](#introduction) 2. [Features](#features) 3. [Installation](#installation) 4. [Usage](#usage) 5. [Contributing](#contributing) ## Introduction Welcome to the **My Project** documentation. ## Features - Easy to use - Fast performance - Supports multiple languages ## Installation To install, run: ```bash npm install my-projectUsage
To use the project, import it into your file:
import MyProject from 'my-project'; MyProject.doSomething();Contributing
Contributions are welcome! Please open a pull request.
Task List
- Initialize repository
- Add unit tests
- Write more documentation
Table Example
Feature Description Easy to use Simple and intuitive Performance Optimized for speed Once pushed to GitHub, this content will be rendered accordingly with headers, lists, tables, and syntax highlighting. -