in-toto / witness

Witness is a pluggable framework for software supply chain risk management. It automates, normalizes, and verifies software artifact provenance.
https://witness.dev
Apache License 2.0
416 stars 60 forks source link

Fix /docs/witness_completion.md formatting #291

Open BHunter2889 opened 1 year ago

BHunter2889 commented 1 year ago

Lines ~7-31 of the witness_completion.md doc seem to be incorrectly formatted per GFM: https://github.com/testifysec/witness/blob/602dc485b2b775e6c7cc66b11653a91fdef2aeda/docs/witness_completion.md?plain=1#L7-L31

Screenshot of rendered Preview: image

There are a few ways to take care of this but this is perhaps the simplest for what was intended:

To load completions:

Bash:
```
  $ source <(witness completion bash)
  # To load completions for each session, execute once:   
  # Linux:
  $ witness completion bash > /etc/bash_completion.d/witness
  # macOS:
  $ witness completion bash > /usr/local/etc/bash_completion.d/witness
```
Zsh:
```
  # 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
  # To load completions for each session, execute once:
  $ witness completion zsh > "${fpath[1]}/_witness"
  # You will need to start a new shell for this setup to take effect.
```
fish:
```
  $ witness completion fish | source
  # To load completions for each session, execute once:
  $ witness completion fish > ~/.config/fish/completions/witness.fish
```
PowerShell:
```
  PS> witness completion powershell | Out-String | Invoke-Expression
  # To load completions for every new session, run:
  PS> witness completion powershell > witness.ps1
  # and source this file from your PowerShell profile.
```

Which renders this: image

I would put up a PR after raising this, but I'm not sure this constitutes a "meaningful body of work" haha.

ChaosInTheCRD commented 12 months ago

Hi there 👋

@BHunter2889 Thanks for pointing this out! We are planning on doing a rehaul on our documentation in the coming weeks / months, but you pointing this out certainly is most helpful!

If you would like to submit a PR for this you are most welcome to and I will review/approve/merge 😄. If you would prefer otherwise I can go ahead and submit this myself, it's really up to you.

If there's anything big or small you notice in the future, any issue you file and suggestion you make is much appreciated.

Thanks!