Skip to content

Commit

Permalink
fix: reformat code with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jgazeau committed Feb 5, 2023
1 parent bf22508 commit 8dae917
Show file tree
Hide file tree
Showing 135 changed files with 3,554 additions and 2,835 deletions.
2 changes: 1 addition & 1 deletion .bmycconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -1967,4 +1967,4 @@
},
"currentVersion": "10.2.1"
}
]
]
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature
description: Request a new feature
title: "[feature_request]: "
labels: ["enhancement"]
title: '[feature_request]: '
labels: ['enhancement']
body:
- type: textarea
id: request
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/issue.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug Report
description: Create a bug report
title: "[bug]: "
labels: ["bug"]
title: '[bug]: '
labels: ['bug']
body:
- type: markdown
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Question
description: Ask a question related to the project
title: "[question]: "
labels: ["question"]
title: '[question]: '
labels: ['question']
body:
- type: textarea
id: question
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Fixes #<ISSUE_NUMBER>
- [ ] Code quality is at least even, ideally greater
- [ ] Code commits are following the [Conventional Commits](https://www.conventionalcommits.org/) specification
- [ ] Documentation is up-to-date (code comments, project documentation, ...)
- [ ] All tests passed successfully
- [ ] All tests passed successfully
27 changes: 13 additions & 14 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: "weekly"
interval: 'weekly'
commit-message:
prefix: "chore:"
include: "scope"
prefix: 'chore:'
include: 'scope'
labels:
- "internal"
- 'internal'
open-pull-requests-limit: 1
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
schedule:
interval: "weekly"
interval: 'weekly'
commit-message:
prefix: "chore:"
include: "scope"
prefix: 'chore:'
include: 'scope'
labels:
- "internal"
- 'internal'
open-pull-requests-limit: 1
versioning-strategy: increase
versioning-strategy: increase
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ changelog:
- internal
- title: Other Changes
labels:
- "*"
- '*'
20 changes: 10 additions & 10 deletions .github/workflows/branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ on:
paths:
- '**'
env:
HUGO_BASIC_EXAMPLE_REPO: "gohugoio/hugoBasicExample"
HUGO_BIN_NAME: "hugo"
HUGO_CACHE_NAME: "hugo-bin-cache"
HUGO_BASIC_EXAMPLE_REPO: 'gohugoio/hugoBasicExample'
HUGO_BIN_NAME: 'hugo'
HUGO_CACHE_NAME: 'hugo-bin-cache'
HUGO_BIN_PATH: ci_hugo_bin
HUGO_VERSION_THRESHOLD: "0.103.0"
HUGO_VERSION_THRESHOLD: '0.103.0'
HTMLTEST_BIN_NAME: htmltest
HTMLTEST_CACHE_NAME: "htmltest-bin-cache"
HTMLTEST_CACHE_NAME: 'htmltest-bin-cache'
HTMLTEST_BIN_PATH: ci_htmltest_bin
HUGO_TESTS_VERSIONS: "0.91.0 0.108.0"
CYPRESS_CACHE_NAME: "cypress-cache"
CYPRESS_CACHE_PATH: "~/.cache"
NPM_CACHE_NAME: "npm-cache"
NPM_CACHE_PATH: "~/.npm"
HUGO_TESTS_VERSIONS: '0.91.0 0.108.0'
CYPRESS_CACHE_NAME: 'cypress-cache'
CYPRESS_CACHE_PATH: '~/.cache'
NPM_CACHE_NAME: 'npm-cache'
NPM_CACHE_PATH: '~/.npm'
jobs:
hugo-binaries:
name: Manage Hugo binaries
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/bumpBmyc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
schedule:
- cron: '30 2 * * 1'
env:
NPM_CACHE_NAME: "npm-cache"
NPM_CACHE_PATH: "~/.npm"
NPM_CACHE_NAME: 'npm-cache'
NPM_CACHE_PATH: '~/.npm'
jobs:
Bmyc:
name: Bump thirdparties using Bmyc
Expand All @@ -22,9 +22,9 @@ jobs:
cache: 'npm'
- name: Bump thirdparties and create PR
env:
LOG_FILE: "workflow.log"
PR_TITLE: "build: bump bmyc assets"
BRANCH_NAME: "build/bump_bmyc_assets"
LOG_FILE: 'workflow.log'
PR_TITLE: 'build: bump bmyc assets'
BRANCH_NAME: 'build/bump_bmyc_assets'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BMYC_GITHUB_TOKEN: ${{ secrets.BMYC_GITHUB_TOKEN }}
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/bumpHugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
schedule:
- cron: '30 2 * * 1'
env:
NPM_CACHE_NAME: "npm-cache"
NPM_CACHE_PATH: "~/.npm"
NPM_CACHE_NAME: 'npm-cache'
NPM_CACHE_PATH: '~/.npm'
jobs:
Bump:
name: Bump Hugo
Expand All @@ -19,9 +19,9 @@ jobs:
token: ${{ secrets.WORKFLOW_GITHUB_TOKEN }}
- name: Bump thirdparties and create PR
env:
LOG_FILE: "workflow.log"
PR_TITLE: "build: bump Hugo"
BRANCH_NAME: "build/bump_hugo"
LOG_FILE: 'workflow.log'
PR_TITLE: 'build: bump Hugo'
BRANCH_NAME: 'build/bump_hugo'
GITHUB_TOKEN: ${{ secrets.WORKFLOW_GITHUB_TOKEN }}
run: |
minHugoVersion=$(grep -E '^min_version.*$' theme.toml)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.changelog.outputs.zip_name }}
asset_name: ${{ steps.changelog.outputs.zip_name }}
asset_content_type: application/zip
asset_content_type: application/zip
6 changes: 3 additions & 3 deletions .htmltest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DirectoryPath: "exampleSite/public"
DirectoryPath: 'exampleSite/public'
CheckFavicon: true
EnforceHTML5: true
IgnoreDirs:
- "en"
IgnoreURLs: ["https://emojipedia.org/"]
- 'en'
IgnoreURLs: ['https://emojipedia.org/']
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# External assets ignores
assets/bulma/**
**/external/**
# Hugo ignores
public/**
resources/**
# Theme ignores
assets/js/theme/modules/const.js
exampleSite/**/*.md
exampleSite/assets/highcharts/*.json
layouts/_default/index.json
layouts/_default/_markup/render-heading.html
layouts/partials/theme/sidebar-content.html
layouts/partials/theme/taxonomy-content.html
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"overrides": [
{ "files": ["*.html"], "options": { "parser": "go-template" } },
{
"files": ["*.html", "*.css", "*.scss", "*.sass"],
"options": { "singleQuote": false }
}
],
"singleQuote": true
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

## Documentation

To get all the needed information about the theme, visit the [Shadocs documentation website](https://shadocs.netlify.app/) which is built on it.
To get all the needed information about the theme, visit the [Shadocs documentation website](https://shadocs.netlify.app/) which is built on it.
26 changes: 15 additions & 11 deletions assets/js/fencedcodes/mermaid.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
import {
addElementToModal,
displayModal,
getLoadingHelper
} from '../theme/modules/helpers.min.js'
getLoadingHelper,
} from '../theme/modules/helpers.min.js';

// VARS //
// MAIN //
let mermaidConfig = {
startOnLoad: true,
securityLevel: 'loose',
logLevel: 'fatal',
theme: 'dark'
theme: 'dark',
};
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function () {
mermaid.mermaidAPI.initialize(mermaidConfig);
renderMermaids();
});
// Render all mermaid graphs of the page
function renderMermaids() {
let divm = document.getElementsByClassName('language-mermaid');
for (let i = 0; i < divm.length; i++) {
const mermaidId = `scMermaid${i}`
const mermaidId = `scMermaid${i}`;
const graphDefinition = divm[i].textContent;
divm[i].parentElement.replaceWith(getLoadingHelper('sc-mermaid-wrapper', mermaidId));
divm[i].parentElement.replaceWith(
getLoadingHelper('sc-mermaid-wrapper', mermaidId)
);
renderMermaid(mermaidId, graphDefinition);
}
}
Expand All @@ -35,26 +37,28 @@ function renderMermaid(mermaidId, graphDefinition) {
const mermaidSvgExportIcon = document.createElement('i');
mermaidContainer.classList.add('sc-mermaid-container');
mermaidSvgExport.classList.add('is-action-button');
mermaidSvgExportIcon.classList.add('fa-solid','fa-download');
mermaidSvgExportIcon.classList.add('fa-solid', 'fa-download');
mermaidSvgExport.id = `${mermaidId}-export-svg`;
mermaidSvgExport.title = svgDownloadLabel;
mermaidFragment.appendChild(mermaidContainer);
mermaidContainer.appendChild(mermaidSvgExport);
mermaidSvgExport.appendChild(mermaidSvgExportIcon);
mermaidWrapper.appendChild(mermaidFragment);
try {
let insertSvg = function(svgCode){
let insertSvg = function (svgCode) {
mermaidContainer.insertAdjacentHTML('afterbegin', svgCode);
};
mermaid.mermaidAPI.render(mermaidSvgId, graphDefinition, insertSvg);
let mermaidRendered = document.getElementById(mermaidSvgId);
let svgBlob = new Blob([mermaidRendered.outerHTML], {type: 'image/svg+xml;charset=utf-8'});
let svgBlob = new Blob([mermaidRendered.outerHTML], {
type: 'image/svg+xml;charset=utf-8',
});
URL.revokeObjectURL(mermaidSvgExport.href);
mermaidSvgExport.href = URL.createObjectURL(svgBlob);
mermaidSvgExport.download = mermaidId;
mermaidRendered.classList.toggle('sc-mermaid-svg', true);
mermaidRendered.classList.toggle('is-modal', true);
mermaidRendered.addEventListener('click', function(e) {
mermaidRendered.addEventListener('click', function (e) {
if (!e.target.closest('a')) {
let el = this.cloneNode(true);
addElementToModal(el);
Expand All @@ -72,4 +76,4 @@ function renderMermaid(mermaidId, graphDefinition) {
mermaidWrapper.classList.toggle('is-loading', false);
mermaidContainer.insertAdjacentElement('afterbegin', ed);
}
};
}
13 changes: 7 additions & 6 deletions assets/js/shortcodes/asyncapi.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import {
getFirstAncestorByClass
} from '../theme/modules/helpers.min.js'
import { getFirstAncestorByClass } from '../theme/modules/helpers.min.js';

// VARS //
// MAIN //
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function () {
renderAllAsyncapi();
});
function renderAllAsyncapi() {
Expand All @@ -14,7 +12,10 @@ function renderAllAsyncapi() {
}
}
function renderAsyncapi(ac) {
setTimeout(function() {
getFirstAncestorByClass(ac, 'sc-asyncapi-wrapper').classList.toggle('is-loading', false);
setTimeout(function () {
getFirstAncestorByClass(ac, 'sc-asyncapi-wrapper').classList.toggle(
'is-loading',
false
);
}, 600);
}
8 changes: 4 additions & 4 deletions assets/js/shortcodes/collapsible.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// VARS //
// MAIN //
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function () {
// Manage collapsibles in content
let c = document.getElementsByClassName('sc-collapsible-header');
for (let i = 0; i < c.length; i++) {
c[i].addEventListener('click', function(e) {
c[i].addEventListener('click', function (e) {
this.classList.toggle('sc-uncollapsed');
});
};
})
}
});
Loading

0 comments on commit 8dae917

Please sign in to comment.