Skip to content

Commit

Permalink
Merge pull request #1270 from garikAsplund/contributing-docs-fixes
Browse files Browse the repository at this point in the history
Fix no copy code block and weird link
  • Loading branch information
Timothy McCallum authored May 7, 2024
2 parents e01009f + 4af8250 commit 612336e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions content/spin/v2/contributing-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,23 @@ hello

The no copy annotation (`<!-- @nocpy -->`) precedes a code block where no copy and pasting of code is intended. If using the no copy attribute please still be sure to add the appropriate syntax highlighting to your code block (for display purposes). For example:

`<!-- @nocpy -->`
![No Copy Source Code Example](/static/image/no-copy-source-code-example.png)

```bash
Please find copyable snippet below, for your convenience:

````
<!-- @nocpy -->
```text
Some generic code not intended for copying/pasting
```
````

The above markdown will render the following code block on the web page:

<!-- @nocpy -->

```text
Some generic code not intended for copying/pasting
```

Expand All @@ -187,7 +201,7 @@ If you want the code in a code block to be copyable with no "smarts" to remove t

**Multi-tab code blocks**

Multi-tab code blocks [have recently been implemented](https://github.com/fermyon/developer/pull/239). Examples can be seen in the [Spin](./install#installing-spin) installer documentation](./install#installing-spin) and [Spin Key/Value documentation](./key-value-store-tutorial#the-spin-toml-file). The above examples demonstrate how tabs can either represent platforms i.e. `Windows`, `Linux` and `macOS` or represent specific programming languages i.e. `Rust`, `JavaScript` and `Golang` etc. Here is a brief example of how to implement multi-tab code blocks when writing technical documentation for this site, using markdown.
Multi-tab code blocks [have recently been implemented](https://github.com/fermyon/developer/pull/239). Examples can be seen in the [Spin installer documentation](./install#installing-spin) and [Spin Key/Value documentation](./key-value-store-tutorial#the-spin-toml-file). The above examples demonstrate how tabs can either represent platforms i.e. `Windows`, `Linux` and `macOS` or represent specific programming languages i.e. `Rust`, `JavaScript` and `Golang` etc. Here is a brief example of how to implement multi-tab code blocks when writing technical documentation for this site, using markdown.

The first step to implementing multi-tab code blocks is placing the `enable_shortcodes = true` configuration at the start of the `.md` file. Specifically, in the `.md` file's frontmatter.

Expand Down
Binary file added static/image/no-copy-source-code-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 612336e

Please sign in to comment.