Skip to content

Commit 09e8495

Browse files
authored
Merge pull request #3425 from aleksandrychev/ENT-12752
ENT-12752: Added support of new code blocks syntax
2 parents c5c0822 + 7ae145d commit 09e8495

36 files changed

+126
-123
lines changed

cheatsheet.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,7 @@ These two blocks will be joined into one element on the UI.
276276
You can specify file name of the code block by adding `[file=Name of the file]` in the first line.
277277
This line won't be shown in the resulting HTML (it will be converted to the heading / frame).
278278

279-
```cf3
280-
[file=policy.cf]
279+
```cf3 file=policy.cf
281280
bundle agent hello_world
282281
{
283282
meta:

examples.markdown

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ Go back into vi by typing "vi" at the prompt. Then type ```i``` to insert
106106
__body common control__ to `hello_world.cf`. Place it above __bundle agent hello_world__, as
107107
shown in the following example:
108108

109-
```cf3
110-
[file=hello_world.cf]
109+
```cf3 file=hello_world.cf
111110
body common control
112111
{
113112
bundlesequence => { "hello_world" };
@@ -136,8 +135,7 @@ notice: R: Hello World!
136135
**Note:** It may be necessary to add a reference to the standard library within the body common control section, and remove the `bundlesequence` line.
137136
Example:
138137

139-
```cf3
140-
[file=hello_world.cf]
138+
```cf3 file=hello_world.cf
141139
body common control
142140
{
143141
inputs => {
@@ -157,8 +155,7 @@ Again type "vi" then "Enter" then ```i``` to insert the following:
157155

158156
Add it before __body common control__, as shown below:
159157

160-
```cf3
161-
[file=hello_world.cf]
158+
```cf3 file=hello_world.cf
162159
#!/var/cfengine/bin/cf-agent --no-lock
163160
body common control
164161
{

examples/example-snippets/promise-patterns/example_ssh_keys.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ the [Masterfiles Policy Framework][Masterfiles Policy Framework]. The
1414
you do not have a `def.json` in the root of your masterfiles directory
1515
simply create it with the following content.
1616

17-
```json
18-
[file=def.json]
17+
```json file=def.json
1918
{
2019
"classes": {
2120
"services_autorun": [ "any" ]

examples/tutorials/custom_inventory.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ information we will write an inventory policy to report that information.
4646
Create `/var/cfengine/masterfiles/services/tutorials/inventory/owner.cf` with the
4747
following content:
4848

49-
```cf3
50-
[file=owner.cf]
49+
```cf3 file=owner.cf
5150
bundle agent tutorials_inventory_owner
5251
# @brief Inventory Owner information
5352
# @description Inventory owner information from `/vagrant/inventory_owner.csv`.

examples/tutorials/distribute-files-from-a-central-location.markdown

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ These variables provide path definitions for storing and deploying patches.
4747

4848
Add the following variable information to the `masterfiles/def.cf` file:
4949

50-
```cf3
51-
[file=def.cf]
50+
```cf3 file=def.cf
5251
"dir_patch_store"
5352
string => "/storage/patches",
5453
comment => "Define patch files source location",
@@ -75,8 +74,7 @@ promise type in a `server` bundle. The default access rules defined by the MPF (
7574

7675
There is no need to modify the vendored policy, instead define your own server bundle. For our example, add the following to `services/main.cf`:
7776

78-
```cf3
79-
[file=main.cf]
77+
```cf3 file=main.cf
8078
bundle server my_access_rules
8179
{
8280
access:
@@ -95,8 +93,7 @@ use is a good idea. This information is stored in a custom library.
9593

9694
Create a custom library called `lib/custom/files.cf`. Add the following content:
9795

98-
```cf3
99-
[file=files.cf]
96+
```cf3 file=files.cf
10097
bundle agent sync_from_policyserver(source_path, dest_path)
10198
# @brief Sync files from the policy server to the agent
10299
#
@@ -121,8 +118,7 @@ policy by services.
121118

122119
Create `services/patching.cf` with the following content:
123120

124-
```cf3
125-
[file=patching.cf]
121+
```cf3 file=patching.cf
126122
# Patching Policy
127123
128124
bundle agent patching

examples/tutorials/files-tutorial.markdown

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ Note: The following workflow assumes the directory /home/user already exists. If
8484

8585
## Create a File
8686

87-
```cf3
88-
[file=file_create.cf]
87+
```cf3 file=file_create.cf
8988
bundle agent testbundle
9089
{
9190
files:
@@ -126,8 +125,7 @@ rm /home/user/test_plain.txt
126125

127126
## Delete a File
128127

129-
```cf3
130-
[file=file_delete.cf]
128+
```cf3 file=file_delete.cf
131129
body common control
132130
{
133131
inputs => {
@@ -193,8 +191,7 @@ ls /home/user/test_plain.txt
193191
/var/cfengine/bin/cf-agent --no-lock --file ./file_test.cf --bundlesequence list_file,list_file_2
194192
```
195193

196-
```cf3
197-
[file=file_modify.cf]
194+
```cf3 file=file_modify.cf
198195
body common control
199196
{
200197
inputs => {
@@ -292,8 +289,7 @@ rm /home/user/test_plain.txt
292289

293290
## Copy a file and edit its text
294291

295-
```cf3
296-
[file=file_copy.cf]
292+
```cf3 file=file_copy.cf
297293
body common control
298294
{
299295
inputs => {

examples/tutorials/integrating-alerts-with-pager-duty.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ touch /tmp/file-integrity
2828

2929
Insert the following policy into `/tmp/file_example.cf`
3030

31-
```cf3
32-
[file=file_example.cf]
31+
```cf3 file=file_example.cf
3332
bundle agent file_integrity
3433
{
3534
files:

examples/tutorials/integrating-with-sumo-logic.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ As we can see above CFEngine detected a change on `Thursday Oct 2 at 01:16:42` a
158158

159159
The policy as found in `sumologic_policy_update.cf`.
160160

161-
```cf3
162-
[file=sumo_logic_policy_update.cf]
161+
```cf3 file=sumo_logic_policy_update.cf
163162
bundle agent sumo_logic_policy_update
164163
{
165164
vars:

examples/tutorials/json-yaml-support-in-cfengine.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ expressions or class names.
7676

7777
Easy, right?
7878

79-
```cf3
80-
[file=json_example.cf]
79+
```cf3 file=json_example.cf
8180
body common control
8281
{
8382
bundlesequence => { "run" };

examples/tutorials/manage-local-users.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ Create user group security and webadmin.
3030

3131
Create a file `/tmp/users.cf` with the following content:
3232

33-
```cf3
34-
[file=users.cf]
33+
```cf3 file=users.cf
3534
body common control
3635
{
3736
inputs => { "$(sys.libdir)/stdlib.cf" };

0 commit comments

Comments
 (0)