diff --git a/content/examples/tutorials/installing-cfengine-enterprise-agent.markdown b/content/examples/tutorials/installing-cfengine-enterprise-agent.markdown index ac460b437..9607f485b 100644 --- a/content/examples/tutorials/installing-cfengine-enterprise-agent.markdown +++ b/content/examples/tutorials/installing-cfengine-enterprise-agent.markdown @@ -50,4 +50,4 @@ If you would like to see what version of CFEngine you are running, type: 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! -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. +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. diff --git a/content/getting-started/01-installation/general-installation/_index.markdown b/content/getting-started/01-installation/general-installation/_index.markdown index 1c25cb97a..b6719728e 100644 --- a/content/getting-started/01-installation/general-installation/_index.markdown +++ b/content/getting-started/01-installation/general-installation/_index.markdown @@ -134,4 +134,4 @@ Although most install procedures follow the same general workflow, there are sev ## Next steps -- Learn about [Writing and serving policy][Writing and serving policy] +- Learn about [Writing and serving policy][Policy writing] diff --git a/content/getting-started/01-installation/general-installation/common_next_steps.include.markdown b/content/getting-started/01-installation/general-installation/common_next_steps.include.markdown index 7818cb84e..8290ed1e2 100644 --- a/content/getting-started/01-installation/general-installation/common_next_steps.include.markdown +++ b/content/getting-started/01-installation/general-installation/common_next_steps.include.markdown @@ -1,6 +1,6 @@ # Next steps -- [Writing and serving policy][Writing and serving policy] +- [Writing and serving policy][Policy writing] - [Examples and tutorials][Examples and tutorials] - ["Hello World" Tutorial][Examples and tutorials#Tutorial for running examples] diff --git a/content/guide/_index.markdown b/content/guide/_index.markdown index 351e433f6..882bb2b2e 100644 --- a/content/guide/_index.markdown +++ b/content/guide/_index.markdown @@ -69,7 +69,7 @@ experts if you need more help. Contact us! - [General installation] - [Upgrading] - [Secure bootstrap] -- [Writing and serving policy][] +- [Writing and serving policy][Policy writing] - [Language concepts][] - [Promises available in CFEngine][] - [Authoring policy tools & workflow][] diff --git a/content/overview/_index.markdown b/content/overview/_index.markdown index b258ac218..55f97a381 100644 --- a/content/overview/_index.markdown +++ b/content/overview/_index.markdown @@ -20,7 +20,7 @@ Those policy files are distributed across all hosts within the system via downlo 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. -See also: [Language concepts][], [Writing and serving policy][] +See also: [Language concepts][], [Writing and serving policy][Policy writing] ## CFEngine policy servers and hosts @@ -28,7 +28,7 @@ There are basically two categories of machines in a CFEngine environment: policy The role of a particular machine where CFEngine is deployed determines which of the components will be installed and running at any given moment. -See also: [Writing and serving policy][] +See also: [Writing and serving policy][Policy writing] ## CFEngine component applications and daemons diff --git a/generator/_scripts/cfdoc_metadata.py b/generator/_scripts/cfdoc_metadata.py index e67154081..5b0258a5b 100644 --- a/generator/_scripts/cfdoc_metadata.py +++ b/generator/_scripts/cfdoc_metadata.py @@ -48,6 +48,9 @@ def parseHeader(lines): return header if not in_header: continue + # Skip list items (lines starting with -) + if line.lstrip().startswith("-"): + continue token_list = line.split(":") if len(token_list) != 2: print("parseHeader: ERROR in %s - wrong number of tokens" % line) diff --git a/generator/_scripts/cfdoc_references_resolver.py b/generator/_scripts/cfdoc_references_resolver.py index 434f6c06c..7f6fd9cb1 100644 --- a/generator/_scripts/cfdoc_references_resolver.py +++ b/generator/_scripts/cfdoc_references_resolver.py @@ -29,7 +29,8 @@ def load_references(references_file): ref, url, title = match.groups() if title is None: title = "" - references[ref] = (url, title) + # store with lowercase key for case-insensitive matching + references[ref.lower()] = (url, title) return references @@ -49,15 +50,16 @@ def replace_link(match): ref or text ) # if ref is empty use text as ref to support cases like [ref][] - if ref in references: - url, title = references[ref] + ref_lower = ref.lower() + if ref_lower in references: + url, title = references[ref_lower] if title: return f'[{text}]({url} "{title}")' else: return f"[{text}]({url})" else: sys.stderr.write( - f"References {ref} is not found in the _references.md. File: {file_path}" + f"References {ref} is not found in the _references.md. File: {file_path}\n" ) return match.group(0) @@ -69,15 +71,16 @@ def replace_link(match): def replace_function_link(match): ref = match.group(1) text = f"{ref}()" - if ref in references: - url, title = references[ref] + ref_lower = ref.lower() + if ref_lower in references: + url, title = references[ref_lower] if title: return f'[{text}]({url} "{title}")' else: return f"[{text}]({url})" else: sys.stderr.write( - f"References {ref} is not found in the _references.md. File: {file_path}" + f"References {ref} is not found in the _references.md. File: {file_path}\n" ) return match.group(0) diff --git a/generator/_scripts/cfdoc_sourcelinks.py b/generator/_scripts/cfdoc_sourcelinks.py index c0c17607f..a8f61d656 100644 --- a/generator/_scripts/cfdoc_sourcelinks.py +++ b/generator/_scripts/cfdoc_sourcelinks.py @@ -110,6 +110,8 @@ def addLinkToSource(file_name, config): break if line.find("layout: printable") == 0: return 0 + if line.find("published: false") == 0: + return 0 if not html_file: return 0 @@ -118,7 +120,11 @@ def addLinkToSource(file_name, config): unexpanded_macro = unexpandedMacroRegex() error_count = 0 - html_file = config["CFE_DIR"] + "/" + html_file + if html_file.endswith("index.html"): + html_file = config["CFE_DIR"] + "/" + html_file + else: + html_file = config["CFE_DIR"] + "/" + html_file + "/index.html" + try: in_file = open(html_file, "r") lines = in_file.readlines() diff --git a/generator/build/main.sh b/generator/build/main.sh index 9cb36759c..a55ef1dd7 100644 --- a/generator/build/main.sh +++ b/generator/build/main.sh @@ -57,7 +57,7 @@ function fetch_file() { local success=1 # 1 means False in bash, 0 means True set +e for i in $(seq 1 "$tries"); do - wget "$target" -O "$destination" && success=0 && break + wget -q "$target" -O "$destination" && success=0 && break if [ "$i" -lt "$tries" ]; then sleep 10s fi