Skip to content

tryhackmeltd/docs.tryhackme.com

Repository files navigation



TryHackMe Documentation

Officially maintained documentation for all TryHackMe products, services & resources.

Travis (.com) branch Coveralls github branch All Contributors Open GitHub issues License: MIT

πŸ“š Read the documentation | Contributing to the documentation

Twitter: TryHackMe TryHackMe: Blog

Quick Links

πŸ“š Documentation

The documentation can be accessed at https://docs.tryhackme.com.

πŸ‘ Contributing

If you like the TryHackMe documentation and want to help make it better then check out our guidelines below! If you are simply interested in adding a new article, amending an existing article, or fixing any grammatical/formatting errors, then you can follow the instructions below.

Note: in order to contribute to the project you must have Node.js & NPM/Yarn installed. The Node.js binaries come with NPM bundled together, which can be downloaded at https://nodejs.org/download.

1. Clone repository and install dependencies

You can execute the commands below into your local terminal window.

$ git clone https://github.com/tryhackmeltd/docs.tryhackme.com.git  
$ cd ./docs.tryhackme.com-master  
$ yarn 

2. Start development server to run locally

Run the following in your local terminal window to start the local Node.js development server.
Ensure you are at the project's root directory (where package.json is located).

$ yarn start  

3. Editing <rootDir>/docs

All documentation markdown files (*.md), which together make up the content visible on the TryHackMe documentation site can be found within <rootDir>/docs.

Directories are treated as categories, and the markdown files are treated as articles, each belonging to a category. As an example, take docs/general/welcome; the general directory contains multiple markdown files (articles), which are treated as all belonging to the category general, which is their parent directory.

If you're adding a new article and feel it can be placed in an existing category, simply create a new markdown file My Article.md and drop it in the relevant directory. You need to make sure that you add the following header to any markdown file you add:

---  
id: article-id  
title: My Article Title  
sidebar_label: My Sidebar Label
---

As an example, let's say you want to add the article My Awesome Room to the existing category Rooms. First, you'd navigate to <rootDir>/docs/rooms. You are now in the Rooms category. Now, you'd create a markdown file in this directory called My Awesome Room.md and add the following header to the very top of the file:

---  
id: my-awesome-room  
title: My Awesome Room 
sidebar_label: My Awesome Room 
---
key description
id The article ID, ideally just a kebab-case version of the article's title, i.e. my-awesome-room
title The article's title, i.e. My Awesome Room
sidebar_label The title displayed in the sidebar, either the same as title or a shorter alternative

Now, save your changes, and if running the local development server you should be able to directly navigate to the document passing the URI docs/rooms/my-awesome-room. Note how the ID property is treated as the resource URI.

On the left of the document, there is the documentation sidebar, which looks something like this:

Example Sidebar

In order to add your new article to this sidebar, open <rootDir>/sidebars.js and locate the Rooms category. Then add the article to the items list, like so:

{
  type: 'category',
  label: 'Rooms',
  items: [
    'rooms/introduction-to-rooms',
    'rooms/room-difficulty-levels',
    'rooms/my-awesome-room' // ADD YOUR NEW ARTICLE REFERENCE HERE!
  ]
}

Once you are happy with your changes, save the file and re-visit the article in your browser. You will notice it should now appear on the sidebar! You can now open a pull-request to add your article to the live documentation site!

If you wish to create a new category, the process above is the same, except you add your articles to your newly created category directory! The only difference is you will need to create the category object within the <rootDir>/sidebars.js, rather than just appending the article to an existing one.

For example, let's say you wanted My Awesome Room to live inside a new Misc category, you'd create a directory called misc under <rootDir>/docs/, which would give you <rootDir>/docs/misc. Then, you'd add your my-awesome-room.md file inside this directory, ensuring you include the header as discussed before. Now, when editing <rootDir>/sidebars.js, you'd add a new object for the misc category, and then add your article as the first item in the items list, like so:

