Skip to content

Commit 042a26a

Browse files
authored
Merge pull request #3551 from aleksandrychev/CFE-4570
CFE-4570: Fixed several errors during docs generation
2 parents f25ae97 + c6b0e69 commit 042a26a

File tree

9 files changed

+27
-15
lines changed

9 files changed

+27
-15
lines changed

content/examples/tutorials/installing-cfengine-enterprise-agent.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ If you would like to see what version of CFEngine you are running, type:
5050

5151
Now, you have a client-server CFEngine running. If you would like to install more hosts, simply repeat steps 1 to 3 above. You are free to have up to 25 hosts. Enjoy!
5252

53-
Once you have installed the number of hosts you want, a good next step would be to take a look at our [How-to write your first policy][Writing CFEngine policy] tutorial.
53+
Once you have installed the number of hosts you want, a good next step would be to take a look at our [How-to write your first policy][Introduction to policy writing] tutorial.

content/getting-started/01-installation/general-installation/_index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ Although most install procedures follow the same general workflow, there are sev
134134

135135
## Next steps
136136

137-
- Learn about [Writing and serving policy][Writing and serving policy]
137+
- Learn about [Writing and serving policy][Policy writing]

content/getting-started/01-installation/general-installation/common_next_steps.include.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Next steps
22

3-
- [Writing and serving policy][Writing and serving policy]
3+
- [Writing and serving policy][Policy writing]
44
- [Examples and tutorials][Examples and tutorials]
55
- ["Hello World" Tutorial][Examples and tutorials#Tutorial for running examples]
66

content/guide/_index.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ experts if you need more help. Contact us!
6969
- [General installation]
7070
- [Upgrading]
7171
- [Secure bootstrap]
72-
- [Writing and serving policy][]
72+
- [Writing and serving policy][Policy writing]
7373
- [Language concepts][]
7474
- [Promises available in CFEngine][]
7575
- [Authoring policy tools & workflow][]

content/overview/_index.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Those policy files are distributed across all hosts within the system via downlo
2020

2121
CFEngine continually monitors all of the hosts in real-time, and should the system's current state begin to drift away from the intended state then CFEngine will automatically take corrective action to bring everything back into compliance.
2222

23-
See also: [Language concepts][], [Writing and serving policy][]
23+
See also: [Language concepts][], [Writing and serving policy][Policy writing]
2424

2525
## CFEngine policy servers and hosts
2626

2727
There are basically two categories of machines in a CFEngine environment: policy servers and their client hosts. Policy servers are responsible for making policy files available to each of the client hosts that have registered with it (a.k.a. bootstrapped), including itself. Hosts on the other hand are responsible for ensuring they continuously pull in the latest policy files, or changes to them, from the policy server. They are additionally responsible for ensuring they remain fully compliant with the instructions contained within the policy files, at all times.
2828

2929
The role of a particular machine where CFEngine is deployed determines which of the components will be installed and running at any given moment.
3030

31-
See also: [Writing and serving policy][]
31+
See also: [Writing and serving policy][Policy writing]
3232

3333
## CFEngine component applications and daemons
3434

generator/_scripts/cfdoc_metadata.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def parseHeader(lines):
4848
return header
4949
if not in_header:
5050
continue
51+
# Skip list items (lines starting with -)
52+
if line.lstrip().startswith("-"):
53+
continue
5154
token_list = line.split(":")
5255
if len(token_list) != 2:
5356
print("parseHeader: ERROR in %s - wrong number of tokens" % line)

generator/_scripts/cfdoc_references_resolver.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def load_references(references_file):
2929
ref, url, title = match.groups()
3030
if title is None:
3131
title = ""
32-
references[ref] = (url, title)
32+
# store with lowercase key for case-insensitive matching
33+
references[ref.lower()] = (url, title)
3334

3435
return references
3536

@@ -49,15 +50,16 @@ def replace_link(match):
4950
ref or text
5051
) # if ref is empty use text as ref to support cases like [ref][]
5152

52-
if ref in references:
53-
url, title = references[ref]
53+
ref_lower = ref.lower()
54+
if ref_lower in references:
55+
url, title = references[ref_lower]
5456
if title:
5557
return f'[{text}]({url} "{title}")'
5658
else:
5759
return f"[{text}]({url})"
5860
else:
5961
sys.stderr.write(
60-
f"References {ref} is not found in the _references.md. File: {file_path}"
62+
f"References {ref} is not found in the _references.md. File: {file_path}\n"
6163
)
6264
return match.group(0)
6365

@@ -69,15 +71,16 @@ def replace_link(match):
6971
def replace_function_link(match):
7072
ref = match.group(1)
7173
text = f"{ref}()"
72-
if ref in references:
73-
url, title = references[ref]
74+
ref_lower = ref.lower()
75+
if ref_lower in references:
76+
url, title = references[ref_lower]
7477
if title:
7578
return f'[{text}]({url} "{title}")'
7679
else:
7780
return f"[{text}]({url})"
7881
else:
7982
sys.stderr.write(
80-
f"References {ref} is not found in the _references.md. File: {file_path}"
83+
f"References {ref} is not found in the _references.md. File: {file_path}\n"
8184
)
8285
return match.group(0)
8386

generator/_scripts/cfdoc_sourcelinks.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def addLinkToSource(file_name, config):
110110
break
111111
if line.find("layout: printable") == 0:
112112
return 0
113+
if line.find("published: false") == 0:
114+
return 0
113115

114116
if not html_file:
115117
return 0
@@ -118,7 +120,11 @@ def addLinkToSource(file_name, config):
118120
unexpanded_macro = unexpandedMacroRegex()
119121

120122
error_count = 0
121-
html_file = config["CFE_DIR"] + "/" + html_file
123+
if html_file.endswith("index.html"):
124+
html_file = config["CFE_DIR"] + "/" + html_file
125+
else:
126+
html_file = config["CFE_DIR"] + "/" + html_file + "/index.html"
127+
122128
try:
123129
in_file = open(html_file, "r")
124130
lines = in_file.readlines()

generator/build/main.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function fetch_file() {
5757
local success=1 # 1 means False in bash, 0 means True
5858
set +e
5959
for i in $(seq 1 "$tries"); do
60-
wget "$target" -O "$destination" && success=0 && break
60+
wget -q "$target" -O "$destination" && success=0 && break
6161
if [ "$i" -lt "$tries" ]; then
6262
sleep 10s
6363
fi

0 commit comments

Comments
 (0)