Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 219 additions & 0 deletions docs/OCP_writer_cheatSheet.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
= Use `=` for the document titleJohn Doe <john.doe@example.com>

== Use `==` for a level 1 section title

=== Use `===` for a level 2 section title

==== Use `====` for a level 3 section title

A paragraph of text goes here. This is a simple paragraph demonstrating how to create regular text.

==== Special sections

.Prerequisites
* A dot (.) at the beginning of a line that is immediately followed by a word with no space between the dot and the word creates a special section.
* We typically use special sections to block off prerequisites and procedures.
* A dot followed by a space followed by a word creates an ordered list item. Make sure you use your dotes wisely!
* Item four

.Procedure
. Step one
. Step two

==== Lists

* Use `*` for a bullet list item.
* Another bullet item.
** Use `**` for a second-level bullet list item.
*** Use `***` for a third-level bullet list item.

. Use `.` for an ordered list item.
. Another ordered item.
.. Use `..` for a second-level ordered list item.
... Use `...` for a third-level ordered list item.

==== Links

Link to an external website: http://example.com[Example Link]

Link to a section within the document: <<_section,Section Title>>

==== Includes

Include another file: include::path/to/file.adoc[]

==== Images

image::path/to/image.png[Image Title]

==== Tables

[cols="3*"]
|===
|Column 1 |Column 2 |Column 3

|Row 1, Column 1
|Row 1, Column 2
|Row 1, Column 3

|Row 2, Column 1
|Row 2, Column 2
|Row 2, Column 3
|===

==== Code blocks

[source,python]
----
def hello_world():
print("Hello, World!")
----

==== Terminal Commands

[source,bash]
----
$ ls -la
$ git status
----

==== YAML Code

[source,yaml]
----
version: '3'
services:
web:
image: nginx
ports:
- "80:80"
database:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: example
----

==== Code and commands within lists

When writing your procedures, you may notice that the numbered list begins again at 1 after a list item that contains a code block. Keep code within the list item by include a `+`.

.Example

. List item 1
+
[source,python]
----
def hello_world():
print("Hello, World!")
----

. List item 2

==== Quotes

[quote,Author,Book Title]
____
This is a block quote.
____

==== Notes and admonitions

[NOTE]
====
This is a note block.
====

[TIP]
====
This is a tip block.
====

[IMPORTANT]
====
This is an important message.
====

[WARNING]
====
This is a warning message.
====

[CAUTION]
====
This is a caution message.
====

NOTE: You can also make a note (or any other block) like this, but we typically don’t.

==== Inline Formatting

*Italic text* can be created using asterisks.
**Bold text** can be created using double asterisks.
`Monospaced text` can be created using backticks.

==== Comments

// This is a comment. Use `//` at the start of a line to create a comment.

= 5 most common git procedures

== Update your local branch

[source,git]
----
// Switches to the main branch
git checkout main

// Fetches changes from the upstream repository
git fetch upstream

// Reapplies commits from the current branch onto the latest changes from upstream/main
git rebase upstream/main

// Pushes the updated main branch to the origin repository
git push origin main
----

== Create a new feature branch

[source,git]
----
// Creates a new branch with the specified name
git checkout -b <branch-name>
----

== Stage and push changes

[source,git]
----
// Stages all changes
git add .

// Commits the changes with a message
git commit -m "<branch-name>: message goes here"

// Forces a push of the branch to the origin repository
git push origin <branch-name> --force
----

== Make changes to an existing PR

[source,git]
----
// Switches to the branch with the specified name
git checkout <branch-name>
// Make changes in the working directory

// Stages all changes
git add .

// Commits the changes with a message
git commit -m "<branch-name>: message goes here"

// Interactively rebases the last 2 commits
git rebase -i HEAD~2

// Forces a push of the branch to the origin repository
git push origin <branch-name> --force
----