Skip to content

Commit fa1dc92

Browse files
Review readme procedures on building locally (#4287)
* Review readme procedures on building locally --------- Co-authored-by: Lena Ansorgová <[email protected]>
1 parent 4be2706 commit fa1dc92

File tree

1 file changed

+35
-44
lines changed

1 file changed

+35
-44
lines changed

guides/README.md

Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ This README file explains how to work with the guides included in this repositor
88

99
Install the required tools.
1010

11+
1. Install the required packages:
12+
1113
* In Fedora perform:
1214

1315
dnf -y groupinstall development-tools
1416
dnf -y install ruby ruby-devel rubygem-bundler linkchecker
1517

16-
Then continue to [install Ruby gems](#installing-ruby-gems).
17-
1818
* In RHEL perform:
1919

2020
dnf module enable ruby:2.7
@@ -23,7 +23,6 @@ Install the required tools.
2323
pip3 install linkchecker
2424

2525
If you prefer to install Python packages into home folder rather than system-wide folder (requires root), then add `--user` option to the `pip3` command.
26-
Then continue to [install Ruby gems](#installing-ruby-gems).
2726

2827
* In MacOS, required tools can be installed via brew but instead of "make" call "gmake":
2928

@@ -35,82 +34,74 @@ Install the required tools.
3534

3635
xcode-select --install
3736

38-
Then continue to [install Ruby gems](#installing-ruby-gems).
39-
40-
### Installing Ruby gems
41-
37+
2. Install Ruby gems.
4238
In the `foreman-documentation` folder, run:
4339

44-
make prep
40+
make prep
4541

4642
### Building HTML artifacts
4743

48-
Run `make` or `make html`, either in the `guides/` directory or in `doc-*/` subdirectories.
49-
When you run "make" in `guides/`, it builds all guides.
50-
51-
To speed up the build process, make sure to use `-j` option. Ideally, set it to amount of cores plus one:
52-
53-
make -j9
54-
55-
An alias is often useful:
56-
57-
alias make="make -j$(nproc)"
58-
59-
The final artifacts can be found in the `./build` subdirectory.
60-
Note that GNU Makefile tracks changes and only builds relevant artifacts.
61-
To trigger a full rebuild, use `make clean` to delete the build directory and start over.
62-
63-
### Builds
64-
65-
There are the following builds:
44+
To build HTML artifacts, run the `make` command.
45+
If you run the command in the `guides/` directory, all guides are built.
46+
If you run the command in a`doc-*/` subdirectory, a single guide is built.
6647

6748
- `make BUILD=foreman-el` - This builds guides for Foreman on Enterprise Linux (EL) without the Katello plugin.
6849
This is the default build for `make html`.
6950
- `make BUILD=foreman-deb` - This builds guides for Foreman on Debian/Ubuntu without the Katello plugin.
7051
- `make BUILD=katello` - This builds guides for Foreman on EL with the Katello plugin.
7152
- `make BUILD=satellite` - This builds a preview of guides for Satellite.
7253
- `make BUILD=orcharhino` - This builds a preview of guides for orcharhino.
54+
- `make browser` (run from a `doc-*/` subdirectory) - This builds the HTML version and opens a new tab in a browser.
7355

74-
### Building a single guide
75-
76-
Few additional make targets are available on the guide level.
77-
To quickly build HTML version and open new tab in a browser do:
78-
79-
cd doc-Provisioning_Hosts
80-
make browser
81-
82-
### Checking links
56+
To view the built HTML artifact, go to the `./build` subdirectory and locate the `*.html` file you need.
57+
Note that GNU Makefile tracks changes and only builds relevant artifacts.
58+
To trigger a full rebuild, use `make clean` to delete the build directory and start over.
8359

84-
It's also possible to check links; the following command will check all links except example.com domain:
60+
To speed up the build process, make sure to use `-j` option. Ideally, set it to amount of cores plus one:
8561

86-
make linkchecker
62+
make -j9
8763

88-
#### Disabling the linkchecker for a specific URL pattern
64+
An alias is often useful:
8965

90-
You can disable the linkcheck job for specific URL pattern, for example for unreleased downstream documentation or to exclude URLs that cannot resolve by design.
91-
Append your pattern to `guides/common/linkchecker.ini`.
92-
Example: [64d825cc9](https://github.com/theforeman/foreman-documentation/commit/64d825cc9da3992879dfbfc088988197edc9f33b)
66+
alias make="make -j$(nproc)"
9367

9468
### Building locally by using a container
9569

9670
You can build Foreman documentation locally using a container image.
9771
This requires the cloned git repository plus an application such as Podman or Docker to build and run container images.
9872

73+
Run the following commands from your `foreman-documentation` directory:
74+
9975
1. Build container image:
10076

10177
podman build --tag foreman_documentation .
10278

103-
2. Build Foreman documentation.
104-
Run this command in your `foreman-documentation` repository:
79+
2. Build Foreman documentation:
10580

10681
rm -rf guides/build && podman run --rm -v $(pwd):/foreman-documentation foreman_documentation make html
10782

10883
On SELinux enabled systems, run this command:
10984

11085
rm -rf guides/build && podman run --rm -v $(pwd):/foreman-documentation:Z foreman_documentation make html
11186

87+
## Testing link integrity with linkchecker
88+
89+
The repository includes a linkchecker GitHub Action to check the validity of links used in the documentation.
90+
91+
### Running a link check manually
92+
93+
You can check links in your local repository.
94+
The following command checks all links except example.com domain:
95+
96+
make linkchecker
97+
98+
### Disabling the linkchecker for a specific URL pattern
99+
100+
You can disable the linkcheck job for specific URL pattern, for example for unreleased downstream documentation or to exclude URLs that cannot resolve by design.
101+
Append your pattern to `guides/common/linkchecker.ini`.
102+
Example: [64d825cc9](https://github.com/theforeman/foreman-documentation/commit/64d825cc9da3992879dfbfc088988197edc9f33b)
112103

113-
## Generating a TOC file
104+
### Generating a TOC file
114105

115106
For properly testing link integrity in the code, you will need to generate a TOC file.
116107
This file can be generated using `make toc` command either from a container or locally.

0 commit comments

Comments
 (0)