Skip to content

Commit fa631d9

Browse files
authored
Merge pull request #201 from dragomano/docs
Update docs
2 parents f1e64bd + f7c72a4 commit fa631d9

File tree

26 files changed

+810
-213
lines changed

26 files changed

+810
-213
lines changed

docs/.vitepress/config.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,20 @@ export default defineConfig({
7979
hostname: 'https://dragomano.github.io/Light-Portal/',
8080
},
8181
vite: {
82+
optimizeDeps: {
83+
include: [
84+
// @rive-app/canvas is a CJS/UMD module, so it needs to be included here
85+
// for Vite to properly bundle it.
86+
'@nolebase/vitepress-plugin-enhanced-readabilities > @nolebase/ui > @rive-app/canvas',
87+
],
88+
exclude: ['@nolebase/vitepress-plugin-enhanced-readabilities/client'],
89+
},
90+
ssr: {
91+
noExternal: [
92+
// If there are other packages that need to be processed by Vite, you can add them here.
93+
'@nolebase/vitepress-plugin-enhanced-readabilities',
94+
],
95+
},
8296
resolve: {
8397
alias: [
8498
{

docs/.vitepress/locales/it.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,29 @@ export default {
88
nav: [
99
{
1010
text: 'Inizio',
11-
link: '/'
11+
link: '/',
1212
},
1313
{
1414
text: 'Introduzione',
15-
link: '/intro'
15+
link: '/intro',
1616
},
1717
{
1818
text: 'Esempi',
19-
link: '/examples'
19+
link: '/examples',
2020
},
2121
{
2222
text: 'Demo',
23-
link: 'https://demo.dragomano.ru/'
23+
link: 'https://demo.dragomano.ru/',
2424
},
2525
{
2626
text: 'Changelog',
27-
link: '/changelog'
28-
}
27+
link: '/changelog',
28+
},
2929
],
3030
outline: { label: 'In questa pagina' },
3131
docFooter: {
3232
prev: 'Pagina precedente',
33-
next: 'Pagina successiva'
33+
next: 'Pagina successiva',
3434
},
3535
darkModeSwitchLabel: 'Aspetto',
3636
lightModeSwitchTitle: 'Passa al tema chiaro',
@@ -40,16 +40,17 @@ export default {
4040
langMenuLabel: 'Cambia lingua',
4141
notFound: {
4242
title: 'PAGINA NON TROVATA',
43-
quote: 'Ma se non cambi direzione e se continui a guardare, potresti finire dove stai andando.',
43+
quote:
44+
'Ma se non cambi direzione e se continui a guardare, potresti finire dove stai andando.',
4445
linkLabel: 'Vai alla home',
45-
linkText: 'Vai alla Home'
46+
linkText: 'Vai alla Home',
4647
},
4748
search: {
4849
options: {
4950
translations: {
5051
button: {
5152
buttonText: 'Cerca',
52-
buttonAriaLabel: 'Cerca'
53+
buttonAriaLabel: 'Cerca',
5354
},
5455
modal: {
5556
displayDetails: 'Visualizza lista dettagliata',
@@ -59,11 +60,11 @@ export default {
5960
footer: {
6061
selectText: 'seleziona',
6162
navigateText: 'naviga',
62-
closeText: 'chiudi'
63-
}
64-
}
65-
}
66-
}
67-
}
68-
}
69-
};
63+
closeText: 'chiudi',
64+
},
65+
},
66+
},
67+
},
68+
},
69+
},
70+
};

docs/.vitepress/theme/index.js

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,62 @@
11
import DefaultTheme from 'vitepress/theme';
22
import './custom.css';
3+
import giscusTalk from 'vitepress-plugin-comment-with-giscus';
4+
import { useData, useRoute } from 'vitepress';
5+
import { h, toRefs } from 'vue';
6+
import {
7+
NolebaseEnhancedReadabilitiesMenu,
8+
NolebaseEnhancedReadabilitiesScreenMenu,
9+
} from '@nolebase/vitepress-plugin-enhanced-readabilities/client';
10+
import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css';
11+
import { InjectionKey } from '@nolebase/vitepress-plugin-enhanced-readabilities/client';
12+
import { locales } from './locales';
313

