Skip to content

Commit

Permalink
linting of md files fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhalasz committed Mar 6, 2024
1 parent ff21007 commit b168c72
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 154 deletions.
19 changes: 11 additions & 8 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,15 @@
// MD033/no-inline-html - Inline HTML
"MD033": {
// Allowed elements
"allowed_elements": ["summary", "details", "br", "strong", "code", "a"]
"allowed_elements": [
"summary",
"details",
"br",
"strong",
"code",
"a",
"sup"
]
},

// MD034/no-bare-urls - Bare URL used
Expand Down Expand Up @@ -200,15 +208,10 @@
"MD039": true,

// MD040/fenced-code-language - Fenced code blocks should have a language specified
"MD040": true,
"MD040": false,

// MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
"MD041": {
// Heading level
"level": 1,
// RegExp for matching title in front matter
"front_matter_title": "^\\s*title\\s*[:=]"
},
"MD041": false,

// MD042/no-empty-links - No empty links
"MD042": true,
Expand Down
100 changes: 50 additions & 50 deletions 02-just-enough-dom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ output, and defining user interactions with event listeners.

```html
<div>
<button id="echo-button">echo</button>
<button id="echo-button">echo</button>
</div>

<script>
// --- save important DOM elements to variables ---
const echoButtonEl = document.getElementById('echo-button');
// --- save important DOM elements to variables ---
const echoButtonEl = document.getElementById('echo-button');
console.log(echoButtonEl);
console.log(echoButtonEl);
</script>
```

Expand All @@ -111,20 +111,20 @@ the syntax below and will have more freedom when writing your programs.

```html
<div>
<button id="echo-button">echo</button>
<button id="echo-button">echo</button>
</div>

<script>
// --- save important DOM elements to variables ---
const echoButtonEl = document.getElementById('echo-button');
// --- add event listeners + handlers ---
// you can just use this syntax for now without understanding it
// soon you will learn about functions and callbacks
echoButtonEl.addEventListener('click', () => {
console.log('hello developer');
alert('hello user');
});
// --- save important DOM elements to variables ---
const echoButtonEl = document.getElementById('echo-button');
// --- add event listeners + handlers ---
// you can just use this syntax for now without understanding it
// soon you will learn about functions and callbacks
echoButtonEl.addEventListener('click', () => {
console.log('hello developer');
alert('hello user');
});
</script>
```

Expand All @@ -137,22 +137,22 @@ module's examples and exercises.

```html
<div>
<input id="user-text" />
<br />
<button id="echo-button">echo</button>
<input id="user-text" />
<br />
<button id="echo-button">echo</button>
</div>

<script>
// --- save important DOM elements to variables ---
const userTextEl = document.getElementById('user-text');
const echoButtonEl = document.getElementById('echo-button');
// --- add event listeners + handlers ---
echoButtonEl.addEventListener('click', () => {
const userInput = userTextEl.value;
console.log(userInput);
alert(userInput);
});
// --- save important DOM elements to variables ---
const userTextEl = document.getElementById('user-text');
const echoButtonEl = document.getElementById('echo-button');
// --- add event listeners + handlers ---
echoButtonEl.addEventListener('click', () => {
const userInput = userTextEl.value;
console.log(userInput);
alert(userInput);
});
</script>
```

Expand All @@ -164,29 +164,29 @@ information to a user with the DOM, and more than enough for this module.

```html
<div>
<input id="user-text" />
<br />
<button id="echo-button">echo</button>
<input id="user-text" />
<br />
<button id="echo-button">echo</button>

<hr />
<hr />

<pre id="display-zone"></pre>
<pre id="display-zone"></pre>
</div>

<script>
// --- save important DOM elements to variables ---
const userTextEl = document.getElementById('user-text');
const echoButtonEl = document.getElementById('echo-button');
s;
const displayZoneEl = document.getElementById('display-zone');
// --- add event listeners + handlers ---
echoButtonEl.addEventListener('click', () => {
const userInput = userTextEl.value;
console.log(userInput);
displayZoneEl.innerText = userTextEl.value;
});
// --- save important DOM elements to variables ---
const userTextEl = document.getElementById('user-text');
const echoButtonEl = document.getElementById('echo-button');
s;
const displayZoneEl = document.getElementById('display-zone');
// --- add event listeners + handlers ---
echoButtonEl.addEventListener('click', () => {
const userInput = userTextEl.value;
console.log(userInput);
displayZoneEl.innerText = userTextEl.value;
});
</script>
```

Expand All @@ -207,8 +207,8 @@ humans to know the file's purpose:

