質問編集履歴

1

以前の問題が解決したので、質問内容自体を大きく変更した。

2021/11/07 01:50

投稿

blendegg
blendegg

スコア81

test CHANGED
@@ -1 +1 @@
1
- マークダウンのヘッダ背景を変更したい。正規表現の指定方法
1
+ マークダウンファイルのヘッダーの背景を変更したい
test CHANGED
@@ -1,18 +1,4 @@
1
- 以下のエクステンションを使用しています。
2
-
3
- マークダウンのヘッダー背景色を変更するめに使用してす。
1
+ マークダウンファイルのヘッダー背景色を変更たいす。ヘッダーとは以下のような記述です。
4
-
5
- 正規表現の指定方法で躓いているので教えて下さい。
6
-
7
-
8
-
9
- https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-highlight
10
-
11
-
12
-
13
-
14
-
15
- 以下のh1とh2にそれぞれ別々のスタイルを適用したいと思っています。
16
2
 
17
3
  ```ここに言語を入力
18
4
 
@@ -24,54 +10,54 @@
24
10
 
25
11
 
26
12
 
13
+ setting.jsonにこのような記述をしました。
14
+
27
- 以下のようにすればh1行がsilverに染まるはずなんですが、正規表現が誤っているようで、マッチません。正規表現の意味とては「1文字目は#2文字#以外」としており、h2の「# h2」部分まヒットしないようにしています。
15
+ し、文字色が変更されるのjsonファイルに関してです。
28
16
 
29
17
 
30
18
 
31
- 以下のようにすればsilverに染まりますから、拡張自体は動作しているようです。
19
+ "editor.tokenColorCustomizations": {
32
20
 
33
- ```ここに言語を入力
21
+ "textMateRules": [
34
22
 
35
- "(# h1)":
23
+ {
36
24
 
25
+ "scope": "string", // セレクタ
26
+
27
+ "settings": {
28
+
29
+ "foreground": "#ffd663",
30
+
31
+ "fontStyle": "bold"
32
+
33
+ }
34
+
35
+ }
36
+
37
+ // …… 同様な設定が続く ……
38
+
39
+ ]
40
+
41
+ }
42
+
37
- ```
43
+ 参考
44
+
45
+ https://atmarkit.itmedia.co.jp/ait/articles/1710/20/news023_2.html
38
46
 
39
47
 
40
48
 
49
+ # やりたいこと
41
50
 
51
+ ★色の変更.mdファイルに限定
42
52
 
43
- ```ここ言語入力
53
+ ★既存のテーマファイルが気入っているので、一部上書きしたい
44
54
 
45
- "highlight.regexes":
46
-
47
- {
48
-
49
- "(^#[^#].*)":
50
-
51
- {
52
-
53
- // A regex will be created from this string, don't forget to double escape it
54
-
55
- "regexFlags": "g", // Flags used when building this regex
55
+ ★シンタックスのみ変更することは可能でしょうか?デフォルトで入っているテーマはuiとシンタックスがセットになっていますよね。uiのデザインまでしたくないです。
56
-
57
- "filterLanguageRegex": "markdown", // Apply only if current file's language matches this regex. Requires double escaping
58
-
59
- "filterFileRegex": ".*\.md", // Apply only if the current file's path matches this regex. Requires double escaping
60
-
61
- "decorations":
62
-
63
- [ // Decoration options to apply to the capturing groups
64
-
65
- {"backgroundColor":"silver"}
66
-
67
- ]
68
-
69
- }
70
-
71
- },
72
-
73
- ```
74
56
 
75
57
 
76
58
 
59
+ これらのことは可能でしょうか?
60
+
77
- こが間違いなのか分からないのですが、アドバイスいただけますか?
61
+ yeomanなを使ってアドオン化る必要あればそうします
62
+
63
+ アドバイスお願いします。