Hi Olivia WIlcox,
Thank you for reaching out to Microsoft Q & A forum.
It seems the YAML code samples on the page may have lost their indentation and proper formatting, which is essential for YAML files to function correctly. This could be due to display or formatting errors on the page itself. To resolve this, you can manually reformat the code by following YAML's indentation rules. YAML files use spaces (not tabs) for indentation, with two spaces per level of nesting.
Steps to Fix YAML Formatting:
1.Understand YAML Basics:
Use spaces, not tabs, for indentation.
Indent by two spaces per level for nesting.
Format key-value pairs as key: value.
2.Organize the Code:
Start with top-level keys with no indentation.
For nested blocks, indent them by two spaces.
Use text editors for auto formatting:
1.Visual Studio Code (Recommended):
Open your YAML file, install the YAML extension (e.g., "YAML" by Red Hat), and use Shift + Alt + F to auto-format.
2.Notepad++:
Install the YAML plugin and use the "Auto Indent" feature under the "Plugins" menu.
3.PyCharm or IntelliJ:
Open the YAML file and use Code > Reformat Code (or the shortcut Ctrl + Alt + L) to auto-format.
Once you've reformatted the code, I recommend validating it using an online tool like YAML Lint to ensure its properly structured.
Please feel free to contact us if you have any additional questions.
If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community