Skip to content

Commit

Permalink
Merge pull request #201 from dragomano/docs
Browse files Browse the repository at this point in the history
Update docs
  • Loading branch information
dragomano authored Apr 29, 2024
2 parents f1e64bd + f7c72a4 commit fa631d9
Show file tree
Hide file tree
Showing 26 changed files with 810 additions and 213 deletions.
14 changes: 14 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ export default defineConfig({
hostname: 'https://dragomano.github.io/Light-Portal/',
},
vite: {
optimizeDeps: {
include: [
// @rive-app/canvas is a CJS/UMD module, so it needs to be included here
// for Vite to properly bundle it.
'@nolebase/vitepress-plugin-enhanced-readabilities > @nolebase/ui > @rive-app/canvas',
],
exclude: ['@nolebase/vitepress-plugin-enhanced-readabilities/client'],
},
ssr: {
noExternal: [
// If there are other packages that need to be processed by Vite, you can add them here.
'@nolebase/vitepress-plugin-enhanced-readabilities',
],
},
resolve: {
alias: [
{
Expand Down
37 changes: 19 additions & 18 deletions docs/.vitepress/locales/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ export default {
nav: [
{
text: 'Inizio',
link: '/'
link: '/',
},
{
text: 'Introduzione',
link: '/intro'
link: '/intro',
},
{
text: 'Esempi',
link: '/examples'
link: '/examples',
},
{
text: 'Demo',
link: 'https://demo.dragomano.ru/'
link: 'https://demo.dragomano.ru/',
},
{
text: 'Changelog',
link: '/changelog'
}
link: '/changelog',
},
],
outline: { label: 'In questa pagina' },
docFooter: {
prev: 'Pagina precedente',
next: 'Pagina successiva'
next: 'Pagina successiva',
},
darkModeSwitchLabel: 'Aspetto',
lightModeSwitchTitle: 'Passa al tema chiaro',
Expand All @@ -40,16 +40,17 @@ export default {
langMenuLabel: 'Cambia lingua',
notFound: {
title: 'PAGINA NON TROVATA',
quote: 'Ma se non cambi direzione e se continui a guardare, potresti finire dove stai andando.',
quote:
'Ma se non cambi direzione e se continui a guardare, potresti finire dove stai andando.',
linkLabel: 'Vai alla home',
linkText: 'Vai alla Home'
linkText: 'Vai alla Home',
},
search: {
options: {
translations: {
button: {
buttonText: 'Cerca',
buttonAriaLabel: 'Cerca'
buttonAriaLabel: 'Cerca',
},
modal: {
displayDetails: 'Visualizza lista dettagliata',
Expand All @@ -59,11 +60,11 @@ export default {
footer: {
selectText: 'seleziona',
navigateText: 'naviga',
closeText: 'chiudi'
}
}
}
}
}
}
};
closeText: 'chiudi',
},
},
},
},
},
},
};
54 changes: 53 additions & 1 deletion docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,62 @@
import DefaultTheme from 'vitepress/theme';
import './custom.css';
import giscusTalk from 'vitepress-plugin-comment-with-giscus';
import { useData, useRoute } from 'vitepress';
import { h, toRefs } from 'vue';
import {
NolebaseEnhancedReadabilitiesMenu,
NolebaseEnhancedReadabilitiesScreenMenu,
} from '@nolebase/vitepress-plugin-enhanced-readabilities/client';
import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css';
import { InjectionKey } from '@nolebase/vitepress-plugin-enhanced-readabilities/client';
import { locales } from './locales';

