Skip to content

Commit

Permalink
Merge pull request #314 from pankona/markdownlint
Browse files Browse the repository at this point in the history
Introduce markdownlint to fix and prevent `fenced-code-language`
  • Loading branch information
pankona authored Sep 17, 2024
2 parents 3f5ee28 + 1274ff8 commit a631ff9
Show file tree
Hide file tree
Showing 19 changed files with 54 additions and 26 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ updates:
nix:
patterns:
- 'DeterminateSystems*'
ignore:
# They do not support specifying a version in the latest action. Therefore, we need to pin the version for nixpkgs compatibility.
# See https://github.com/DavidAnson/markdownlint-cli2-action/issues/94 for detail
- dependency-name: 'DavidAnson/markdownlint-cli2-action'
- package-ecosystem: 'gomod'
directory: '/'
schedule:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ jobs:
dprint-version: 0.45.0
- name: Debug print for deprint target paths
run: dprint output-file-paths

markdownlint:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@3aaa38e446fbd2c288af4291aa0f55d64651050f # v12
with:
globs: '**/*.md'
3 changes: 3 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config:
default: false
MD040: true # fenced-code-language
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"tekumara.typos-vscode",
"dprint.dprint",
"jnoortheen.nix-ide",
"davidanson.vscode-markdownlint"
]
}
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ deps:
nil --version
peco --version
vim --version | sed -n '1p'
markdownlint-cli2 --version | grep 'markdownlint v'
4 changes: 2 additions & 2 deletions content/posts/arch-windows-multiboot-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Windows8.1に対してWindows Updateしたところ、何だかわからない
-- genfstab とかそういったことをこまごま行う。
-- ブートローダのインストール。ブートローダにはgummibootを採用した。

```
```bash
mount /dev/sda2 /boot/EFI
cd /boot/EFI
gummiboot install
Expand All @@ -62,7 +62,7 @@ Vaioのせいなのか、Windowsのせいなのか。。

-- まず、EFIのパーティションをマウントする。

```
```bash
mount /dev/sda2 /mnt/boot/EFI
```

Expand Down
4 changes: 2 additions & 2 deletions content/posts/decorate-git-command-in-alpine.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Alpine Linux で git を使うと、色々気に食わないことが起こる

less を入れる。

```
```bash
sudo apk add less
```

Expand All @@ -35,7 +35,7 @@ Refs: https://wiki.alpinelinux.org/wiki/Alpine_Linux:FAQ#How_to_enable.2Ffix_col

曰く、

```
```plaintext
The problem is not in git itself or terminal, but in the less command. Busybox’s less doesn’t support -r (--raw-control-chars) and -R (--RAW-CONTROL-CHARS) options.
The simplest (yet not ideal) solution is to install GNU less:
apk add less
Expand Down
18 changes: 13 additions & 5 deletions content/posts/dokusho-meter.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Octopressに読書メーターのブログパーツを追加する方法。
中身は上記ブログパーツの内容をコピペしたものだが。
ブログパーツとして「最近読んだ本」をチョイス。

```
```html
<section>
<a href="http://book.akahoshitakuya.com/u/{人によって違うID}" title="{人の名前}の最近読んだ本"><img src="http://img.bookmeter.com/bp_image/640/509/{人によって違うID}.jpg" border="0" alt="{人の名前}の最近読んだ本"></a>
</section>
Expand All @@ -43,10 +43,18 @@ Octopressに読書メーターのブログパーツを追加する方法。

_config.ymlのdefault_asidesを変更。読書メーター用HTMLファイルを指定。

```
default_asides: [custom/asides/about.html, asides/recent_posts.html, asides/github.html, asides/delicious.html,
asides/pinboard.html, asides/googleplus.html, custom/asides/tag_cloud.html, custom/asides/category_list.html,
custom/asides/dokusho_meter.html]
```yaml
default_asides: [
custom/asides/about.html,
asides/recent_posts.html,
asides/github.html,
asides/delicious.html,
asides/pinboard.html,
asides/googleplus.html,
custom/asides/tag_cloud.html,
custom/asides/category_list.html,
custom/asides/dokusho_meter.html,
]
```

#### deployしたら完了
Expand Down
2 changes: 1 addition & 1 deletion content/posts/droidkaigi-2018-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (t *t) Show(text string) error {

ちゃんとどのようなエラーが (4) で吐かれているか補足してみたところ、以下の例外が投げられていた。

```
```plaintext
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GitHub から「更新のないリポジトリで使ってる定期実行 GitHub

GitHub 曰く、

```
```plaintext
Scheduled workflows are disabled automatically after 60 days of repository inactivity
```

