Skip to content

Commit

Permalink
reformat all files
Browse files Browse the repository at this point in the history
  • Loading branch information
drewhammond committed Nov 22, 2023
1 parent 8231a6a commit af97fde
Show file tree
Hide file tree
Showing 46 changed files with 906 additions and 887 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Build Images"
on:
release:
types: [published]
types: [ published ]

# FIXME: these variables don't seem to work at all
workflow_call:
Expand Down
60 changes: 30 additions & 30 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,42 @@ jobs:
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- if: matrix.language == 'go'
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.4'
- if: matrix.language == 'go'
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.4'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: go-test
on: [push]
on: [ push ]

jobs:
build:
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,21 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Docker Login
- name: Docker Login
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.4'
cache: true
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
if: success() && startsWith(github.ref, 'refs/tags/')
with:
Expand Down
6 changes: 2 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ before:
- go mod tidy
- make build-ui
builds:
-
env:
- env:
- CGO_ENABLED=0
goos:
- linux
Expand All @@ -29,8 +28,7 @@ release:
prerelease: auto
mode: append
archives:
-
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
dockers:
- image_templates:
- "drewhammond/chefbrowser:{{ .Tag }}"
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ I think the frontend could use some love.

Set `app_mode = development` in your config file to enable developer mode. This mode does the following:

- Go Templates are loaded from the file system instead of embedded into the backend. They can be changed without recompiling.
- Go Templates are loaded from the file system instead of embedded into the backend. They can be changed without
recompiling.
- CSS/JS links in the HTML are updated to point to the local Vite dev server for live reloading.

Install UI dependencies and start the frontend development server:
Expand All @@ -72,7 +73,7 @@ Access the dev server at http://localhost:8080.
CSS/JS changes will trigger automatic rebuilds
as long as you have the frontend development server running.

>Note: Go changes will not be live reloaded. Rebuild backend for changes to take effect.
> Note: Go changes will not be live reloaded. Rebuild backend for changes to take effect.
## TODO

Expand Down
2 changes: 1 addition & 1 deletion ui/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import hljs from 'highlight.js/lib/core';
import DOMPurify from 'dompurify';
import { marked } from 'marked';
import {marked} from 'marked';
import dayjs from "dayjs";

window.dayjs = dayjs
Expand Down
20 changes: 10 additions & 10 deletions ui/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<!-- This file contains no purpose in the actual application. It is only used by Vite to compile JS -->
<div id="app"></div>
<script type="module" src="/main.js"></script>
</body>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Vite App</title>
</head>
<body>
<!-- This file contains no purpose in the actual application. It is only used by Vite to compile JS -->
<div id="app"></div>
<script type="module" src="/main.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions ui/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import erb from 'highlight.js/lib/languages/erb';
import yaml from 'highlight.js/lib/languages/yaml';
import json from 'highlight.js/lib/languages/json';
import bash from 'highlight.js/lib/languages/bash';

hljs.registerLanguage('bash', bash);
hljs.registerLanguage('ruby', ruby);
hljs.registerLanguage('erb', erb);
Expand Down
6 changes: 3 additions & 3 deletions ui/src/js/code-highlighter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function codeHighlighter() {
window.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
});
window.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
});
}
1 change: 0 additions & 1 deletion ui/src/js/day.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import dayjs from 'dayjs/esm/index'
// const dayjs = require('dayjs')

Expand Down
1 change: 0 additions & 1 deletion ui/src/js/scroll-to-top.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

let scrollToTopBtn = document.getElementById("btn-scroll-to-top");
let fourViewports = window.innerHeight * 4;

Expand Down
1 change: 1 addition & 0 deletions ui/src/scss/bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// Selective bootstrap SCSS
@import "~bootstrap/scss/mixins/banner";

@include bsBanner("");

// Configuration
Expand Down
70 changes: 35 additions & 35 deletions ui/src/scss/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,54 +50,54 @@ pre code.hljs {
}