export default {
...DefaultTheme,

Layout: () => {
return h(DefaultTheme.Layout, null, {
// A enhanced readabilities menu for wider screens
'nav-bar-content-after': () => h(NolebaseEnhancedReadabilitiesMenu),
// A enhanced readabilities menu for narrower screens (usually smaller than iPad Mini)
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu),
});
},
enhanceApp(ctx) {
ctx.app.provide(InjectionKey, {
locales,
});

DefaultTheme.enhanceApp(ctx);
},
setup() {
const { frontmatter } = toRefs(useData());
const route = useRoute();

// Obtain configuration from: https://giscus.app/
giscusTalk(
{
repo: 'dragomano/Light-Portal',
repoId: 'MDEwOlJlcG9zaXRvcnkyMzA1OTgxOTE=',
category: 'Q&A',
categoryId: 'DIC_kwDODb6mL84CN-iX',
mapping: 'pathname',
inputPosition: 'bottom',
lang: 'en',
locales: {
en: 'en',
ru: 'ru',
it: 'it',
el: 'gr',
},
homePageShowComment: false,
lightTheme: 'light_tritanopia',
darkTheme: 'transparent_dark',
},
{
frontmatter,
route,
},
true
);
},
};
80 changes: 80 additions & 0 deletions docs/.vitepress/theme/locales/en.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
export default {
title: {
title: 'Enhanced Readability',
titleAriaLabel: 'Enhanced Readability',
},
layoutSwitch: {
title: 'Layout Switch',
titleHelpMessage:
'Adjust the layout style of the site to adapt to different reading needs and screens.',
titleAriaLabel: 'Layout Switch',
titleScreenNavWarningMessage: 'No available layout can be switched in mobile screen.',
optionFullWidth: 'Expand all',
optionFullWidthAriaLabel: 'Expand all',
optionFullWidthHelpMessage:
'The sidebar and content area occupy the entire width of the screen.',
optionSidebarWidthAdjustableOnly: 'Expand sidebar with adjustable values',
optionSidebarWidthAdjustableOnlyAriaLabel: 'Expand sidebar with adjustable values',
optionSidebarWidthAdjustableOnlyHelpMessage:
'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.',
optionBothWidthAdjustable: 'Expand all with adjustable values',
optionBothWidthAdjustableAriaLabel: 'Expand all with adjustable values',
optionBothWidthAdjustableHelpMessage:
'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.',
optionOriginalWidth: 'Original width',
optionOriginalWidthAriaLabel: 'Original width',
optionOriginalWidthHelpMessage: 'The original layout width of the site',
contentLayoutMaxWidth: {
title: 'Content Layout Max Width',
titleAriaLabel: 'Content Layout Max Width',
titleHelpMessage:
'Adjust the exact value of the document content width of the site layout to adapt to different reading needs and screens.',
titleScreenNavWarningMessage:
'Content Layout Max Width is not available in mobile screen temporarily.',
slider: 'Adjust the maximum width of the content layout',
sliderAriaLabel: 'Adjust the maximum width of the content layout',
sliderHelpMessage:
'A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.',
},
pageLayoutMaxWidth: {
title: 'Page Layout Max Width',
titleAriaLabel: 'Page Layout Max Width',
titleHelpMessage:
'Adjust the exact value of the page width of the site layout to adapt to different reading needs and screens.',
titleScreenNavWarningMessage:
'Page Layout Max Width is not available in mobile screen temporarily.',
slider: 'Adjust the maximum width of the page layout',
sliderAriaLabel: 'Adjust the maximum width of the page layout',
sliderHelpMessage:
'A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.',
},
},
spotlight: {
title: 'Spotlight',
titleAriaLabel: 'Spotlight',
titleHelpMessage:
'Highlight the line where the mouse is currently hovering in the content to optimize for users who may have reading and focusing difficulties.',
titleScreenNavWarningMessage: 'Spotlight is not available in mobile screen temporarily.',
optionOn: 'On',
optionOnAriaLabel: 'On',
optionOnHelpMessage: 'Turn on Spotlight.',
optionOff: 'Off',
optionOffAriaLabel: 'Off',
optionOffHelpMessage: 'Turn off Spotlight.',
styles: {
title: 'Spotlight Styles',
titleAriaLabel: 'Spotlight Styles',
titleHelpMessage: 'Adjust the styles of Spotlight.',
titleScreenNavWarningMessage:
'Spotlight Styles is not available in mobile screen temporarily.',
optionUnder: 'Under',
optionUnderAriaLabel: 'Under',
optionUnderHelpMessage:
'Add a solid background color underneath the hovering element to highlight where the cursor is currently hovering.',
optionAside: 'Aside',
optionAsideAriaLabel: 'Aside',
optionAsideHelpMessage:
'Add a fixed line with solid color aside the hovering element to highlight where the cursor is currently hovering.',
},
},
};
7 changes: 7 additions & 0 deletions docs/.vitepress/theme/locales/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import en from './en';
import ru from './ru';

