Eğitim / Kodlama 16 Nisan 2024

What is a GitHub Wiki and How Do You Use it?

What is a GitHub Wiki and How Do You Use it?

A GitHub wiki is a great place for your project’s documentation. You can use the wiki to create, manage, and host documentation for your repository so others can use and contribute to your project.

GitHub wikis are easy to start using without installing any other software. The best part is that the wiki is integrated with your GitHub repository.

You do not need any other tool – you just need to know how to use markdown, as you’ll use it to write your wiki. (You can read all about that in my other article here.)

How to Start Using GitHub Wiki

You can start your GitHub wiki with just one click. Every GitHub repository has a Wiki tab in the menu at the top of the page. To start, click on it.

What is a GitHub Wiki and How Do You Use it?
GitHub repository Page

The wiki tab is sometimes not shown by default in the GitHub repository nav bar. First, you’ll need to enable wikis in your repository settings.

What is a GitHub Wiki and How Do You Use it?
No wiki tab is shown.

To do that, go to your repository settings page, scroll down, and find the features section. Then enable wikis by checking the “Wikis” box.

What is a GitHub Wiki and How Do You Use it?
Enable wiki 

To initialize the wiki in your GitHub repository, create the home page in your wiki.

What is a GitHub Wiki and How Do You Use it?
Initialize the wiki in GitHub.

When you click the “Create the first page” button, you’ll be redirected to the editor page where you can create a home page in the wiki.

What is a GitHub Wiki and How Do You Use it?
Create a home page and initialize the wiki.

Your wiki home page should now look like this:

What is a GitHub Wiki and How Do You Use it?
Wiki home page

How to Clone a GitHub Wiki Locally

Sometimes, new developers are confused about how to clone the wiki locally. To do this, just copy the link where it says “Clone this wiki locally”, as you can see in the image below:

What is a GitHub Wiki and How Do You Use it?
Copy the link to clone the GitHub wiki.

Copy that link and clone the GitHub wiki repository locally on your laptop or machine.

Now, you can make changes in the wiki, such as editing, updating, or changing documentation locally. After you finish any documentation changes, you can push your local wiki documentation to the GitHub wiki repository.

$ git clone https://github.com/officialrajdeepsingh/github-wiki-tutorial.wiki.git
Cloning into 'github-wiki-tutorial.wiki'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6 (delta 1), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.
Resolving deltas: 100% (1/1), done.
Clone the repository locally.

How to Customize Your Wiki

Wikis have limited customization options for the sidebar, home page, and footer. But you can extend these options using HTML, CSS, and Markdown.

We have already discussed the home page, and now we’ll discuss the footer and sidebar.

The footer and sidebar show or contain helpful links such as contact information, navigation links, social media links, and so on.

The footer is shown at the bottom of every page on your site, and the sidebar is typically a vertical column on the left or right side of a web page. Both are visible on all pages of the wiki.

There are two ways to create a sidebar in the GitHub wiki.

  1. With the GitHub UI
  2. Locally in your IDE

We’ll look at each method here so you can choose the one that works best for you.

With the GitHub UI

What is a GitHub Wiki and How Do You Use it?
Create a sidebar

Go to the wiki home page and click on the “Add a custom sidebar” button to create a sidebar in your wiki.

Next, it will redirect you to the editor page to create a sidebar page. In the sidebar file, you can write markdown content such as navigation links, and so on. After that, click the save button.

What is a GitHub Wiki and How Do You Use it?
Create _Sidebar.md file.

Locally in your IDE

The second way is to clone your wiki locally and then create a _Sidebar.md
file in your wiki at the root level using VS Code or any other IDE which you like.

You’ll follow basically the same steps as in the sidebar section to create your custom wiki footer.

With the GitHub UI

What is a GitHub Wiki and How Do You Use it?

Go to your wiki page and click on the “Add a custom footer” button to create a footer in your wiki.

Next, it will redirect you to the editor page to create a footer. In the footer file, you can write markdown content such as navigation links, and so on. After that, click the save button.

What is a GitHub Wiki and How Do You Use it?
Create a footer

Locally in your IDE

The second way is to clone your wiki locally and then create a _Footer.md
file in your wiki at the root level using VS Code or any other IDE which you like.