.dark-mode-toggle > .form-check-input {
border-radius: 2em;
border-radius: 2em;
}

.dark-mode-toggle > label, input {
cursor: pointer;
cursor: pointer;
}

.cb-cookbook-version-badge {
background-color: var(--bs-tertiary-bg);
background-color: var(--bs-tertiary-bg);
}

$color-mode-type: data;
@include color-mode(light) {
.cb-navbar, .cb-footer {
background-color: var(--bs-light);
}
.cb-search-btn {
border-color: var(--bs-success);
color: var(--bs-success);
}

@import 'highlight.js/scss/stackoverflow-light';
.cb-navbar, .cb-footer {
background-color: var(--bs-light);
}
.cb-search-btn {
border-color: var(--bs-success);
color: var(--bs-success);
}

@import 'highlight.js/scss/stackoverflow-light';
}

@include color-mode(dark) {
.cb-navbar, .cb-footer {
background-color: var(--bs-secondary-bg);
}

.nav-link:hover, .nav-link:focus {
color: var(--bs-emphasis-color)
}

.cb-search-btn {
border-color: var(--bs-tertiary-color);
color: var(--bs-tertiary-color);
}

#enable-dark-mode {
background-color: var(--bs-tertiary-bg);
border-color: var(--bs-secondary-color);
}

@import 'highlight.js/scss/base16/default-dark';
.hljs-ln td.hljs-ln-numbers {
color: var(--bs-tertiary-color);
border-right-color: var(--bs-tertiary-color);
}
.cb-navbar, .cb-footer {
background-color: var(--bs-secondary-bg);
}

.nav-link:hover, .nav-link:focus {
color: var(--bs-emphasis-color)
}

.cb-search-btn {
border-color: var(--bs-tertiary-color);
color: var(--bs-tertiary-color);
}

#enable-dark-mode {
background-color: var(--bs-tertiary-bg);
border-color: var(--bs-secondary-color);
}

@import 'highlight.js/scss/base16/default-dark';
.hljs-ln td.hljs-ln-numbers {
color: var(--bs-tertiary-color);
border-right-color: var(--bs-tertiary-color);
}
}

#btn-scroll-to-top {
Expand Down
28 changes: 14 additions & 14 deletions ui/templates/cookbook.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{define "content"}}
<div class="row">
{{ include "partials/cookbook/header" }}
</div>
<div class="row">
<div class="col-lg-8">
{{include "partials/cookbook_readme"}}
</div>
<div class="col-lg-4 border-start">
{{include "partials/cookbook_metadata"}}
</div>
</div>
{{end}}
{{define "active_tab" }}overview{{end}}
{{ define "content"}}
<div class="row">
{{ include "partials/cookbook/header" }}
</div>
<div class="row">
<div class="col-lg-8">
{{ include "partials/cookbook_readme"}}
</div>
<div class="col-lg-4 border-start">
{{ include "partials/cookbook_metadata"}}
</div>
</div>
{{ end }}
{{ define "active_tab" }}overview{{ end }}
40 changes: 20 additions & 20 deletions ui/templates/cookbook_file.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{{define "content"}}
<div class="row">
{{ include "partials/cookbook/header" }}
</div>
<div class="row">
<div class="col">
<h3>{{.path}}</h3>
<div id="cookbook-file">
<pre><code>{{ .file }}</code></pre>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
hljs.highlightAll()
hljs.initLineNumbersOnLoad()
})
</script>
</div>
</div>
{{end}}
{{define "active_tab" }}files{{end}}
{{ define "content"}}
<div class="row">
{{ include "partials/cookbook/header" }}
</div>
<div class="row">
<div class="col">
<h3>{{.path}}</h3>
<div id="cookbook-file">
<pre><code>{{ .file }}</code></pre>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
hljs.highlightAll()
hljs.initLineNumbersOnLoad()
})
</script>
</div>
</div>
{{ end }}
{{ define "active_tab" }}files{{ end }}
Loading

0 comments on commit af97fde

Please sign in to comment.