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

docs(update versions): update versions #3653

Merged
merged 3 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
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
46 changes: 46 additions & 0 deletions cli/cmd/docgen_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ var docGenCmd = &cobra.Command{
fmt.Println(fmt.Errorf("could not create docusaurus sidebar file: %w", err).Error())
ExitCLI(1)
}

fixCodeBlocks(docsOutputDir)
}
},
PostRun: teardownCommand,
Expand Down Expand Up @@ -100,6 +102,50 @@ func generateContentItems(inputDir string, docusaurusRootFolder string) (string,
return entries.String(), nil
}

func fixCodeBlocks(inputDir string) error {
path, err := filepath.Abs(inputDir)
if err != nil {
return fmt.Errorf("could not get absolute path: %w", err)
}

files, err := os.ReadDir(inputDir)
if err != nil {
return fmt.Errorf("could not read dir: %w", err)
}

for _, file := range files {
filePath := filepath.Join(path, file.Name())
if !strings.HasSuffix(filePath, ".md") {
// ignore non-markdown files
continue
}

fileContent, err := os.ReadFile(filePath)
if err != nil {
return fmt.Errorf("could not read file (%s) content: %w", filePath, err)
}

fileChanged := false
lines := strings.Split(string(fileContent), "\n")
for i, line := range lines {
if len(line) > 0 && line[0] == '\t' {
lines[i] = fmt.Sprintf("```\n%s\n```", strings.TrimPrefix(line, "\t"))
fileChanged = true
}
}

if fileChanged {
fileContent := strings.Join(lines, "\n")
err = os.WriteFile(filePath, []byte(fileContent), os.ModeAppend.Perm())
if err != nil {
return fmt.Errorf("could not update file %s: %w", filePath, err)
}
}
}

return nil
}

