Skip to content

Commit

Permalink
Improve code and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
GaelGirodon committed Aug 29, 2023
1 parent 37794e6 commit 2fd199a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ The `--layout` option can receive the name of a [preset](./assets/layouts/)

A theme is a CSS stylesheet included in the HTML layout.

The `--theme` option can receive the name of a [preset](./assets/themes/) (e.g.
`github`) or the path to a custom theme file (`path/to/my-theme.css` or an HTTP
URL).
The `--theme` option can receive the name of a preset (e.g. `github`)
or the path to a custom theme file (`path/to/my-theme.css` or an HTTP URL).

#### Highlight style (`--highlight-style`)

Expand Down
1 change: 1 addition & 0 deletions scripts/test-readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { spawnSync } from "node:child_process";
import { readFileSync, readdirSync, unlinkSync } from "node:fs";
import { chdir } from "node:process";

import { ROOT_DIR } from "../src/files.js";

// Change current working directory to project root
Expand Down
2 changes: 1 addition & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function randomId() {

/**
* Get the text content of the first element matching the given tag
* using a naive regex-base search which is very limited, but avoids
* using a naive regex-based search which is very limited, but avoids
* importing a full HTML parser library only to do that.
* @param {string} html The HTML document
* @param {string} tag The HTML tag name
Expand Down
4 changes: 2 additions & 2 deletions test/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ before(async () => {
});
await fs.mkdir(buildDataPath("img"), { recursive: true });
for (let url of Object.keys(images)) {
const data = (await request(url)).body;
await fs.writeFile(buildDataPath(images[url]), data);
const res = await request(url);
await fs.writeFile(buildDataPath(images[url]), res.body);
}
await fs.writeFile(buildDataPath("README.md"), output, { encoding: "utf8" });
});
Expand Down

0 comments on commit 2fd199a

Please sign in to comment.