```
/exercise-name
/index.html
/script.js
/script.re.js
/styles.css
/index.html
/script.js
/script.re.js
/styles.css
```
46 changes: 23 additions & 23 deletions 03-control-flow/1-isolate/6-for-loops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ conventionally used?

```js
for (initialization; condition; finalExpression) {
// ... loop body ...
// ... loop body ...
}
```

Expand All @@ -37,15 +37,15 @@ The correct answer is `2`:

```js
for (
// 2: declare and assign the `step` variable
let step = 0; // initialization
// 3, 6, 9, 12: check if `step` is less than 3
step < 3; // condition
// 5, 8, 11: add 1 to `step`
step++ // finalExpression
// 2: declare and assign the `step` variable
let step = 0; // initialization
// 3, 6, 9, 12: check if `step` is less than 3
step < 3; // condition
// 5, 8, 11: add 1 to `step`
step++ // finalExpression
) {
// 4, 7, 10: log the current value of `step`
console.log(step);
// 4, 7, 10: log the current value of `step`
console.log(step);
}
```

Expand Down Expand Up @@ -74,14 +74,14 @@ let max = 3;
let step = 0;
// condition
while (step < max) {
console.log(step);
// final expression
step = step + 1;
console.log(step);
// final expression
step = step + 1;
}

// initialization; condition; finalExpression
for (let step = 0; step < max; step++) {
console.log(step);
console.log(step);
}
```

Expand All @@ -91,7 +91,7 @@ _variables_ button):

```js
for (let step = 0; step < 3; step++) {
console.log(step);
console.log(step);
}

step; // ReferenceError
Expand Down Expand Up @@ -122,13 +122,13 @@ let totalRepetitions = 4;
let repeatedString = '';

for (let i = 0; i < totalRepetitions; i++) {
repeatedString += toRepeat;
console.log('repeatedString:', repeatedString);
repeatedString += toRepeat;
console.log('repeatedString:', repeatedString);
}

console.assert(
repeatedString === 'howdyhowdyhowdyhowdy',
'"howdy" should be repeated 4 times',
repeatedString === 'howdyhowdyhowdyhowdy',
'"howdy" should be repeated 4 times',
);
```

Expand All @@ -149,14 +149,14 @@ let reversedString = '';
console.log('reversedString:', reversedString);

for (_; _; _) {
let nextLetter = _;
reversedString = _ + _;
console.log('reversedString:', reversedString);
let nextLetter = _;
reversedString = _ + _;
console.log('reversedString:', reversedString);
}

console.assert(
reversedString === 'mlkj',
'reversed string is the original reversed',
reversedString === 'mlkj',
'reversed string is the original reversed',
);
```

Expand Down
12 changes: 6 additions & 6 deletions 07-using-functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ use functions (remember zooming in and zooming out?):
* @returns {string} the reversed text
*/
const reverseString = (text = '') => {
let backwards = '';
for (const character of text) {
backwards = character + backwards;
}
return backwards;
let backwards = '';
for (const character of text) {
backwards = character + backwards;
}
return backwards;
};
console.assert(reverseString('') === '', 'Test 1');
console.assert(reverseString('1234') === '4321', 'Test 2');
Expand All @@ -92,7 +92,7 @@ console.assert(reverseString('ooo') === 'ooo', 'Test 5');
// -- gather user input --
let input = null;
while (input === null) {
input = prompt('enter some text to reverse');
input = prompt('enter some text to reverse');
}

// -- use your program logic --
Expand Down
12 changes: 6 additions & 6 deletions 08-arrays/3-integrate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ use functions (remember zooming in and zooming out?):
* @returns {string} the reversed text
*/
const reverseString = (text = '') => {
let backwards = '';
for (const character of text) {
backwards = character + backwards;
}
return backwards;
let backwards = '';
for (const character of text) {
backwards = character + backwards;
}
return backwards;
};
console.assert(reverseString('') === '', 'Test 1');
console.assert(reverseString('1234') === '4321', 'Test 2');
Expand All @@ -92,7 +92,7 @@ console.assert(reverseString('ooo') === 'ooo', 'Test 5');
// -- gather user input --
let input = null;
while (input === null) {
input = prompt('enter some text to reverse');
input = prompt('enter some text to reverse');
}

// -- use your program logic --
Expand Down
2 changes: 1 addition & 1 deletion 09-functional-array-methods/3-implicit-return/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ to that.
// these two functions do exactly the same thing!

const explicitReturn = (a, b) => {
return a + b;
return a + b;
};

const implicitReturn = (a, b) => a + b;
Expand Down
Loading

0 comments on commit b168c72

Please sign in to comment.