# Modules

Every documentation project contains at least one help module. This is the directory where all configuration and content files of your Writerside project are located.

If the whole project is dedicated exclusively to documentation, you do not need a separate directory for the help module. You can put everything directly in the project root.

However, it is better to keep everything related to your documentation sources in a dedicated directory, separate from the IDE-specific project configuration files, and especially so if your documentation is in the same project as the source code. You can even have multiple Writerside modules in separate directories in the project if you need to manage several documentation sets, each with its own configuration files, instances, topics, and images. It is still possible to share content between instances in different modules.

## Module structure

Every help module should have the following files and directories:

writerside.cfg
: The main configuration file defines the basic Writerside project settings and [instances](instances.html). This file is how Writerside knows where the root directory of your help module is.
:
:
:
: > **Note:**
: > In older versions of Writerside, the name of this file was `project.ihp`. If you have the old name in your project, there is no need to rename it, because they are equivalent.
:
:
:
: For more information, see [writerside.cfg](writerside-cfg.html).

topics/
: The directory for topic files contains `.md` and `.topic` files. You can register a different directory for topics in  `[writerside.cfg](writerside-cfg.html)` .

images/
: The directory for media contains images, animated GIFs, and videos used in your project. You can register a different directory for images in  `[writerside.cfg](writerside-cfg.html)` .

*.tree
: The tree file defines the [table of contents](table-of-contents.html): the order and hierarchy of topics in an [instance](instances.html). In the tree file, you also specify the name and unique ID for this instance.
:
:
:
: The name is used as the main title in the output, and the ID must be the same as the name of the tree file without the extension. For example, `aa.tree` might define an instance with `id="aa"` and `name="Awesome App"`.
:
:
:
: Every instance must be registered in  `[writerside.cfg](writerside-cfg.html)`  by specifying its tree file in the  [&lt;instance&gt;](writerside-cfg.html#instance)  element.

The following files and directories are optional:

v.list
: The list of global project [variables](variables.html) with their default values.
:
:
:
: Register this file in the `<vars>` element in  `[writerside.cfg](writerside-cfg.html)` .

c.list
: The list of categories defines groups of related links for the [See also](links-and-references.html#see-also) section of a topic.
:
:
:
: Register this file in the `<categories>` element in  `[writerside.cfg](writerside-cfg.html)` .

redirection-rules.xml
: The configuration file for redirection rules.

resources/
: The directory for resources contains files that readers can [download](downloadable-resources.html). You can register a different directory for downloadable resources in  `[writerside.cfg](writerside-cfg.html)` .

code-snippets/
: The directory for code snippets contains files with pieces of code that you can insert as samples in code blocks. Register this directory in the `<snippets>` element in  `[writerside.cfg](writerside-cfg.html)` .

cfg/
: The directory for build configuration files.
:
:
:
: The build configuration directory can contain the following files:
:
:
:
: * `[buildprofiles.xml](buildprofiles-xml.html)` is used to configure the final output.
:
: * `build-script.xml` is used to configure the build process.
:
: * `glossary.xml` is used to define terms and their descriptions that you can use in [tooltips](tooltips.html).

## Writerside project with multiple modules

Let's say you have a Writerside project with one module and two instances: an Installation Guide and an Administration Guide.

Writerside tool window:

![Writerside tool window: one module, two instances](https://resources.jetbrains.com/help/img/writerside/one_module_two_instances.png)

Project tool window:

![Project tool window: one module, two instances](https://resources.jetbrains.com/help/img/writerside/one_module_two_instances_project_dark.png)

Both instances are in the same module – the default `Writerside` directory.

Procedure: Rename module

1. In the Project tool window, right-click the `Writerside` directory, select Refactor, then click Rename.

2. Specify a different name for the directory (for example, `main-docs`) and click Refactor.

Procedure: Create module

1. In the Project tool window, right-click the project root, select New, then click Directory.

2. Type the name for the new module directory (for example, `supplementary`) and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

3. Right-click the new module directory, select New, then click File.

4. Type the name of the main configuration file:  `[writerside.cfg](writerside-cfg.html)`  and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

5. Add some boilerplate markup to  `[writerside.cfg](writerside-cfg.html)` :

```XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ihp SYSTEM "https://resources.jetbrains.com/writerside/1.0/ihp.dtd">
<ihp version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/writerside-cfg.xsd">

</ihp>
```

When you restart the project, it will show the new module in the  Writerside tool window.

Writerside tool window:

![Writerside tool window: two modules](https://resources.jetbrains.com/help/img/writerside/two_modules_wrs_tool_window.png)

Project tool window:

![Project tool window: two modules](https://resources.jetbrains.com/help/img/writerside/two_modules_prj_tool_window.png)

Add [instances](instances.html) to the new module. Add and configure the  [topics directory](#topics-dir)  and the  [images directory](#images-dir)  that will hold content specific for documentation in this module. If you need to re-use a topic, snippet, or image from another module, use the [origin](semantic-markup-reference.html#include_origin) attribute. For example:

```XML
<include origin="main-docs" from="lib.topic" element-id="important_note"/>
```

