NinjaJc01 / docs.tryhackme.com

TryHackMe documentation site source code

Home Page:https://docs.tryhackme.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool



TryHackMe Documentation

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

Build Status Coverage Status All Contributors Build Status 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 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  
$ npm i  

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).

$ npm 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. Following the pre-existing structure all documents/articles are placed within their own sub-directories. This makes up the category URI for the request document, i.e. /getting-started. Inside of these sub-directories live both further nested categories and also individual markdown files which make up the resource URI. A complete example of this can be viewed as https://docs.tryhackme.com/docs/getting-started/introduction, which translates to <rootDir>/docs/getting-started/introduction.md.

To add a new document, either find a pre-exisitng location, if appropriate, or create a new sub-directory within <rootDir>/docs and create the relevant structure. Each markdown file MUST include a prefix header such as:

---  
id: introduction  
title: Getting Started Introduction  
sidebar_label: Introduction  
---

The id property is used by docusaurus in order to prefix the document as a unique entity. The title property is of course the document's title. The sidebar_label however is the name which is displayed when viewing any document within the documentation site. It is a navigatable sidebar and this property allows you to shorten the name to improve readability. You can see in the above example, this header prefix is taken from /docs/getting-started/introduction; as this lives within the sub-category "Getting Started" there is no need for the sidebar to contain the document's full title, as the context in which it introduces is pretty clear.

Below is a screenshot to demonstrate this:

Example Sidebar

Once you are happy with your changes, open <rootDir>/sidebars.js and following the predefined structure, add your new addition information to the config object. The structure is as follows:

module.exports = {
  docs: [
    {
      type: 'category',
      label: 'Introduction',
      items: [
        'introduction/welcome',
        'introduction/what-is-tryhackme',
        'introduction/why-should-i-join'
      ]
    },
    {
      type: 'category',
      label: 'Getting Started',
      items: [
        'getting-started/introduction',
        {
          type: 'category',
          label: 'Individual',
          items: [
            'getting-started/individual/creating-an-account',
            'getting-started/individual/openvpn-configuration',
            'getting-started/individual/deploying-your-first-vm'
          ]
        }

        /* ... */

      ]
    }
  ]
}

Lastly, if you would like to display your category on the homepage of the documentation site add your config object to <rootDir/homepage-categories.js>. The structure of this file is as follows:

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'
  },
  {
    id: 5,
    title: 'Introduction to Rooms',
    description: 'This article explains the concept of rooms, what they are, how to complete them and where to start.',
    uri: '/docs/rooms/introduction-to-rooms'
  }

/* ... */

]

Once complete, commit your changes to a branch of your choosing 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

πŸ’» πŸ“– 🎨

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

Note: To add a new contributor to this table, including yourself, comment on the following open issue: tryhackmeltd#3

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

About

TryHackMe documentation site source code

https://docs.tryhackme.com

License:MIT License


Languages

Language:JavaScript 57.7%Language:CSS 42.3%