slidev-theme-gtlabo 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,30 +1,25 @@
1
1
  <template>
2
2
  <div class="h-full flex flex-col">
3
- <!-- ヘッダー部分(Headerコンポーネントを使用) -->
4
3
  <Header
5
4
  :chapter-data="{ title: '参考文献' }"
6
5
  chapter="ref"
7
6
  />
8
7
 
9
- <!-- 参考文献リスト -->
10
8
  <div class="flex-1 overflow-y-auto px-6 py-2">
11
9
  <div
12
10
  v-if="citationsList.length > 0"
13
- class="space-y-3"
11
+ class="space-y-2"
14
12
  >
15
13
  <div
16
14
  v-for="(citation, index) in citationsList"
17
15
  :key="citation.key"
18
- class="citation-item border-l-2 border-sky-400 pl-3 py-1"
16
+ class="citation-item border-l-2 border-sky-400 pl-3 py-1 flex gap-3 items-baseline"
19
17
  >
20
- <!-- 引用番号(frontmatterの順番に基づく) -->
21
- <div :class="numberSizeClass">
18
+ <div :class="numberSizeClass" class="flex-shrink-0 w-6 text-right">
22
19
  [{{ citation.number }}]
23
20
  </div>
24
21
 
25
- <!-- 引用情報 -->
26
- <div :class="textSizeClass">
27
- <!-- 著者 -->
22
+ <div :class="textSizeClass" class="flex-1">
28
23
  <span
29
24
  v-if="citation.data.author"
30
25
  class="font-medium"
@@ -32,7 +27,6 @@
32
27
  {{ citation.data.author }}
33
28
  </span>
34
29
 
35
- <!-- タイトル -->
36
30
  <span
37
31
  v-if="citation.data.title"
38
32
  class="italic"
@@ -41,7 +35,6 @@
41
35
  "{{ citation.data.title }}"
42
36
  </span>
43
37
 
44
- <!-- 雑誌名 -->
45
38
  <span
46
39
  v-if="citation.data.journal"
47
40
  class="font-medium"
@@ -50,7 +43,6 @@
50
43
  <em>{{ citation.data.journal }}</em>
51
44
  </span>
52
45
 
53
- <!-- 巻号 -->
54
46
  <span v-if="citation.data.volume">
55
47
  <span v-if="citation.data.journal">, </span>
56
48
  Vol. {{ citation.data.volume }}
@@ -62,20 +54,17 @@
62
54
  No. {{ citation.data.number }}
63
55
  </span>
64
56
 
65
- <!-- ページ -->
66
57
  <span v-if="citation.data.pages">
67
58
  <span v-if="citation.data.volume || citation.data.number">, </span>
68
59
  <span v-else-if="citation.data.journal">, </span>
69
60
  pp. {{ citation.data.pages }}
70
61
  </span>
71
62
 
72
- <!-- 出版社 -->
73
63
  <span v-if="citation.data.publisher">
74
64
  <span v-if="citation.data.journal || citation.data.pages">, </span>
75
65
  {{ citation.data.publisher }}
76
66
  </span>
77
67
 
78
- <!-- 年 -->
79
68
  <span
80
69
  v-if="citation.data.year"
81
70
  class="font-medium"
@@ -84,46 +73,23 @@
84
73
  ({{ citation.data.year }})
85
74
  </span>
86
75
 
87
- <!-- DOI -->
88
- <div
89
- v-if="citation.data.doi"
90
- :class="linkSizeClass"
91
- >
92
- DOI: <a
93
- :href="`https://doi.org/${citation.data.doi}`"
94
- target="_blank"
95
- class="hover:underline"
96
- >
76
+ <span v-if="citation.data.doi" :class="linkSizeClass">
77
+ DOI:
78
+ <a :href="`https://doi.org/${citation.data.doi}`" target="_blank" class="hover:underline">
97
79
  {{ citation.data.doi }}
98
80
  </a>
