How To Contribute Documents using VS Code

You may contribute to these documents through the following process.

Preparation

GitHub Account

Signup at GitHub

Fork Main Repository

Make local repository on your PC

_images/git-desktop.png

Execute GitHub Desktop enter following:

  • Select File > Clone repository

  • Enter repository “USERNAME/genian-nac-admin-guide”

Install Visual Studio Code on your PC

  • If you use Windows you need to install Visual Studio Code

  • Go to Visual Studio Code to download

_images/vscode.png

Import Project

  • Select File > Open Folder

  • Select your source directory “genian-nac-admin-guide”

Editing contents using Visual Studio Code

Create New Folder for Files

  • Right Click on >source > New Folder

  • Folder Name should be one word in lowercase that best describes section

Create New File within Folder

  • Right click on desired folder > New File

  • Filename should be lowercase, and a hyphen between words. .rst must follow the name. (e.g. some-name.rst)

Sample Page Formatting

(Header) <Some Title>
=====================
<Space Needed>
(Intro) <Some Intro>
<Space Needed>
(Sub-Title) <To Do Something>
-----------------------------
<Space Needed>
#. <Go to somewhere and do something>
#. <Next Step>
<Space Needed>
   -  <Sub-step>
   -  <Sub-step>
   -  <Sub-step>
   -  <Sub-step>
<Space Needed>
#. <Next Step>

Add Images To File

  • Copy image files from local machine to genian-nac-admin-guide\source\images folder

  • Add code for images where you would like your image to be

.. image:: /images/some-image.png
   :width: 500px

Add Table To File

+-----------+-----------+-----------+
|1st Column |2nd Column |3rd Column | <-----Title Block
+===========+===========+===========+
|           |           |           | <-----First Data Block
+-----------+-----------+-----------+

Add CLI Coding Box

.. code:: bash
<Space Needed>
 Lines of Code with no spaces to follow (*Single space before "Lines" needed)

Build your RST file to HTML

Install Sphinx on your PC

  • If you use Windows you need to install Python

  • Go to Python to download

Open Command Prompt enter following:

# pip install Sphinx
# pip install sphinx_rtd_theme

Build and Check your change

  • Click View > Integrated Terminal on VScode

  • Type ".\make html" to build

  • Check your directory "\genian-nac-admin-guide\build\html"

_images/makehtml.png

Apply your change to main repository

Commit and Push to your repo

  • Add a “Commit Message” on Left of GitHub Desktop

  • Click Commit

  • Click Push on Top of GitHub Desktop

  • Make sure your change file on Staged Changes

_images/Commit.png

Stay current with Main Repo changes

Update main repo changes to your local repo

  • Click "Push origin" to push repository

_images/push.png

Make Pull Request

  • Click Branch > Create pull request on Top Menu

  • Add a "Comment Message"

_images/pullrequest.png

(Main repository moderator will approve changes, or ask you to make some suggested changes)