Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #197

Merged
merged 4 commits into from
Jun 3, 2024
Merged
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
96 changes: 34 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
# Overview

Innovation Engine is a tool for rapid innovation and simplification.
Innovation Engine is a tool for rapid innovation and simplification. Innovation Engine contains
a CLI known as ie that enables execution and testing of Executable Documentation.

# Executable Documentation
## What is Executable Documentation?
Executable documentation takes standard markdown language and amplifies it by
allowing it to be executed step by step in an educational manner, and tested
allowing the code commands within the document to be executed in full or step by step in an educational manner, and tested
via automated CI/CD pipelines.

# Try Out Executable Documentation
Azure Cloud Shell provides an environment with all of the prerequisites
installed to run Executable Documentation. This is the recommended method for
new users to try and develop tutorials for Innovation Engine.
## Install Innovation Engine CLI
To install the Innovation Engine CLI, run the following commands. To install a specific version, set VERSION to the desired release number, such as "v0.1.3".
You can find all releases [here](https://github.com/Azure/InnovationEngine/releases).

Open [Azure Cloud Shell](https://ms.portal.azure.com/#cloudshell/) and select
Bash as the environment. Paste the following commands into the shell, this will
```bash
VERSION="latest"
wget -q -O ie https://github.com/Azure/InnovationEngine/releases/download/$VERSION/ie

# Setup permissions & move to the local bin
chmod +x ie
mkdir -p ~/.local/bin
mv ie ~/.local/bin
```

## Build Innovation Engine from Source
Paste the following commands into the shell. This will
clone the Innovation Engine repo, install the requirements, and build out the
innovation engine executable.
Innovation Engine executable.

```bash
git clone https://github.com/Azure/InnovationEngine;
Expand All @@ -30,10 +40,11 @@ command:
./bin/ie execute tutorial.md
```

# How to Use Innovation Engine
The general format to run an executable document is:
`ie <MODE_OF_OPERATION> <MARKDOWN_FILE>`

### Modes of Operation
## Modes of Operation
Today, executable documentation can be run in 3 modes of operation:

Interactive: Displays the descriptive text of the tutorial and pauses at code
Expand Down Expand Up @@ -86,44 +97,18 @@ similarity, 1 being an exact match.

### Environment Variables

Another barrier to automated testing is setting default values for test cases
to use in running. This problem can be solved with command line variables in
Executable documentation Syntax.

Default environment variables can be set for executable documentation in a few
different ways.

1. A matching .ini file to the markdown
- Upon running any document executable documentation will look for a
corresponding .ini file. For example if my markdown file is named tutorial.md
the corresponding ini file would be tutorial.ini.
- This file is a simple key value match for environment variable and value.
For example:
```ini
MY_RESOURCE_GROUP_NAME = myResourceGroup
MY_LOCATION = eastus
MY_VM_NAME = myVM
MY_VM_IMAGE = debian
MY_ADMIN_USERNAME = azureuser
```
2. A comment at the beginning of the document containing a code blog with the
tag 'variables'. This will be invisible to users unless they look at the raw
markdown. For example:
>**Note** The below example intentionally has broken comment syntax w/ two !'s.

<!!--
```variables
export MY_RESOURCE_GROUP_NAME=myResourceGroup22323
export MY_LOCATION=eastus
export MY_VM_NAME=myVM
export MY_VM_IMAGE=debian
export MY_ADMIN_USERNAME=azureuser
```
-->

Variables set in comments will override variables set in a .ini file.
Consequently, locally declared variables in code samples will override
variables set in comments.
You can pass in variable declarations as an argument to the ie CLI command using the 'var' parameter. For example:
```bash
ie execute tutorial.md --var REGION=eastus
```

CLI argument variables override environment variables declared within the markdown document,
which override preexisting environment variables.

Local variables declared within the markdown document will override CLI argument variables.

Local variables (ex: `REGION=eastus`) will not persist across code blocks. It is recommended
to instead use environment variables (ex: `export REGION=eastus`).

### Setting Up GitHub Actions to use Innovation Engine

Expand Down Expand Up @@ -169,19 +154,6 @@ jobs:
python3 main.py test README.md
```


## Use Executable Documentation for Interactive Documentation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is interactive mode something that we're not suggesting for users to use anymore?

Copy link
Member Author

@mbifeld mbifeld May 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is something we're still suggesting but these details are already in the 'Modes of Operation' section


Innovation Engine can also be used for interactive tutorials via a local or
remote shell environment. After cloning the project and running
`make build-ie`, Innovation Engine can be used for
interactive tutorials by simply using the interactive flag when executing the
program. For example, `./bin/ie interactive tutorial.md`

As it is written the code will pause and wait for input on any header or code
block. Any document written in standard markdown can be run as an interactive
document.

## Contributing

This is an open source project. Don't keep your code improvements,
Expand Down
Loading