Skip to content

Commit

Permalink
Merge branch 'main' into im/update_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
IanMadd authored Sep 18, 2023
2 parents 95f7d07 + 3925a79 commit 5ff468c
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 74 deletions.
6 changes: 2 additions & 4 deletions content/reusable/md/chef_tags.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
A tag is a custom description that is applied to a node. A tag, once
applied, can be helpful when managing nodes using knife or when building
recipes by providing alternate methods of grouping similar types of
information.
A tag is a custom description that's applied to a node.
A tag, once applied, can be helpful when managing nodes using knife or when building recipes by providing alternate methods of grouping similar types of information.
33 changes: 17 additions & 16 deletions content/reusable/md/cookbooks_recipe_tags.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
Tags can be added and removed. Machines can be checked to see if they
already have a specific tag. To use tags in your recipe simply add the
following:
You can add tags, remove tags, and check if nodes have a specific tag.

To add a tag in your recipe, use `tag` with the tag name you want to apply to a node.

```ruby
tag('mytag')
tag('tag-name')
```

To test if a machine is tagged, add the following:
To test if a machine is tagged with a specific tag, use `tagged?` with the tag name.

```ruby
tagged?('mytag')
tagged?('tag-name')
```

to return `true` or `false`. `tagged?` can also use an array as an
argument.
This will return `true` or `false`.

`tagged?` also accepts an array as an argument.

To remove a tag:
Remove a tag using `untag`.

```ruby
untag('mytag')
untag('tag-name')
```

For example:

```ruby
tag('machine')
tag('test_node')

if tagged?('machine')
if tagged?('test_node')
Chef::Log.info("Hey I'm #{node['tags']}")
end

untag('machine')
untag('test_node')

unless tagged?('machine')
unless tagged?('test_node')
Chef::Log.info('I am not tagged')
end
```

Will return something like this:

```none
[Thu, 22 Jul 2010 18:01:45 +0000] INFO: Hey I'm machine
[Thu, 22 Jul 2010 18:01:45 +0000] INFO: I has no tagz
[Thu, 22 Jul 2010 18:01:45 +0000] INFO: Hey I'm test_node
[Thu, 22 Jul 2010 18:01:45 +0000] INFO: I am not tagged
```
8 changes: 2 additions & 6 deletions themes/docs-new/layouts/_default/data-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@
{{- end -}}
{{- end }}
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
{{ if in .Params.product "automate" }}
<link rel="stylesheet" type="text/css" href="/automate-api-stylesheet.css">
{{ else }}
<link rel="stylesheet" type="text/css" href="{{ $.Page.Params.style_sheet }}">
{{ end }}
<link rel="stylesheet" type="text/css" href="/api-stylesheet.css">
</head>
<body>
{{ if in .Params.product "automate" }}
{{ if eq $.Page.Params.title "Chef Automate API" }}
<div id="top-container">
<span id="top-container-return">
<a class="return" style="position: static;" href="{{ $.Page.Params.return_page }}">Return to Docs</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,33 @@ a.return {
padding:20px;
font-family: Montserrat, sans-serif;
font-weight: 400;
font-size: .9em;
line-height: 1.6em;
font-size: 14px;
line-height: 1.5em;
color: rgb(51, 51, 51);
background-color: rgb(250, 250, 250);
border-bottom: 1px solid rgb(225, 225, 225);
}

#top-container-return {
padding-left: 10px;
flex: 0 0 200px;
margin-top: 1em;
}

/* The following content is for a note at the top of the Automate API page */

#top-container-messages {
flex: 1 1 500px;
margin: 1em;
padding: 0 1em;
margin: 1em 1em 0 1em;
padding: 0;
border-radius: 3px;
display: flex;
flex-direction: column;
}

.top-container-message {
padding: 0 15px;
margin: 1em;
padding: 0;
margin: 0 1em;
border-radius: 3px;
}

Expand Down Expand Up @@ -82,10 +85,5 @@ p#top-container-warning {
}

.top-container-text {
padding: 1em;
}

redoc[spec-url] a img[src^="/images/chef-automate-logo.svg"] {
width: 220px;
margin: 20px;
padding: 0 1em;
}
24 changes: 0 additions & 24 deletions themes/docs-new/static/habitat-api-styles.css

This file was deleted.

4 changes: 4 additions & 0 deletions tools/vale/Microsoft/Contractions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ swap:
'where''s(?=\.)': where is

will not: won't
mightn't've: might not have
mustn't've: mustn't have
shouldn't've: shouldn't have
wouldn't've: wouldn't have
12 changes: 0 additions & 12 deletions tools/vale/write-good/E-Prime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,16 @@ level: suggestion
tokens:
- am
- are
- aren't
- be
- been
- being
- he's
- here's
- here's
- how's
- i'm
- is
- isn't
- it's
- she's
- that's
- there's
- they're
- was
- wasn't
- we're
- were
- weren't
- what's
- where's
- who's
- you're

0 comments on commit 5ff468c

Please sign in to comment.