func init() {
docGenCmd.Flags().StringVarP(&docsOutputDir, "output", "o", "", "folder where all files will be generated")
docGenCmd.Flags().StringVarP(&docusaurusFolder, "docusaurus", "d", "", "folder containing your docusaurus documentation content")
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ CLI to configure, install and execute tests on a Tracetest server
* [tracetest start](tracetest_start.md) - Start Tracetest
* [tracetest version](tracetest_version.md) - Display this CLI tool version

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ tracetest apply analyzer|config|datastore|demo|env|organization|pollingprofile|t

* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ See each sub-command's help for details on how to use the generated script.
* [tracetest completion powershell](tracetest_completion_powershell.md) - Generate the autocompletion script for powershell
* [tracetest completion zsh](tracetest_completion_zsh.md) - Generate the autocompletion script for zsh

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
14 changes: 10 additions & 4 deletions docs/docs/cli/reference/tracetest_completion_bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ If it is not installed already, you can install it via your OS's package manager

To load completions in your current shell session:

source <(tracetest completion bash)
```
source <(tracetest completion bash)
```

To load completions for every new session, execute once:

#### Linux:

tracetest completion bash > /etc/bash_completion.d/tracetest
```
tracetest completion bash > /etc/bash_completion.d/tracetest
```

#### macOS:

tracetest completion bash > $(brew --prefix)/etc/bash_completion.d/tracetest
```
tracetest completion bash > $(brew --prefix)/etc/bash_completion.d/tracetest
```

You will need to start a new shell for this setup to take effect.

Expand Down Expand Up @@ -51,4 +57,4 @@ tracetest completion bash

* [tracetest completion](tracetest_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
10 changes: 7 additions & 3 deletions docs/docs/cli/reference/tracetest_completion_fish.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ Generate the autocompletion script for the fish shell.

To load completions in your current shell session:

tracetest completion fish | source
```
tracetest completion fish | source
```

To load completions for every new session, execute once:

tracetest completion fish > ~/.config/fish/completions/tracetest.fish
```
tracetest completion fish > ~/.config/fish/completions/tracetest.fish
```

You will need to start a new shell for this setup to take effect.

Expand Down Expand Up @@ -42,4 +46,4 @@ tracetest completion fish [flags]

* [tracetest completion](tracetest_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
6 changes: 4 additions & 2 deletions docs/docs/cli/reference/tracetest_completion_powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Generate the autocompletion script for powershell.

To load completions in your current shell session:

tracetest completion powershell | Out-String | Invoke-Expression
```
tracetest completion powershell | Out-String | Invoke-Expression
```

To load completions for every new session, add the output of the above command
to your powershell profile.
Expand Down Expand Up @@ -39,4 +41,4 @@ tracetest completion powershell [flags]

* [tracetest completion](tracetest_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
18 changes: 13 additions & 5 deletions docs/docs/cli/reference/tracetest_completion_zsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,29 @@ Generate the autocompletion script for the zsh shell.
If shell completion is not already enabled in your environment you will need
to enable it. You can execute the following once:

echo "autoload -U compinit; compinit" >> ~/.zshrc
```
echo "autoload -U compinit; compinit" >> ~/.zshrc
```

To load completions in your current shell session:

source <(tracetest completion zsh)
```
source <(tracetest completion zsh)
```

To load completions for every new session, execute once:

#### Linux:

tracetest completion zsh > "${fpath[1]}/_tracetest"
```
tracetest completion zsh > "${fpath[1]}/_tracetest"
```

#### macOS:

tracetest completion zsh > $(brew --prefix)/share/zsh/site-functions/_tracetest
```
tracetest completion zsh > $(brew --prefix)/share/zsh/site-functions/_tracetest
```

You will need to start a new shell for this setup to take effect.

Expand Down Expand Up @@ -53,4 +61,4 @@ tracetest completion zsh [flags]

* [tracetest completion](tracetest_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ tracetest configure [flags]

* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ tracetest dashboard [flags]

* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ tracetest delete analyzer|config|datastore|demo|env|organization|pollingprofile|

* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ tracetest export analyzer|config|datastore|demo|env|organization|pollingprofile|

* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ tracetest get analyzer|config|datastore|demo|env|organization|pollingprofile|tes

* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ tracetest list analyzer|config|datastore|demo|env|organization|pollingprofile|te

* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
4 changes: 2 additions & 2 deletions docs/docs/cli/reference/tracetest_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ run resources
run resources

```
tracetest run test|testsuite [flags]
tracetest run testsuite|test [flags]
```

### Options
Expand Down Expand Up @@ -36,4 +36,4 @@ tracetest run test|testsuite [flags]

* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ tracetest server [flags]
* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server
* [tracetest server install](tracetest_server_install.md) - Install a new Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_server_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ tracetest server install [flags]

* [tracetest server](tracetest_server.md) - Manage your tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
3 changes: 1 addition & 2 deletions docs/docs/cli/reference/tracetest_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ tracetest start [flags]

```
--api-key string agent api key
-e, --endpoint string set the value for the endpoint, so the CLI won't ask for this value
--environment string environment id
-h, --help help for start
-l, --log-level string set the agent log level (default "debug")
Expand All @@ -37,4 +36,4 @@ tracetest start [flags]

* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
2 changes: 1 addition & 1 deletion docs/docs/cli/reference/tracetest_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ tracetest version [flags]

* [tracetest](tracetest.md) - CLI to configure, install and execute tests on a Tracetest server

###### Auto generated by spf13/cobra on 30-Jan-2024
###### Auto generated by spf13/cobra on 16-Feb-2024
12 changes: 6 additions & 6 deletions docs/docs/live-examples/opentelemetry-store/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Or, check out the hands-on workshop on YouTube!
cd opentelemetry-demo/
```

3. Run docker compose[^1] to start the demo:
3. Run Docker Compose to start the demo:

```shell
docker compose up --no-build
Expand All @@ -77,11 +77,11 @@ Or, check out the hands-on workshop on YouTube!

Once the images are built and containers are started you can access:

- Web store: <http://localhost:8080/>
- Grafana: <http://localhost:8080/grafana/>
- Feature Flags UI: <http://localhost:8080/feature/>
- Load Generator UI: <http://localhost:8080/loadgen/>
- Jaeger UI: <http://localhost:8080/jaeger/ui/>
- Web store: [`http://localhost:8080/`](http://localhost:8080/)
- Grafana: [`http://localhost:8080/grafana`](http://localhost:8080/grafana)
- Feature Flags UI: [`http://localhost:8080/feature`](http://localhost:8080/feature)
- Load Generator UI: [`http://localhost:8080/loadgen`](http://localhost:8080/loadgen)
- Jaeger UI: [`http://localhost:8080/jaeger/ui`](http://localhost:8080/jaeger/ui)

## Running Tracetests

Expand Down
4 changes: 2 additions & 2 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const lightCodeTheme = require('prism-react-renderer').themes.github;
const darkCodeTheme = require('prism-react-renderer').themes.dracula;

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down
Loading
Loading