Skip to content

Inline Help

manny kung edited this page Feb 10, 2019 · 2 revisions

Inline Help

Revised : 10 Feb 2019

Currently, mars-sim has a set of inline help pages to assist players to know the specifications of all processes and the available vehicle type during the simulation.

As developers, we may have to change the specs and update these html help files in the codebase from time to time.

When we compile mars-sim into binaries, it will grab these html pages and place them in the /resources folder.

Below are the steps for maintaining these html files up-to-date :

1. Generate the new html files

Use the command line argument -html for generating new html help files.

Alternatively, run the eclipse launcher MarsProject -html.launch in Eclipse IDE to do the same.

2. Locate the '/src' folder

In Windows OS, the html help files are kept inside the '/src' folder hierarchy is \mars-sim\mars-sim-ui\src\main\resources\docs\help\[$DIR]

e.g. D:\[$HOME]\git\mars-sim\mars-sim-ui\src\main\resources\docs\help\[$DIR]

3. Locate the '/target' folder

However, after running "MarsProjectFX -html.launch" in Eclipse, the newly generated htmls will be saved at the '/target' folder hierarchy instead of the '/src' folder is at \mars-sim-ui\target\classes\docs\help\[$DIR]

e.g. D:\Data\git\mars-sim\mars-sim-ui\target\classes\docs\help\[$DIR]

Note : the newly generated html files are located within the mars-sim-ui's 'target' folder and NOT the mars-sim-ui's 'src' folder.

4. Identify the [$DIR]

As a result, you will need to "manually" copy the newly generated htmls from the \target\[$DIR] to the \src\[$DIR] before committing the changes.

A total of 652 newly generated htmls using this HelpGenerator class can be broken into the followings :

  1. food_production*.html
  2. process*.html
  3. part*.html
  4. resource*.html
  5. $[vehicle_type].html

They are stored inside their respective directory [$DIR] as follows :

  1. /food
  2. /processes
  3. /parts
  4. /resources
  5. /vehicles

Note: the base directory /help contains other important html pages such as the tutorial pages. They do not need to be overwritten in this juncture unless you edited them.

5. Delete and Copy Operation

If the old htmls are mixed in with the newly generated htmls, there will be orphan html files that are not hyperlinked with other html files.

In order to have a totally clean set of htmls, it is recommended that one should delete the old set of htmls (1-5 above) in the \src\[$DIR] right before copying the new set of htmls from the \target\[$DIR].

6. Refresh Eclipse directory

There may be a time delay and refresh issue with Eclipse, if you use the Windows Explorer outside of Eclipse IDE to manually delete the old html pages and then copy over the new html files.

Afterward, make sure you "refresh" the Project Explorer in Eclipse so that it will intelligently compare which particular html files have been changed/updated and which ones stay the same. Eclipse will compare the new ones against the local copies. In this manner, during "Git Staging", Eclipse will properly tag and post only the html files that need to be updated in the mars-sim codebase.

e.g. you delete all 652 old html files in [$DIR] and copy over the new 652 html files. After you refresh the related folder in Eclipse, it would intelligently detect that only 30 html files (out of 652 files) need to be updated in the codebase during "Git Staging".

Clone this wiki locally