{
  type: 'category',
  label: 'Rooms',
  items: [
    'rooms/introduction-to-rooms',
    'rooms/room-difficulty-levels',
    'rooms/my-awesome-room'
  ]
},

/**
* ADD NEW MISC CATEGORY
*/
{
  type: 'category',
  label: 'Misc',
  items: [
    'misc/my-awesome-room' // ADDED NEW CATEGORY AND ARTICLE!
  ]
}

Lastly, if you would like to display your category (only for categories not articles) on the homepage of the site, add your config object to <rootDir/homepage-categories.js>. Simply open the file and append your category to the end of the array, ensuring you bump the id up 1 from the previous item. To add the misc category, you'd add the following:

module.exports = [
  {
    id: 1,
    title: 'Introduction',
    description: 'Just getting started with TryHackMe? Start here for a detailed introduction to our platform.',
    uri: '/docs/introduction/welcome'
  },
  {
    id: 2,
    title: 'What is TryHackMe?',
    description: 'Not entirely sure what TryHackMe is all about? This article will explain the core concepts behind what we offer.',
    uri: '/docs/introduction/what-is-tryhackme'
  },
  {
    id: 3,
    title: 'Why should I Join?',
    description: 'We know the reasons why you should join, but if you\'re still a bit sceptical then why not have a read.',
    uri: '/docs/introduction/why-should-i-join'
  },
  {
    id: 4,
    title: 'Getting Started',
    description: 'Want to get started with learning or teaching cyber security? This article is for you.',
    uri: '/docs/getting-started/introduction'
  },
  
  /**
  * ADDED THE MISC CATEGORY TO THE END OF THE LIST, INCREMENTING THE ID BY 1.
  */
  
  {
    id: 5,
    title: 'Misc',
    description: 'This is my new category that houses a lot of miscellaneous things.',
    uri: '/docs/misc/my-awesome-room' // THIS WILL BE THE URI TO THE FIRST ARTICLE IN THE CATEGORY, IN THIS CASE IT'S THE ONLY ARTICLE
  }

]

Once complete, commit your changes and open a pull request for us to review and merge.

Note: although adding and amending documentation markdown files should not affect any of the pre-existing unit tests, please ensure you check this prior to raising a pull request.

If you are making code edits, please ensure you update the relevant tests accordingly; including adding any tests to cover new functionality. Our TravisCI build expects 100% code coverage from Jest (with cirumstantial exceptions).

❓ FAQ

If you have questions about TryHackMe or this documentation and want answers, then check out our Discord or connect with us on Twitter and Instagram!

Alternatively, you may also ask questions on our forums.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Matt Kent

πŸš‡ ⚠️ πŸ’» 🎨 πŸ“– πŸ› πŸ‘€

Ben Spring

πŸ’» πŸ“– 🎨 πŸ‘€

MuirlandOracle

πŸ“–

Ben Eriksson

πŸ“–

Michael Spector

πŸ“–

Swafox

πŸ“–

James

πŸ“– πŸ›

Chevalier

πŸ“– πŸ›‘οΈ

ashu-savani

πŸ“–

Umair

πŸ›

Zultan

πŸ›

M. H.

πŸ“–

Hardeep Singh

πŸ“–

kaanis

πŸ“– πŸ›

ABHIJITH P K

πŸ›

Bee

πŸ“–

Ari Yonaty

πŸ›

Tony Kolstee

πŸ“–

Shubh4nk

πŸ“–

Swetabh Suman

πŸ“– πŸ›

cyberseguridadnet

πŸ›

Ash Caire

πŸ“– πŸ›

This project follows the all-contributors specification. Contributions of any kind welcome!

License

The TryHackMe documentation source code is boilerplated from the Docusaurus OSS, and is made available under the MIT license. Please check nested dependencies for their relevant licenses; some may be BSD etc.


License: MIT