Skip to content

Commit

Permalink
Adding language variants for code example (#42)
Browse files Browse the repository at this point in the history
* Fixing some code examples syntax languages

Found one that needed fixing, and then did a quick search for any
others that might be wrong. Here's the three I found. No big impact,
but will help to make the docs more consistent.

Signed-off-by: Elliot Voris <[email protected]>

* Running prettier for the JSON code example

Signed-off-by: Elliot Voris <[email protected]>

* Reverting the `json5` change

Signed-off-by: Elliot Voris <[email protected]>

* Aaaaanddd.... reverting the prettier formatting to go along with json5

Signed-off-by: Elliot Voris <[email protected]>

* Adding language variants in `<CodeExample />` component

- Adding entries for `json5`, `javascript`, and `typescript`
- Changing README to reflect those new entries

Signed-off-by: Elliot Voris <[email protected]>

Signed-off-by: Elliot Voris <[email protected]>
  • Loading branch information
ElliotFriend authored Sep 30, 2022
1 parent f45feb2 commit 2339b08
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,16 @@ const CODE_LANGS = {
go: 'Go',
html: 'html',
java: 'Java',
javascript: 'JavaScript',
js: 'JavaScript',
json: 'JSON',
json5: 'JSON5',
python: 'Python',
scss: 'SCSS',
toml: 'TOML',
ts: 'TypeScript',
tsx: 'TSX',
typescript: 'TypeScript',
yaml: 'YAML',
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ The public key of the issuing account is linked on the ledger to the asset. Resp

In Horizon, assets are represented in a JSON object:

<CodeExample>

```json5
{
asset_code: "AstroDollar",
Expand All @@ -42,6 +44,8 @@ In Horizon, assets are represented in a JSON object:
}
```

</CodeExample>

In the Stellar SDKs, they’re represented with the asset class:

<CodeExample>
Expand Down
3 changes: 3 additions & 0 deletions src/components/CodeExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ const CODE_LANGS = {
go: 'Go',
html: 'html',
java: 'Java',
javascript: 'JavaScript',
js: 'JavaScript',
json: 'JSON',
json5: 'JSON5',
python: 'Python',
scss: 'SCSS',
toml: 'TOML',
ts: 'TypeScript',
tsx: 'TSX',
typescript: 'TypeScript',
yaml: 'YAML',
};

Expand Down

0 comments on commit 2339b08

Please sign in to comment.