What is a Page? How Do You Create a New Page in the Wiki?

In a wiki, a page has functionality similar to other CMSs, giving you the power to manage your content and documentation.

With the wiki page, you can divide your content or docs into different sections such as installation, configuration, and so on.

To create a new page, click on the new page button.

What is a GitHub Wiki and How Do You Use it?
Create a new wiki page

It redirects you to the editor page, where you can add a title and content. After your writing is finished, click on the save button.

What is a GitHub Wiki and How Do You Use it?
Create a wiki page

Your page looks like this in the wiki after it is published:

What is a GitHub Wiki and How Do You Use it?
The Wiki page looks like this in the browser after publishing.

Everybody can access your pages section. Every page you publish is shown in the pages section on your wiki.

What is a GitHub Wiki and How Do You Use it?
The page section shows the published page list.

How to Enable and Disable Collaboration in the Wiki

To enable collaboration for everyone in the wiki, go to your GitHub repository settings page, scroll down, find the features, and unselect the “Restrict editing to collaborators only” checkbox.

What is a GitHub Wiki and How Do You Use it?
Enable Collaboration in the GitHub Wiki.

You can turn off collaboration for everyone, so that you and your team are the only ones responsible for updating, deleting, and editing the wiki.

To do this, you need to restrict editing for other users. Enabling the Restrict editing to collaborators only option quickly accomplishes this.

After there haven’t been any edits, invite your team and give them access to it. Then just click the “Restrict editing to collaborators only” checkbox.

What is a GitHub Wiki and How Do You Use it?
Disable Collaboration in the GitHub Wiki.

Why is GitHub Wiki So Useful?

GitHub wikis can be useful for everyone. You can start your documentation with a wiki in less than one minute. You do not need anything to start writing your documentation except basic knowledge of Markdown syntax.

Using GitHub wikis, you can just focus on writing basic documentation and on the project itself. GitHub wiki handles the rest of your documentation such as hosting concerns, search, and so on. Most importantly, for public repository wikis, it’s totally free.

Many famous open-source projects use Wiki nowadays, such as hhvm, neovim, guard, foundation db, and others.

Check out the list of projects used in Wiki.

Conclusion

There are many documentation frameworks on the market, such as Nextra, Lume, Starlight, and Docusaurus. But they take some time to learn, configure, and set up.

Also, if you’re still working on your coding skills and you aren’t comfortable with tools like React, MDX, and so on, you’ll need to take some time to learn them before using these more advanced documentation frameworks.

With GitHub Wiki, you can start creating your documentation right away, and you do not need to worry about deploying and hosting anything managed by GitHub.

GitHub Wiki is a great choice for small and early-stage projects. You and your team can focus on the project while composing straightforward documentation.

source

Spread the love <3

You may also like...

Ağu
06
2024
0

Doğuş Teknoloji’nin kullanıcı dostu ürünü: D-Logger

İnternet güvenliğinin her geçen gün daha da önemli hale geldiği günümüzde, Doğuş Teknoloji, yeni ürünü D-Logger ile sektöre güvenli ve...

Spread the love <3
Kas
01
2024
0

Fiyaskoyla sonuçlanan Concord’un maliyeti dudak uçuklattı

Sony için tam bir fiyasko ile sonuçlanan Concord, Firewalk stüdyosunun kapatılmasına yol açtı. Bununla birlikte son raporlar, oyunun üretim maliyetleriyle...

Spread the love <3

VC Arjun Sethi talks a big game about selling his company-picking strategies to other investors; he says they’re buying it

Arjun Sethi speaks with the confidence of someone who knows more than other people, or at least knows that sounding...

Spread the love <3
Mar
11
2024
11
Uygun fiyatlı vivo T3 5G’nin özellikleri sızdı!

Uygun fiyatlı vivo T3 5G’nin özellikleri sızdı!

Son dönemlerde akıllı telefon pazarındaki payını önemli seviyede artıran vivo, bu başarısını sürdürebilmek için ürün yelpazesini genişletmeye devam ediyor. Bu...

Spread the love <3
Whatsapp İletişim
Merhaba,
Size nasıl yardımcı olabilirim ?