Skip to content

Commit

Permalink
Convert backtick (`) admonition fences to tildes (~) (#2284)
Browse files Browse the repository at this point in the history
* Convert backtick (`) admonition fences to tildes (~).

* [CI] Format code

* Convert backtick (`) admonition fences to tildes (~).

* Add prettier-ignore for tildes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tejas Bubane <tejasbubane@gmail.com>
  • Loading branch information
3 people committed Oct 2, 2023
1 parent ec14468 commit 16a09ac
Show file tree
Hide file tree
Showing 22 changed files with 121 additions and 61 deletions.
6 changes: 4 additions & 2 deletions concepts/array-transformations/about.md
Expand Up @@ -144,7 +144,8 @@ console.log(arr);
// => ['a', 'b', 'c', 'z']
```

````exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
This default behavior leads to wrong results when you try to sort numbers.
```javascript
Expand All @@ -153,7 +154,8 @@ arr.sort();
// => [1, 10, 2, 3]
// Because the string '10' comes before '2' in dictionary order.
```
````
~~~~
<!-- prettier-ignore-end -->

To customize the sorting behavior, you can pass a comparison function as an argument.
The comparison function itself is called with two arguments which are two elements of the array.
Expand Down
12 changes: 8 additions & 4 deletions concepts/classes/about.md
Expand Up @@ -36,14 +36,16 @@ Before that, it was accessible via the key `__proto__` in many environments.

Do not confuse the prototype of an object (`[[prototype]]`) with the `prototype` property of the constructor function.

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
To summarize:
- Constructors in JavaScript are regular functions.
- Constructing a new instance creates an object with a relation to its constructor called its _prototype_.
- Functions are objects (callable objects) and therefore they can have properties.
- The constructor's (function) `prototype` property will become the instance's _prototype_.
```
~~~~
<!-- prettier-ignore-end -->

### Instance Fields

Expand Down Expand Up @@ -124,11 +126,13 @@ The `[[prototype]]` of `Object` is usually `null` so the prototype chain ends th
In conclusion, you can call `myCar.toString()` and that method will exist because JavaScript searches for that method throughout the whole prototype chain.
You can find a detailed example in the [MDN article "Inheritance and the prototype chain"][mdn-prototype-chain-example].

```exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
Note that the prototype chain is only travelled when retrieving a value.
Setting a property directly or deleting a property of an instance object only targets that specific instance.
This might not be what you would expect when you are used to a language with class-based inheritance.
```
~~~~
<!-- prettier-ignore-end -->

### Dynamic Methods (Adding Methods to All Existing Instances)

Expand Down
12 changes: 8 additions & 4 deletions concepts/classes/introduction.md
Expand Up @@ -31,14 +31,16 @@ Every instance object includes a hidden, internal property referred to as `[[pro
It holds a reference to the value of the `prototype` key of the constructor function.
Yes, you read that correctly, a JavaScript function can have key/value pairs because it is also an object behind the scenes.

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
To summarize:
- Constructors in JavaScript are regular functions.
- Constructing a new instance creates an object with a relation to its constructor called its _prototype_.
- Functions are objects (callable objects) and therefore they can have properties.
- The constructor's (function) `prototype` property will become the instance's _prototype_.
```
~~~~
<!-- prettier-ignore-end -->

### Instance Fields

Expand Down Expand Up @@ -117,11 +119,13 @@ The `[[prototype]]` property of `Car.prototype` (`myCar.[[prototype]].[[prototyp
It contains general methods that are available for all JavaScript objects, e.g. `toString()`.
In conclusion, you can call `myCar.toString()` and that method will exist because JavaScript searches for that method throughout the whole prototype chain.

```exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
Note that the prototype chain is only travelled when retrieving a value.
Setting a property directly or deleting a property of an instance object only targets that specific instance.
This might not be what you would expect when you are used to a language with class-based inheritance.
```
~~~~
<!-- prettier-ignore-end -->

## Class Syntax

Expand Down
18 changes: 12 additions & 6 deletions concepts/dates/about.md
Expand Up @@ -32,11 +32,13 @@ However, different types of arguments can also be used to create date object, as
>
> [^1]
```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
> January 1st, 1970 at 00:00:00 UTC is referred to as the Unix epoch.
> Unix is an operating system originally developed in the 1960s.
> Early Unix engineers picked that date arbitrarily because they needed to set a uniform date for the start of time, and > New Year's Day, 1970, seemed most convenient. [^2]
```
~~~~
<!-- prettier-ignore-end -->

### Timestamp string

Expand Down Expand Up @@ -115,9 +117,11 @@ const d3 = Date.parse('2019-01-01T00:00:00.000');
// it is set to your local time zone.
```

```exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
The use of `Date.parse()` (and the timestamp string method which works similarly) is strongly discouraged due to browser differences and inconsistencies. [^5]
```
~~~~
<!-- prettier-ignore-end -->

## Accessing `Date` components

Expand All @@ -141,12 +145,14 @@ const date1 = new Date(2020, 11, 13, 5); // Dec 13 2020 5:00:00
let millsecs = date1.getTime(); // find out how many have milliseconds passed since Jan 1 1890!
```

```exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
Many JavaScript engines implement a non-standard method `getYear()`.
**This method is deprecated.**
It returns a 2-digit year sometimes.
Hence, `getFullYear()` must always be used instead.
```
~~~~
<!-- prettier-ignore-end -->

## Modifying `Date` components

Expand Down
6 changes: 4 additions & 2 deletions concepts/dates/introduction.md
Expand Up @@ -98,9 +98,11 @@ const date2 = new Date(2013, 12, 5, 13, 24, 0);
Shorter variants are also possible, like `YYYY-MM-DD` or `YYYY-MM` or even `YYYY`. However, note that these variants **set the `Date` to UTC**, even though `Z` not mentioned.
To understand what exactly happens check out [this section][mdn-diff-assumed-timezone] of a MDN page.

```exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
The use of `Date.parse()` (and the timestamp string method which works similarly) is strongly discouraged due to browser differences and inconsistencies. [^4]
```
~~~~
<!-- prettier-ignore-end -->

## Accessing `Date` components

Expand Down
6 changes: 4 additions & 2 deletions exercises/concept/bird-watcher/.docs/instructions.md
Expand Up @@ -6,9 +6,11 @@ You already digitalized the bird counts per day for the past weeks that you kept

Now you want to determine the total number of birds that you counted, calculate the bird count for a specific week and correct a counting mistake.

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
To practice, use a for loop to solve each of the tasks below.
```
~~~~
<!-- prettier-ignore-end -->

## 1. Determine the total number of birds that you counted so far

Expand Down
6 changes: 4 additions & 2 deletions exercises/concept/elyses-enchantments/.docs/instructions.md
Expand Up @@ -9,9 +9,11 @@ of a certain card corresponds to the index in the array. That means
position 0 refers to the first card, position 1 to the second card
etc.

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
All functions should update the array of cards and then return the modified array - a common way of working known as the Builder pattern, which allows you to nicely daisy-chain functions together.
```
~~~~
<!-- prettier-ignore-end -->

## 1. Retrieve a card from a stack

Expand Down
14 changes: 9 additions & 5 deletions exercises/concept/translation-service/.docs/instructions.md
Expand Up @@ -46,14 +46,16 @@ api.request('majQa’', callback);

**⚠ Warning! ⚠**

```exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
The API works its magic by teleporting in the various translators when a `request` comes in.
This is a very costly action, so it shouldn't be called when a translation *is* available.
Unfortunately, not everyone reads the manual, so there is a system in place to kick-out bad actors.
If an `api.request` is called for `text` is available, the API throws an `AbusiveClientError` for this call, **and every call after that**.
Ensure that you *never* request a translation if something has already been translated.
```
~~~~
<!-- prettier-ignore-end -->

## 1. Fetch a translation, ignoring the quality

Expand Down Expand Up @@ -96,7 +98,7 @@ service.batch([]);
## 3. Request a translation, retrying at most 2 times

Implement a premium user method `request(text)`, that _requests_ a translation be added to the _API storage_.
The request should automatically retry if a failure occurs.
The request should automatically retry if a failure occurs.
It should perform no more than **3 calls** for the same request (_don't upset the space translators!!!_).

- If `api.request` does not return an error, resolve with `undefined`
Expand Down Expand Up @@ -131,6 +133,8 @@ service.premium("'arlogh Qoylu'pu'?", 40);

**N.B.**

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
The correct translation of `'arlogh Qoylu'pu'?` is **How many times has it been heard?**.
```
~~~~
<!-- prettier-ignore-end -->
12 changes: 8 additions & 4 deletions exercises/concept/windowing-system/.docs/introduction.md
Expand Up @@ -31,14 +31,16 @@ Every instance object includes a hidden, internal property referred to as `[[pro
It holds a reference to the value of the `prototype` key of the constructor function.
Yes, you read that correctly, a JavaScript function can have key/value pairs because it is also an object behind the scenes.

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
To summarize:
- Constructors in JavaScript are regular functions.
- Constructing a new instance creates an object with a relation to its constructor called its _prototype_.
- Functions are objects (callable objects) and therefore they can have properties.
- The constructor's (function) `prototype` property will become the instance's _prototype_.
```
~~~~
<!-- prettier-ignore-end -->

### Instance Fields

Expand Down Expand Up @@ -117,11 +119,13 @@ The `[[prototype]]` property of `Car.prototype` (`myCar.[[prototype]].[[prototyp
It contains general methods that are available for all JavaScript objects, e.g. `toString()`.
In conclusion, you can call `myCar.toString()` and that method will exist because JavaScript searches for that method throughout the whole prototype chain.

```exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
Note that the prototype chain is only travelled when retrieving a value.
Setting a property directly or deleting a property of an instance object only targets that specific instance.
This might not be what you would expect when you are used to a language with class-based inheritance.
```
~~~~
<!-- prettier-ignore-end -->

## Class Syntax

Expand Down
6 changes: 4 additions & 2 deletions exercises/practice/bob/.approaches/answer-array/content.md
Expand Up @@ -27,10 +27,12 @@ The correct answer is selected from the array by using the score as the array in
The [`String`][string] [trimEnd][trimend] method is applied to the input to eliminate any whitespace at the end of the input.
If the string has no characters left, it returns the response for saying nothing.

```exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
Note that a `null` or `undefined` `String` would be different from a `String` of all whitespace.
A `null` or `undefined` `String` would raise a `TypeError` if `trimEnd` were applied to it.
```
~~~~
<!-- prettier-ignore-end -->

The first half of the shout condition

Expand Down
12 changes: 8 additions & 4 deletions exercises/practice/bob/.approaches/if-statements/content.md
Expand Up @@ -24,21 +24,25 @@ export function hey(message) {
In this approach you have a series of `if` statements using the private methods to evaluate the conditions.
As soon as the right condition is found, the correct response is returned.
```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
Note that there are no `else if` or `else` statements.
If an `if` statement can return, then an `else if` or `else` is not needed.
Execution will either return or will continue to the next statement anyway.
```
~~~~
<!-- prettier-ignore-end -->
The [`String`][string] [trimEnd][trimend] method is applied to the input to eliminate any whitespace at the end of the input.
If the string has no characters left, it returns the response for saying nothing.
The `String` method [endsWith][endswith] is used to determine if the input ends with a question mark.
```exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
Note that a `null` or `undefined` `String` would be different from a `String` of all whitespace.
A `null` or `undefined` `String` would raise a `TypeError` if `trimEnd` were applied to it.
```
~~~~
<!-- prettier-ignore-end -->
The first half of the shout condition
Expand Down
Expand Up @@ -29,10 +29,12 @@ The `switch` returns the right response for a question, shout, shouted question,
The [`String`][string] [trimEnd][trimend] method is applied to the input to eliminate any whitespace at the end of the input.
If the string has no characters left, it returns the response for saying nothing.

```exercism/caution
<!-- prettier-ignore-start -->
~~~~exercism/caution
Note that a `null` or `undefined` `String` would be different from a `String` of all whitespace.
A `null` or `undefined` `String` would raise a `TypeError` if `trimEnd` were applied to it.
```
~~~~
<!-- prettier-ignore-end -->

The first half of the shout condition

Expand Down
6 changes: 4 additions & 2 deletions exercises/practice/etl/.docs/instructions.md
Expand Up @@ -22,6 +22,8 @@ This needs to be changed to store each individual letter with its score in a one

As part of this change, the team has also decided to change the letters to be lower-case rather than upper-case.

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
If you want to look at how the data was previously structured and how it needs to change, take a look at the examples in the test suite.
```
~~~~
<!-- prettier-ignore-end -->
6 changes: 4 additions & 2 deletions exercises/practice/gigasecond/.docs/introduction.md
Expand Up @@ -13,12 +13,14 @@ Then we can use metric system prefixes for writing large numbers of seconds in m
- Perhaps you and your family would travel to somewhere exotic for two megaseconds (that's two million seconds).
- And if you and your spouse were married for _a thousand million_ seconds, you would celebrate your one gigasecond anniversary.

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
If we ever colonize Mars or some other planet, measuring time is going to get even messier.
If someone says "year" do they mean a year on Earth or a year on Mars?
The idea for this exercise came from the science fiction novel ["A Deepness in the Sky"][vinge-novel] by author Vernor Vinge.
In it the author uses the metric system as the basis for time measurements.
[vinge-novel]: https://www.tor.com/2017/08/03/science-fiction-with-something-for-everyone-a-deepness-in-the-sky-by-vernor-vinge/
```
~~~~
<!-- prettier-ignore-end -->
6 changes: 4 additions & 2 deletions exercises/practice/grains/.approaches/bit-shifting/content.md
Expand Up @@ -15,9 +15,11 @@ export function total() {

Instead of using math to calculate the number of grains on a square, you can set a bit in the correct position of a [`BigInt`][bigint] value.

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
Note that a `BigInt` literal can be specified by appending `n` to the value.
```
~~~~
<!-- prettier-ignore-end -->

To understand how this works, consider just two squares that are represented in binary bits as `00`.

Expand Down
Expand Up @@ -19,9 +19,11 @@ JavaScript uses the [exponential operator][exponentiation] to raise a number by
Exponentiation is nicely suited to the problem, since we start with one grain and keep doubling the number of grains on each successive square.
`1` grain is `2n ** 0`, `2` grains is `2n ** 1`, `4` is `2n ** 2`, and so on.

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
Note that a [`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) literal can be specified by appending `n` to the value.
```
~~~~
<!-- prettier-ignore-end -->

So, to get the right exponent, we subtract `1` from the square number `num`.

Expand Down
6 changes: 4 additions & 2 deletions exercises/practice/isogram/.approaches/bitfield/content.md
Expand Up @@ -32,10 +32,12 @@ The ASCII value for `A` is `65`.
- The `string` loops through its characters and looks for a character being `a` through `z` or `A` through `Z`.
- If a letter is found, then its ASCII value is taken by the [`charCodeAt`][charcodeat] method.

```exercism/note
<!-- prettier-ignore-start -->
~~~~exercism/note
`charCodeAt` actually returns the UTF-16 code unit for the character, which is an integer between `0` and `65535`.
For the letters `a`-`z` and `A`-`Z`, the UTF-16 number is the same value as the ASCII value.
```
~~~~
<!-- prettier-ignore-end -->

- If the lowercase letter is subtracted by `97`, then `a` will result in `0`, because `97` minus `97` equals `0`.
`z` would result in `25`, because `122` minus `97` equals `25`.
Expand Down

0 comments on commit 16a09ac

Please sign in to comment.