export const locales = {
en,
ru,
};
80 changes: 80 additions & 0 deletions docs/.vitepress/theme/locales/ru.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
export default {
title: {
title: 'Улучшенная читаемость',
titleAriaLabel: 'Улучшенная читаемость',
},
layoutSwitch: {
title: 'Макет',
titleHelpMessage:
'Настройте стиль оформления сайта в соответствии со своими потребностями и экраном.',
titleAriaLabel: 'Макет',
titleScreenNavWarningMessage: 'На мобильном экране переключатель макета недоступен.',
optionFullWidth: 'Полноэкранный',
optionFullWidthAriaLabel: 'Полноэкранный',
optionFullWidthHelpMessage:
'Растягивает боковую панель и область содержимого на всю ширину экрана.',
optionSidebarWidthAdjustableOnly: 'Боковая панель с настройкой',
optionSidebarWidthAdjustableOnlyAriaLabel: 'Боковая панель с настройкой',
optionSidebarWidthAdjustableOnlyHelpMessage:
'Добавляет ползунок для настройки желаемой ширины боковой панели. Ширина области контента останется прежней.',
optionBothWidthAdjustable: 'Полноэкранный с настройкой',
optionBothWidthAdjustableAriaLabel: 'Полноэкранный с настройкой',
optionBothWidthAdjustableHelpMessage:
'Добавляет ползунок для настройки желаемой ширины боковой панели или содержимого документа.',
optionOriginalWidth: 'Оригинальный',
optionOriginalWidthAriaLabel: 'Оригинальный',
optionOriginalWidthHelpMessage: 'Отображает страницу в соответствии с исходной шириной сайта.',
contentLayoutMaxWidth: {
title: 'Измените максимальную ширину содержимого',
titleAriaLabel: 'Измените максимальную ширину содержимого',
titleHelpMessage:
'Отрегулируйте точное значение ширины страницы макета сайта, чтобы адаптировать его к различным потребностям чтения и экранам.',
titleScreenNavWarningMessage:
'Максимальная ширина макета содержимого недоступна на экране мобильного устройства.',
slider: 'Отрегулируйте максимальную ширину содержимого',
sliderAriaLabel: 'Отрегулируйте максимальную ширину содержимого',
sliderHelpMessage:
'Ползунок с диапазоном значений, позволяющий пользователю выбирать и настраивать желаемую ширину или максимальную ширину макета контента.',
},
pageLayoutMaxWidth: {
title: 'Измените максимальную ширину страницы',
titleAriaLabel: 'Измените максимальную ширину страницы',
titleHelpMessage:
'Отрегулируйте точное значение ширины содержимого документа в макете сайта, чтобы адаптировать его к различным потребностям чтения и экранам.',
titleScreenNavWarningMessage:
'Максимальная ширина макета страницы недоступна на экране мобильного устройства.',
slider: 'Отрегулируйте максимальную ширину страницы',
sliderAriaLabel: 'Отрегулируйте максимальную ширину страницы',
sliderHelpMessage:
'Ползунок с диапазоном значений, позволяющий пользователю выбирать и настраивать желаемую ширину или максимальную ширину макета контента.',
},
},
spotlight: {
title: 'Фокус',
titleAriaLabel: 'Фокус',
titleHelpMessage:
'Выделите строку, в которой в данный момент находится курсор мыши, чтобы оптимизировать контент для пользователей, испытывающих трудности с чтением и фокусировкой.',
titleScreenNavWarningMessage: 'Фокусировка временно недоступна на экранах мобильных устройств.',
optionOn: 'Включить',
optionOnAriaLabel: 'Включить',
optionOnHelpMessage: 'Включает фокус.',
optionOff: 'Выключить',
optionOffAriaLabel: 'Выключить',
optionOffHelpMessage: 'Выключает фокус.',
styles: {
title: 'Стиль фокуса',
titleAriaLabel: 'Стиль фокуса',
titleHelpMessage: 'Выберите предпочитаемый стиль фокуса.',
titleScreenNavWarningMessage:
'Стили фокуса временно недоступны на экранах мобильных устройств.',
optionUnder: 'Фоновый',
optionUnderAriaLabel: 'Фоновый',
optionUnderHelpMessage:
'Выделяет блок текста, на который в данный момент наведён курсор, сплошным фоновым цветом.',
optionAside: 'Боковой',
optionAsideAriaLabel: 'Боковой',
optionAsideHelpMessage:
'Добавляет вертикальную линию рядом с блоком текста, на который в данный момент наведён курсор.',
},
},
};
4 changes: 4 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"devDependencies": {
"@nolebase/vitepress-plugin-enhanced-readabilities": "2.0.0-rc10",
"release-timeline": "^0.6.0",
"sass": "^1.75.0",
"vitepress": "^1.1.4",
Expand All @@ -9,5 +10,8 @@
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview"
},
"dependencies": {
"vitepress-plugin-comment-with-giscus": "^1.1.15"
}
}
Loading

0 comments on commit fa631d9

Please sign in to comment.