414
export default {
515
...DefaultTheme,
6-
16+
Layout: () => {
17+
return h(DefaultTheme.Layout, null, {
18+
// A enhanced readabilities menu for wider screens
19+
'nav-bar-content-after': () => h(NolebaseEnhancedReadabilitiesMenu),
20+
// A enhanced readabilities menu for narrower screens (usually smaller than iPad Mini)
21+
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu),
22+
});
23+
},
724
enhanceApp(ctx) {
25+
ctx.app.provide(InjectionKey, {
26+
locales,
27+
});
28+
829
DefaultTheme.enhanceApp(ctx);
930
},
31+
setup() {
32+
const { frontmatter } = toRefs(useData());
33+
const route = useRoute();
34+
35+
// Obtain configuration from: https://giscus.app/
36+
giscusTalk(
37+
{
38+
repo: 'dragomano/Light-Portal',
39+
repoId: 'MDEwOlJlcG9zaXRvcnkyMzA1OTgxOTE=',
40+
category: 'Q&A',
41+
categoryId: 'DIC_kwDODb6mL84CN-iX',
42+
mapping: 'pathname',
43+
inputPosition: 'bottom',
44+
lang: 'en',
45+
locales: {
46+
en: 'en',
47+
ru: 'ru',
48+
it: 'it',
49+
el: 'gr',
50+
},
51+
homePageShowComment: false,
52+
lightTheme: 'light_tritanopia',
53+
darkTheme: 'transparent_dark',
54+
},
55+
{
56+
frontmatter,
57+
route,
58+
},
59+
true
60+
);
61+
},
1062
};