Expand Down
2 changes: 1 addition & 1 deletion content/posts/golangtokyo-14.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ goroutine と defer と panic を組み合わせて使う場合に注意すべ
たとえば以下のような場合、A 内で張った defer は呼び出されない**場合がある**
(スライド内では"呼び出されない"と書かれているが、その限りではなさそうな)

```
```go
func A() {
defer func(){}()
go B()
Expand Down
8 changes: 4 additions & 4 deletions content/posts/golangtokyo-16.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Go 言語も wasm へのビルド (トランスパイル) を Go 1.11 からサ

たとえば以下のいわゆるハローワールド的なコードも wasm 向けにビルドできるようになる。

```
```go
package main

import "fmt"
Expand All @@ -42,7 +42,7 @@ func main() {
wasm 向けのビルドは以下のようなコマンドで行う。
(上記のソースが main.go として存在していると仮定)

```
```console
$ GOOS=js GOARCH=wasm go build -o hello.wasm main.go
```

Expand All @@ -53,7 +53,7 @@ GitHub に curl を飛ばしても取得できる。

ビルドと必要なファイルを揃える処理を一式 Makefile で書くと以下のような感じになる。

```
```makefile
WASM = test.wasm
HTML = wasm_exec.html
JS = wasm_exec.js
Expand All @@ -76,7 +76,7 @@ clean:

一式そろうと以下のようになる。

```
```console
$ ls
main.go Makefile server.go test.wasm wasm_exec.html wasm_exec.js
```
Expand Down
6 changes: 3 additions & 3 deletions content/posts/golangtokyo-6.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ https://www.slideshare.net/takuyaueda967/gopher-fest-2017
型にエイリアスが張れるようになるとのこと。
以下のような書き方ができるようになる。

```
```go
type Applicant = http.Client
```

Expand All @@ -49,7 +49,7 @@ type Applicant = http.Client

(パターン1) 新しい型を作って順次移行する場合

```
```go
type Applicant Client
```

Expand All @@ -58,7 +58,7 @@ type Applicant Client

(パターン2) 埋め込みを使う場合

```
```go
type Applicant struct { Client }
```

Expand Down
4 changes: 2 additions & 2 deletions content/posts/jp-input-on-gnome-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ dconf Editor を開き、以下の設定を確認する。

コマンドラインから確認する場合は以下のように入力する。

```
```console
$ gsettings get org.gnome.settings-daemon.plugins.xsettings overrides
# (期待される出力) {'Gtk/IMModule': <'fcitx'>}
```

入ってなかったら、上記の値をコピペして設定する。
コマンドラインから設定する場合は以下のように入力する。

```
```console
$ gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/IMModule':<'fcitx'>}"
```

Expand Down
2 changes: 1 addition & 1 deletion content/posts/raspi-livestream-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pacmanであったりyaourtで取得できるmjpg-streamerのパッケージは
下記のような。とりあえずサンプルなので、簡単に。。
書いたHTMLは、任意の場所におく。ここではひとまず、`~/www/index.html`として置いたとする。

```
```html
<html>
<body>
<h1>Raspberry Pi</h1>
Expand Down
4 changes: 2 additions & 2 deletions content/posts/usb-wifi-dongle.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ WN-AC433UM は、idVendor が 04BB、idProduct が 0959 であるが、
os_dep/linux/usb_intf.c に、以下のように追記する。
(注: 妥当か不明だがとりあえず以下の書き換えでうまくいった)

```
```patch
diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c
index 5a62f24..7138a26 100644
--- a/os_dep/linux/usb_intf.c
Expand All @@ -57,7 +57,7 @@ index 5a62f24..7138a26 100644

ビルドし、インストールする。

```
```console
$ cd rtl8192eu-linux-driver
$ make
$ sudo make install
Expand Down
2 changes: 1 addition & 1 deletion content/posts/use-uim-mozc.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Arch Linux向けです。

.xinitrcに以下を追記。uimを使う設定ですな。

```
```bash
# uim
export GTK_IM_MODULE='uim'
export QT_IM_MODULE='uim'
Expand Down
2 changes: 1 addition & 1 deletion content/posts/wsl2-uses-cpu-100-percent.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ categories: ["Linux"]

具体的には、`%userprofile%.wslconfig` というファイルを作って以下の内容を書き込む。WSL2 を再起動すれば設定が適用される。

```
```ini
[wsl2]
guiApplications=false
```
Expand Down
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
hugo
go_1_22
dart-sass

markdownlint-cli2
];
};

Expand Down

0 comments on commit a631ff9

Please sign in to comment.