Skip to content

Commit

Permalink
Automatically format YAML, CSS, and JS files (#1272)
Browse files Browse the repository at this point in the history
Initially, I also formatted the templates in `theme/`, but this triggers
prettier/prettier#11834. So I exclude them for
now.

---------

Co-authored-by: Ming-Ying Chung <[email protected]>
  • Loading branch information
mgeisler and mingyc authored Oct 2, 2023
1 parent 4e768e2 commit 42541fc
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 47 deletions.
67 changes: 33 additions & 34 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,50 @@
translation:
- po/**
- po/**

'translation/bn':
- po/bn.po
"translation/bn":
- po/bn.po

'translation/da':
- po/da.po
"translation/da":
- po/da.po

'translation/de':
- po/de.po
"translation/de":
- po/de.po

'translation/el':
- po/el.po
"translation/el":
- po/el.po

'translation/es':
- po/es.po
"translation/es":
- po/es.po

'translation/fr':
- po/fr.po
"translation/fr":
- po/fr.po

'translation/id':
- po/id.po
"translation/id":
- po/id.po

'translation/it':
- po/it.po
"translation/it":
- po/it.po

'translation/ja':
- po/ja.po
"translation/ja":
- po/ja.po

'translation/ko':
- po/ko.po
"translation/ko":
- po/ko.po

'translation/pt-BR':
- po/pt-BR.po
"translation/pt-BR":
- po/pt-BR.po

'translation/ru':
- po/ru.po
"translation/ru":
- po/ru.po

'translation/tr':
- po/tr.po
"translation/tr":
- po/tr.po

'translation/zh-CN':
- po/zh-CN.po
"translation/zh-CN":
- po/zh-CN.po

'translation/zh-TW':
- po/zh-TW.po
"translation/zh-TW":
- po/zh-TW.po


'translation/fa':
- po/fa.po
"translation/fa":
- po/fa.po
8 changes: 4 additions & 4 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Pull Request Labeler"
on:
- pull_request_target
- pull_request_target

jobs:
triage:
Expand All @@ -9,6 +9,6 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
sync-labels: true
- uses: actions/labeler@v4
with:
sync-labels: true
4 changes: 3 additions & 1 deletion dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
"excludes": [
"/book/",
"/src/",
"/theme/*.hbs",
"/third_party/",
"target/"
],
"plugins": [
"https://plugins.dprint.dev/exec-0.4.3.json@42343548b8022c99b1d750be6b894fe6b6c7ee25f72ae9f9082226dd2e515072",
"https://plugins.dprint.dev/json-0.17.4.wasm",
"https://plugins.dprint.dev/markdown-0.16.1.wasm",
"https://plugins.dprint.dev/toml-0.5.4.wasm"
"https://plugins.dprint.dev/toml-0.5.4.wasm",
"https://plugins.dprint.dev/prettier-0.27.0.json@3557a62b4507c55a47d8cde0683195b14d13c41dda66d0f0b0e111aed107e2fe"
]
}
2 changes: 1 addition & 1 deletion theme/css/language-picker.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
right: 10px;
}

[dir=rtl] #language-list {
[dir="rtl"] #language-list {
left: 10px;
right: auto;
}
Expand Down
18 changes: 11 additions & 7 deletions theme/speaker-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

(function() {
(function () {
let notes = document.querySelector("details");
// Create an unattached DOM node for the code below.
if (!notes) {
Expand All @@ -32,7 +32,7 @@

// Update the window. This shows/hides controls as necessary for regular and
// speaker note pages.
function applyState() {
function applyState() {
if (window.location.hash == "#speaker-notes-open") {
if (getState() != "popup") {
markDefunct();
Expand Down Expand Up @@ -116,9 +116,11 @@
setState("popup");
applyState();
} else {
window.alert("Could not open popup, please check your popup blocker settings.");
window.alert(
"Could not open popup, please check your popup blocker settings."
);
}
})
});
let popOutIcon = document.createElement("i");
popOutIcon.classList.add("fa", "fa-external-link");
popOut.append(popOutIcon);
Expand Down Expand Up @@ -179,9 +181,11 @@
}

// Update prev/next buttons to keep speaker note state.
document.querySelectorAll('a[rel="prev"], a[rel="next"]').forEach((elem) => {
elem.href += "#speaker-notes-open";
});
document
.querySelectorAll('a[rel="prev"], a[rel="next"]')
.forEach((elem) => {
elem.href += "#speaker-notes-open";
});
}

let timeout = null;
Expand Down

0 comments on commit 42541fc

Please sign in to comment.