Skip to content

Commit 8bb3b95

Browse files
author
Derek Hower
committed
Add Prettier config, run on repo
1 parent 5691a30 commit 8bb3b95

File tree

10 files changed

+862
-817
lines changed

10 files changed

+862
-817
lines changed

.prettierignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
gen
2+
.home
3+
.singularity
4+
node_modules
5+
.asciidoctor
6+
.bundle
7+
.git
8+
.github
9+
.vscode
10+
docs/ruby
11+
ext

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

backends/cfg_html_doc/ui/highlight.js

Lines changed: 577 additions & 564 deletions
Large diffs are not rendered by default.

backends/indexer/index-unifieddb.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env node
2-
'use strict';
2+
"use strict";
33

4-
const process = require('process');
5-
const path = require('path');
6-
const fs = require('fs');
4+
const process = require("process");
5+
const path = require("path");
6+
const fs = require("fs");
77

88
const { readdir, stat } = fs.promises;
99

@@ -16,8 +16,8 @@ const rec = async (branch, root) => {
1616
const fileExt = path.extname(el);
1717
const baseName = path.basename(el, fileExt);
1818
if (isFile) {
19-
if (['.yaml', '.json'].includes(fileExt)) {
20-
node[baseName] = {$ref: path.join(...branch, el)};
19+
if ([".yaml", ".json"].includes(fileExt)) {
20+
node[baseName] = { $ref: path.join(...branch, el) };
2121
}
2222
} else {
2323
node[el] = await rec([...branch, el], root);
@@ -29,10 +29,12 @@ const rec = async (branch, root) => {
2929
const main = async () => {
3030
const [, , root] = process.argv;
3131
if (root === undefined) {
32-
console.error('usage: ./index-unifieddb.js <path-to-unifieddb-arch-folder>');
32+
console.error(
33+
"usage: ./index-unifieddb.js <path-to-unifieddb-arch-folder>",
34+
);
3335
return;
3436
}
35-
const rootPath = path.resolve('.', root);
37+
const rootPath = path.resolve(".", root);
3638
const tree = await rec([], rootPath);
3739
console.log(JSON.stringify(tree, null, 2));
3840
};

docs/index.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
43
<body>
54
<h2>Arch specification schemas</h2>
65
<ul>
@@ -12,5 +11,4 @@ <h2>Ruby documentation</h2>
1211
<li><a href="ruby/index.html">lib</a></li>
1312
</ul>
1413
</body>
15-
1614
</html>

lib/asciidoc_extensions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const asciidoctor = require('asciidoctor')()
2-
const registry = asciidoctor.Extensions.create()
3-
require('./asciidoc_when_extension.js')(registry)
1+
const asciidoctor = require("asciidoctor")();
2+
const registry = asciidoctor.Extensions.create();
3+
require("./asciidoc_when_extension.js")(registry);

lib/asciidoc_when_extension.js

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
module.exports.register = function (registry, context = {}) {
2-
registry.block('when', function () {
3-
var self = this
4-
self.named('when')
5-
self.onContexts('paragraph', 'open')
6-
self.positionalAttributes(['condition'])
7-
self.process(function (parent, reader, attributes) {
8-
var condition = attributes.condition
9-
let new_block_attrs = {}
10-
new_block_attrs.role = "when"
11-
new_block_attrs.name = "when"
12-
new_block_attrs["textlabel"] = `When ${condition}`
13-
let content_model = attributes["cloaked-context"] == "paragraph" ? "simple" : "compound"
14-
return self.createBlock(parent, 'admonition', reader.getLines(), new_block_attrs, {"content_model": content_model})
15-
})
16-
})
17-
return registry
18-
}
2+
registry.block("when", function () {
3+
var self = this;
4+
self.named("when");
5+
self.onContexts("paragraph", "open");
6+
self.positionalAttributes(["condition"]);
7+
self.process(function (parent, reader, attributes) {
8+
var condition = attributes.condition;
9+
let new_block_attrs = {};
10+
new_block_attrs.role = "when";
11+
new_block_attrs.name = "when";
12+
new_block_attrs["textlabel"] = `When ${condition}`;
13+
let content_model =
14+
attributes["cloaked-context"] == "paragraph" ? "simple" : "compound";
15+
return self.createBlock(
16+
parent,
17+
"admonition",
18+
reader.getLines(),
19+
new_block_attrs,
20+
{ content_model: content_model },
21+
);
22+
});
23+
});
24+
return registry;
25+
};

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"@antora/site-generator": "3.1.7",
77
"asciidoctor-kroki": "0.17.0",
88
"@asciidoctor/tabs": "v1.0.0-beta.6",
9+
"prettier": "3.4.2",
910
"wavedrom-cli": "^3.1.1"
1011
}
1112
}

0 commit comments

Comments
 (0)