99
- </div>
100
-
101
- <!-- URL -->
102
- <div
103
- v-if="citation.data.url && !citation.data.doi"
104
- :class="linkSizeClass"
105
- >
106
- URL: <a
107
- :href="citation.data.url"
108
- target="_blank"
109
- class="hover:underline break-all"
110
- >
111
- {{ citation.data.url }}
112
- </a>
113
- </div>
114
-
115
- <!-- ISSN -->
116
- <div
117
- v-if="citation.data.issn"
118
- :class="linkSizeClass"
119
- >
81
+ </span>
82
+ <span v-if="citation.data.url && !citation.data.doi" :class="linkSizeClass">
83
+ URL:
84
+ <a :href="citation.data.url" target="_blank" class="hover:underline break-all">{{ citation.data.url }}</a>
85
+ </span>
86
+ <span v-if="citation.data.issn" :class="linkSizeClass">
120
87
  ISSN: {{ citation.data.issn }}
121
- </div>
88
+ </span>
122
89
  </div>
123
90
  </div>
124
91
  </div>
125
92
 
126
- <!-- 参考文献がない場合 -->
127
93
  <div
128
94
  v-else
129
95
  class="text-center text-gray-500 mt-12"
@@ -137,7 +103,6 @@
137
103
  </div>
138
104
  </div>
139
105
 
140
- <!-- フッター(必要に応じて) -->
141
106
  <div class="flex-shrink-0 mt-4 pt-2 border-t border-gray-300 px-6">
142
107
  <div :class="footerSizeClass">
143
108
  {{ citationsList.length }} 件の参考文献
@@ -145,7 +110,7 @@
145
110
  </div>
146
111
  </div>
147
112
  </template>
148
-
113
+
149
114
  <script setup>
150
115
  import { computed, inject } from 'vue'
151
116
  import { useSlideContext } from '@slidev/client'
@@ -256,6 +221,12 @@ const sizeMap = {
256
221
  text: 'text-base text-gray-700 leading-relaxed',
257
222
  link: 'mt-1.5 text-base text-blue-600',
258
223
  footer: 'text-base text-gray-600 text-center'
224
+ },
225
+ "2xl": {
226
+ number: 'text-xl font-semibold text-sky-700 mb-2',
227
+ text: 'text-lg text-gray-700 leading-relaxed',
228
+ link: 'mt-2 text-lg text-blue-600',
229
+ footer: 'text-lg text-gray-600 text-center'
259
230
  }
260
231
  }
261
232
 
@@ -1,8 +1,9 @@
1
1
  <template>
2
- <component
2
+ <component
3
3
  :is="containerTag"
4
- :class="['math-text-container', containerClass]"
5
- :style="eq ? 'position: relative; display: block;' : ''"
4
+ ref="containerRef"
5
+ :class="['math-text-container', containerClass, eq ? 'has-eq-number' : '']"
6
+ :style="eq ? { paddingRight: eqPadding } : {}"
6
7
  >
7
8
  <!-- スロットが使われている場合 -->
8
9
  <template v-if="hasSlotContent">
@@ -124,12 +125,18 @@ const props = defineProps({
124
125
  eq: {
125
126
  type: String,
126
127
  default: null
128
+ },
129
+ eqPadding: {
130
+ type: String,
131
+ default: '2.5em'
127
132
  }
128
133
  })
129
134
 
130
135
  // 数式レジストリ
131
136
  const equationRegistry = inject('equationRegistry', null)
132
137
 
138
+ const containerRef = ref(null)
139
+
133
140
  const eqNumber = computed(() => {
134
141
  if (!props.eq || !equationRegistry) return null
135
142
  return equationRegistry.getNumber(props.eq)
@@ -413,8 +420,8 @@ const renderMathElements = async () => {
413
420
  }
414
421
 
415
422
  onMounted(() => {
416
- if (props.eq && equationRegistry) {
417
- equationRegistry.register(props.eq)
423
+ if (props.eq && equationRegistry && containerRef.value) {
424
+ equationRegistry.register(props.eq, containerRef.value)
418
425
  }
419
426
  renderMathElements()
420
427
  })
@@ -481,6 +488,11 @@ watch([processedTextSegments, processedSlotSegments], () => {
481
488
  border-radius: 3px;
482
489
  }
483
490
 
491
+ .math-text-container.has-eq-number {
492
+ position: relative;
493
+ display: block;
494
+ }
495
+
484
496
  .eq-number {
485
497
  position: absolute;
486
498
  right: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slidev-theme-gtlabo",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "A Slidev theme for laboratory presentations with customizable components",
5
5
  "author": "mksmkss",
6
6
  "license": "MIT",