Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce autoformatter #212

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Continuous Integration

# This action works with pull requests and pushes
on:
pull_request:
push:
branches:
- master

jobs:
prettier:
runs-on: ubuntu-latest

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

- name: Check code style
uses: creyD/[email protected]
with:
dry: true
working_directory: hugo/
prettier_options: --check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/public/
/mumble-www.7z
/hugo/resources/_gen/
*.lock
2 changes: 2 additions & 0 deletions hugo/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.ice
*.html
4 changes: 4 additions & 0 deletions hugo/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 120,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I dislike max line widths quite a bit, especially narrow ones. It see it's at least 120, which could be fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A maximum of 120 is consistent with how we format our C++ code.
I'd also be fine with let's say 150 but I really think line breaking increases readability as you're not dependent on your editor to do auto line wrapping.

"proseWrap": "always"
}
1 change: 0 additions & 1 deletion hugo/archetypes/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

241 changes: 123 additions & 118 deletions hugo/assets/css/_common.scss
Original file line number Diff line number Diff line change
@@ -1,118 +1,123 @@
a {
color: black;
}

aside, em, i {
font-style: italic;
}

sup {
vertical-align: super;
}

sub {
vertical-align: sub;
}

h1 {
grid-template: "header";
font-size: 200%;
align-self: center;
}

ul.menu {
list-style-type: none;
margin: 0;
padding: 0;

li {
display: inline-block;

a {
display: inline-block;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}
}

.markdown-body {
line-height: 1.7em;

ul {
list-style-type: disc;
padding-left: 0em;
}
b, strong {
font-weight: bold;
}
}

figure {
border: 0px solid #c0c0c0;
display: inline-block;
img {
display: block;
}
}
figcaption {
display: block;
background-color: #eeeeee;
/* font: italic smaller sans-serif; */
font-style: italic;
padding: 3px 6px;
}
.figp {
display: block;
margin-bottom: 16px;
}

@media (max-width: 1899px) {
aside.article-toc { display: none; }
}
.article-toc {
position: fixed;
right: 2em;
border: 1px solid #ccc;
border-radius: 0.4em;
padding: 4px 8px;
max-width: 280px;
}
.article-toc-title {
font-weight: bold;
}
.article-toc p {
margin-bottom: 0.4em;
}
.article-toc ul {
list-style-type: none;
padding-left: 0;
}

.label {
border: 1px solid #ccc;
background-color: #fcc;
/* color: red; */
border-radius: 4px;
padding: 0px 2px;
}

.feed-icons {
text-align: right;
margin-top: 1em;
line-height: 32px;

a {
display: inline-block;
}
img {
width: 32px;
height: 32px;
}
}
a {
color: black;
}

aside,
em,
i {
font-style: italic;
}

sup {
vertical-align: super;
}

sub {
vertical-align: sub;
}

h1 {
grid-template: "header";
font-size: 200%;
align-self: center;
}

ul.menu {
list-style-type: none;
margin: 0;
padding: 0;

li {
display: inline-block;

a {
display: inline-block;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}
}

.markdown-body {
line-height: 1.7em;

ul {
list-style-type: disc;
padding-left: 0em;
}
b,
strong {
font-weight: bold;
}
}

figure {
border: 0px solid #c0c0c0;
display: inline-block;
img {
display: block;
}
}
figcaption {
display: block;
background-color: #eeeeee;
/* font: italic smaller sans-serif; */
font-style: italic;
padding: 3px 6px;
}
.figp {
display: block;
margin-bottom: 16px;
}

@media (max-width: 1899px) {
aside.article-toc {
display: none;
}
}
.article-toc {
position: fixed;
right: 2em;
border: 1px solid #ccc;
border-radius: 0.4em;
padding: 4px 8px;
max-width: 280px;
}
.article-toc-title {
font-weight: bold;
}
.article-toc p {
margin-bottom: 0.4em;
}
.article-toc ul {
list-style-type: none;
padding-left: 0;
}

.label {
border: 1px solid #ccc;
background-color: #fcc;
/* color: red; */
border-radius: 4px;
padding: 0px 2px;
}

.feed-icons {
text-align: right;
margin-top: 1em;
line-height: 32px;

a {
display: inline-block;
}
img {
width: 32px;
height: 32px;
}
}
Loading