docs/.vitepress/theme/locales/en.js

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
export default {
2+
title: {
3+
title: 'Enhanced Readability',
4+
titleAriaLabel: 'Enhanced Readability',
5+
},
6+
layoutSwitch: {
7+
title: 'Layout Switch',
8+
titleHelpMessage:
9+
'Adjust the layout style of the site to adapt to different reading needs and screens.',
10+
titleAriaLabel: 'Layout Switch',
11+
titleScreenNavWarningMessage: 'No available layout can be switched in mobile screen.',
12+
optionFullWidth: 'Expand all',
13+
optionFullWidthAriaLabel: 'Expand all',
14+
optionFullWidthHelpMessage:
15+
'The sidebar and content area occupy the entire width of the screen.',
16+
optionSidebarWidthAdjustableOnly: 'Expand sidebar with adjustable values',
17+
optionSidebarWidthAdjustableOnlyAriaLabel: 'Expand sidebar with adjustable values',
18+
optionSidebarWidthAdjustableOnlyHelpMessage:
19+
'Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.',
20+
optionBothWidthAdjustable: 'Expand all with adjustable values',
21+
optionBothWidthAdjustableAriaLabel: 'Expand all with adjustable values',
22+
optionBothWidthAdjustableHelpMessage:
23+
'Expand both sidebar and document content and add two new slider for user to choose and customize their desired width of the maximum width of either sidebar or document content can go.',
24+
optionOriginalWidth: 'Original width',
25+
optionOriginalWidthAriaLabel: 'Original width',
26+
optionOriginalWidthHelpMessage: 'The original layout width of the site',
27+
contentLayoutMaxWidth: {
28+
title: 'Content Layout Max Width',
29+
titleAriaLabel: 'Content Layout Max Width',
30+
titleHelpMessage:
31+
'Adjust the exact value of the document content width of the site layout to adapt to different reading needs and screens.',
32+
titleScreenNavWarningMessage:
33+
'Content Layout Max Width is not available in mobile screen temporarily.',
34+
slider: 'Adjust the maximum width of the content layout',
35+
sliderAriaLabel: 'Adjust the maximum width of the content layout',
36+
sliderHelpMessage:
37+
'A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.',
38+
},
39+
pageLayoutMaxWidth: {
40+
title: 'Page Layout Max Width',
41+
titleAriaLabel: 'Page Layout Max Width',
42+
titleHelpMessage:
43+
'Adjust the exact value of the page width of the site layout to adapt to different reading needs and screens.',
44+
titleScreenNavWarningMessage:
45+
'Page Layout Max Width is not available in mobile screen temporarily.',
46+
slider: 'Adjust the maximum width of the page layout',
47+
sliderAriaLabel: 'Adjust the maximum width of the page layout',
48+
sliderHelpMessage:
49+
'A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.',
50+
},
51+
},
52+
spotlight: {
53+
title: 'Spotlight',
54+
titleAriaLabel: 'Spotlight',
55+
titleHelpMessage:
56+
'Highlight the line where the mouse is currently hovering in the content to optimize for users who may have reading and focusing difficulties.',
57+
titleScreenNavWarningMessage: 'Spotlight is not available in mobile screen temporarily.',
58+
optionOn: 'On',
59+
optionOnAriaLabel: 'On',
60+
optionOnHelpMessage: 'Turn on Spotlight.',
61+
optionOff: 'Off',
62+
optionOffAriaLabel: 'Off',
63+
optionOffHelpMessage: 'Turn off Spotlight.',
64+
styles: {
65+
title: 'Spotlight Styles',
66+
titleAriaLabel: 'Spotlight Styles',
67+
titleHelpMessage: 'Adjust the styles of Spotlight.',
68+
titleScreenNavWarningMessage:
69+
'Spotlight Styles is not available in mobile screen temporarily.',
70+
optionUnder: 'Under',
71+
optionUnderAriaLabel: 'Under',
72+
optionUnderHelpMessage:
73+
'Add a solid background color underneath the hovering element to highlight where the cursor is currently hovering.',
74+
optionAside: 'Aside',
75+
optionAsideAriaLabel: 'Aside',
76+
optionAsideHelpMessage:
77+
'Add a fixed line with solid color aside the hovering element to highlight where the cursor is currently hovering.',
78+
},
79+
},
80+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import en from './en';
2+
import ru from './ru';
3+
4+
export const locales = {
5+
en,
6+
ru,
7+
};

docs/.vitepress/theme/locales/ru.js

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
export default {
2+
title: {
3+
title: 'Улучшенная читаемость',
4+
titleAriaLabel: 'Улучшенная читаемость',
5+
},
6+
layoutSwitch: {
7+
title: 'Макет',
8+
titleHelpMessage:
9+
'Настройте стиль оформления сайта в соответствии со своими потребностями и экраном.',
10+
titleAriaLabel: 'Макет',
11+
titleScreenNavWarningMessage: 'На мобильном экране переключатель макета недоступен.',
12+
optionFullWidth: 'Полноэкранный',
13+
optionFullWidthAriaLabel: 'Полноэкранный',
14+
optionFullWidthHelpMessage:
15+
'Растягивает боковую панель и область содержимого на всю ширину экрана.',
16+
optionSidebarWidthAdjustableOnly: 'Боковая панель с настройкой',
17+
optionSidebarWidthAdjustableOnlyAriaLabel: 'Боковая панель с настройкой',
18+
optionSidebarWidthAdjustableOnlyHelpMessage:
19+
'Добавляет ползунок для настройки желаемой ширины боковой панели. Ширина области контента останется прежней.',
20+
optionBothWidthAdjustable: 'Полноэкранный с настройкой',
21+
optionBothWidthAdjustableAriaLabel: 'Полноэкранный с настройкой',
22+
optionBothWidthAdjustableHelpMessage:
23+
'Добавляет ползунок для настройки желаемой ширины боковой панели или содержимого документа.',
24+
optionOriginalWidth: 'Оригинальный',
25+
optionOriginalWidthAriaLabel: 'Оригинальный',
26+
optionOriginalWidthHelpMessage: 'Отображает страницу в соответствии с исходной шириной сайта.',
27+
contentLayoutMaxWidth: {
28+
title: 'Измените максимальную ширину содержимого',
29+
titleAriaLabel: 'Измените максимальную ширину содержимого',
30+
titleHelpMessage:
31+
'Отрегулируйте точное значение ширины страницы макета сайта, чтобы адаптировать его к различным потребностям чтения и экранам.',
32+
titleScreenNavWarningMessage:
33+
'Максимальная ширина макета содержимого недоступна на экране мобильного устройства.',
34+
slider: 'Отрегулируйте максимальную ширину содержимого',
35+
sliderAriaLabel: 'Отрегулируйте максимальную ширину содержимого',
36+
sliderHelpMessage:
37+
'Ползунок с диапазоном значений, позволяющий пользователю выбирать и настраивать желаемую ширину или максимальную ширину макета контента.',
38+
},
39+
pageLayoutMaxWidth: {
40+
title: 'Измените максимальную ширину страницы',
41+
titleAriaLabel: 'Измените максимальную ширину страницы',
42+
titleHelpMessage:
43+
'Отрегулируйте точное значение ширины содержимого документа в макете сайта, чтобы адаптировать его к различным потребностям чтения и экранам.',
44+
titleScreenNavWarningMessage:
45+
'Максимальная ширина макета страницы недоступна на экране мобильного устройства.',
46+
slider: 'Отрегулируйте максимальную ширину страницы',
47+
sliderAriaLabel: 'Отрегулируйте максимальную ширину страницы',
48+
sliderHelpMessage:
49+
'Ползунок с диапазоном значений, позволяющий пользователю выбирать и настраивать желаемую ширину или максимальную ширину макета контента.',
50+
},
51+
},
52+
spotlight: {
53+
title: 'Фокус',
54+
titleAriaLabel: 'Фокус',
55+
titleHelpMessage:
56+
'Выделите строку, в которой в данный момент находится курсор мыши, чтобы оптимизировать контент для пользователей, испытывающих трудности с чтением и фокусировкой.',
57+
titleScreenNavWarningMessage: 'Фокусировка временно недоступна на экранах мобильных устройств.',
58+
optionOn: 'Включить',
59+
optionOnAriaLabel: 'Включить',
60+
optionOnHelpMessage: 'Включает фокус.',
61+
optionOff: 'Выключить',
62+
optionOffAriaLabel: 'Выключить',
63+
optionOffHelpMessage: 'Выключает фокус.',
64+
styles: {
65+
title: 'Стиль фокуса',
66+
titleAriaLabel: 'Стиль фокуса',
67+
titleHelpMessage: 'Выберите предпочитаемый стиль фокуса.',
68+
titleScreenNavWarningMessage:
69+
'Стили фокуса временно недоступны на экранах мобильных устройств.',
70+
optionUnder: 'Фоновый',
71+
optionUnderAriaLabel: 'Фоновый',
72+
optionUnderHelpMessage:
73+
'Выделяет блок текста, на который в данный момент наведён курсор, сплошным фоновым цветом.',
74+
optionAside: 'Боковой',
75+
optionAsideAriaLabel: 'Боковой',
76+
optionAsideHelpMessage:
77+
'Добавляет вертикальную линию рядом с блоком текста, на который в данный момент наведён курсор.',
78+
},
79+
},
80+
};

docs/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"devDependencies": {
3+
"@nolebase/vitepress-plugin-enhanced-readabilities": "2.0.0-rc10",
34
"release-timeline": "^0.6.0",
45
"sass": "^1.75.0",
56
"vitepress": "^1.1.4",
@@ -9,5 +10,8 @@
910
"docs:dev": "vitepress dev",
1011
"docs:build": "vitepress build",
1112
"docs:preview": "vitepress preview"
13+
},
14+
"dependencies": {
15+
"vitepress-plugin-comment-with-giscus": "^1.1.15"
1216
}
1317
}

0 commit comments

Comments
 (0)