erudit 3.0.0-dev.17 → 3.0.0-dev.19

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.
Files changed (250) hide show
  1. package/app/app.vue +193 -191
  2. package/app/assets/icons/graduation.svg +3 -0
  3. package/app/components/Loading.vue +23 -23
  4. package/app/components/SiteAside.vue +393 -393
  5. package/app/components/SiteMain.vue +32 -32
  6. package/app/components/aside/AsideListItem.vue +74 -74
  7. package/app/components/aside/AsideMajor.vue +56 -56
  8. package/app/components/aside/AsideMinor.vue +97 -73
  9. package/app/components/aside/major/PaneContentScroll.vue +23 -23
  10. package/app/components/aside/major/PaneSwitch.vue +54 -54
  11. package/app/components/aside/major/PaneSwitchButton.vue +63 -63
  12. package/app/components/aside/major/SiteInfo.vue +85 -85
  13. package/app/components/aside/major/panes/Language.vue +79 -79
  14. package/app/components/aside/major/panes/Pages.vue +31 -34
  15. package/app/components/aside/major/panes/Search.vue +11 -11
  16. package/app/components/aside/major/panes/nav/Nav.vue +92 -92
  17. package/app/components/aside/major/panes/nav/NavBook.vue +95 -95
  18. package/app/components/aside/major/panes/nav/NavBookLoading.vue +24 -24
  19. package/app/components/aside/major/panes/nav/NavGlobal.vue +16 -16
  20. package/app/components/aside/major/panes/nav/fnav/FNav.vue +105 -105
  21. package/app/components/aside/major/panes/nav/fnav/FNavBook.vue +32 -32
  22. package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +40 -40
  23. package/app/components/aside/major/panes/nav/fnav/FNavFolder.vue +60 -60
  24. package/app/components/aside/major/panes/nav/fnav/FNavItem.vue +34 -34
  25. package/app/components/aside/major/panes/nav/fnav/FNavSeparator.vue +80 -80
  26. package/app/components/aside/major/panes/nav/fnav/FNavTopic.vue +24 -24
  27. package/app/components/aside/major/panes/other/ItemContent.vue +29 -29
  28. package/app/components/aside/major/panes/other/ItemGenerator.vue +13 -13
  29. package/app/components/aside/major/panes/other/ItemTheme.vue +54 -54
  30. package/app/components/aside/major/panes/other/Other.vue +16 -16
  31. package/app/components/aside/minor/{Contribute.vue → AsideMinorContribute.vue} +175 -145
  32. package/app/components/aside/minor/AsideMinorNews.vue +11 -11
  33. package/app/components/aside/minor/AsideMinorPane.vue +15 -15
  34. package/app/components/aside/minor/AsideMinorTopLink.vue +67 -67
  35. package/app/components/aside/minor/content/AsideMinorContent.vue +89 -92
  36. package/app/components/aside/minor/contributor/AsideMinorContributor.vue +78 -0
  37. package/app/components/aside/minor/contributor/BookContribution.vue +64 -0
  38. package/app/components/aside/minor/topic/AsideMinorTopic.vue +29 -32
  39. package/app/components/aside/minor/topic/TopicContributors.vue +177 -177
  40. package/app/components/aside/minor/topic/TopicNav.vue +49 -49
  41. package/app/components/aside/minor/topic/TopicToc.vue +213 -214
  42. package/app/components/aside/minor/topic/TopicTocItem.vue +32 -32
  43. package/app/components/aside/utils/AsideOverlayPane.vue +40 -40
  44. package/app/components/bitran/BitranContent.vue +90 -91
  45. package/app/components/bitran/RenderWrapper.vue +10 -10
  46. package/app/components/contributor/ContributorAvatar.vue +45 -45
  47. package/app/components/contributor/ContributorListItem.vue +35 -35
  48. package/app/components/main/MainBitranContent.vue +41 -0
  49. package/app/components/main/{utils/Breadcrumb.vue → MainBreadcrumb.vue} +67 -74
  50. package/app/components/main/MainDescription.vue +24 -0
  51. package/app/components/main/{utils/ContentTitle.vue → MainTitle.vue} +72 -63
  52. package/app/components/main/content/ContentBreadcrumb.vue +28 -0
  53. package/app/components/main/{utils → content}/ContentDecoration.vue +29 -29
  54. package/app/components/main/{utils → content}/ContentPopover.vue +188 -188
  55. package/app/components/main/{utils → content}/ContentPopovers.vue +111 -111
  56. package/app/components/main/{utils → content}/ContentReferences.vue +70 -70
  57. package/app/components/main/{utils → content}/ContentSection.vue +45 -45
  58. package/app/components/main/{utils → content}/reference/ReferenceGroup.vue +38 -38
  59. package/app/components/main/{utils → content}/reference/ReferenceItem.vue +70 -70
  60. package/app/components/main/{utils → content}/reference/ReferenceSource.vue +120 -120
  61. package/app/components/main/topic/MainTopic.vue +83 -88
  62. package/app/components/main/topic/TopicPartSwitch.vue +124 -118
  63. package/app/components/preview/Preview.vue +186 -186
  64. package/app/components/preview/PreviewDisplay.vue +139 -139
  65. package/app/components/preview/PreviewFooterAction.vue +73 -73
  66. package/app/components/preview/PreviewLoading.vue +14 -14
  67. package/app/components/preview/PreviewScreen.vue +141 -141
  68. package/app/components/preview/display/Alert.vue +50 -50
  69. package/app/components/preview/display/Custom.vue +18 -18
  70. package/app/components/preview/display/GenericLink.vue +48 -48
  71. package/app/components/preview/display/PageLink.vue +22 -22
  72. package/app/components/preview/display/Unique.vue +46 -55
  73. package/app/components/transition/Fade.vue +19 -19
  74. package/app/components/tree/TreeContainer.vue +11 -11
  75. package/app/components/tree/TreeItem.vue +89 -89
  76. package/app/composables/adsAllowed.ts +11 -0
  77. package/app/composables/bitran.ts +108 -108
  78. package/app/composables/bitranLocation.ts +7 -7
  79. package/app/composables/contentData.ts +38 -38
  80. package/app/composables/contentPage.ts +168 -158
  81. package/app/composables/contentRoute.ts +45 -45
  82. package/app/composables/darkMagic.ts +24 -24
  83. package/app/composables/externalApi.ts +69 -69
  84. package/app/composables/favicon.ts +8 -8
  85. package/app/composables/formatText.ts +99 -99
  86. package/app/composables/majorPane.ts +61 -60
  87. package/app/composables/phrases.ts +77 -65
  88. package/app/composables/theme.ts +29 -29
  89. package/app/composables/url.ts +33 -33
  90. package/app/pages/_test/preview.vue +110 -110
  91. package/app/pages/article/[...articleId].vue +3 -3
  92. package/app/pages/book/[...bookId].vue +42 -47
  93. package/app/pages/contributor/[contributorId].vue +225 -0
  94. package/app/pages/contributors.vue +183 -0
  95. package/app/pages/group/[...groupId].vue +58 -66
  96. package/app/pages/index.vue +32 -32
  97. package/app/pages/practice/[...practice].vue +3 -3
  98. package/app/pages/summary/[...summaryId].vue +3 -3
  99. package/app/plugins/analytics.ts +8 -0
  100. package/app/plugins/prerender.server.ts +22 -22
  101. package/app/scripts/_immediate.js +9 -9
  102. package/app/scripts/aside/index.ts +59 -59
  103. package/app/scripts/aside/major/nav.ts +26 -26
  104. package/app/scripts/aside/minor/state.ts +37 -37
  105. package/app/scripts/aside/minor/topic.ts +3 -3
  106. package/app/scripts/flag.ts +28 -28
  107. package/app/scripts/og.ts +27 -27
  108. package/app/scripts/preview/build.ts +76 -76
  109. package/app/scripts/preview/data/alert.ts +19 -19
  110. package/app/scripts/preview/data/custom.ts +8 -8
  111. package/app/scripts/preview/data/genericLink.ts +24 -24
  112. package/app/scripts/preview/data/pageLink.ts +23 -23
  113. package/app/scripts/preview/data/unique.ts +69 -72
  114. package/app/scripts/preview/data.ts +24 -24
  115. package/app/scripts/preview/display.ts +37 -37
  116. package/app/scripts/preview/footer.ts +9 -9
  117. package/app/scripts/preview/request.ts +51 -51
  118. package/app/scripts/preview/state.ts +63 -63
  119. package/app/styles/_immediate.css +7 -7
  120. package/app/styles/_util.scss +43 -43
  121. package/app/styles/_utils.scss +44 -44
  122. package/app/styles/app.scss +91 -91
  123. package/app/styles/def/_bp.scss +27 -27
  124. package/app/styles/def/_size.scss +7 -7
  125. package/app/styles/def/_z.scss +5 -5
  126. package/app/styles/normalize.scss +49 -49
  127. package/app/styles/partials/_darkMagic.scss +5 -5
  128. package/app/styles/partials/_fnav.scss +15 -15
  129. package/app/styles/partials/_preview.scss +5 -5
  130. package/bin/erudit.mjs +2 -2
  131. package/const.ts +4 -4
  132. package/globalPath.ts +21 -21
  133. package/globals/bitran.ts +1 -1
  134. package/globals/content.ts +27 -27
  135. package/globals/contributor.ts +5 -5
  136. package/globals/erudit.ts +5 -5
  137. package/globals/register.ts +18 -18
  138. package/languages/en.ts +103 -94
  139. package/languages/ru.ts +107 -98
  140. package/module/bitran.ts +66 -66
  141. package/module/config.ts +35 -35
  142. package/module/imports.ts +67 -67
  143. package/module/index.ts +47 -47
  144. package/module/logger.ts +10 -10
  145. package/module/paths.ts +22 -22
  146. package/module/restart.ts +61 -61
  147. package/nuxt.config.ts +131 -131
  148. package/package.json +5 -5
  149. package/server/api/aside/major/nav/bookIds.ts +5 -5
  150. package/server/api/aside/major/nav/bookNav/[...bookId].ts +17 -20
  151. package/server/api/aside/major/nav/global.ts +7 -7
  152. package/server/api/aside/minor/book/[...bookId].ts +18 -0
  153. package/server/api/aside/minor/contributor/[contributorId].ts +18 -0
  154. package/server/api/aside/minor/group/[...groupId].ts +18 -0
  155. package/server/api/aside/minor/news.ts +7 -7
  156. package/server/api/aside/minor/topic.ts +36 -0
  157. package/server/api/bitran/content/[...location].ts +13 -10
  158. package/server/api/bitran/toc/[...location].ts +9 -9
  159. package/server/api/content/data.ts +75 -75
  160. package/server/api/contributor/count.ts +6 -6
  161. package/server/api/contributor/list.ts +44 -0
  162. package/server/api/contributor/page/[contributorId].ts +14 -0
  163. package/server/api/fake/content.ts +11 -11
  164. package/server/api/fake/shared/languages.ts +12 -12
  165. package/server/api/language/functions.ts +12 -12
  166. package/server/api/language/phrase/[phraseId].ts +19 -19
  167. package/server/api/language/phraseIds.ts +8 -8
  168. package/server/api/prerender.ts +19 -120
  169. package/server/api/preview/page/[...parts].ts +78 -78
  170. package/server/api/preview/unique/[...location].ts +48 -61
  171. package/server/plugin/bitran/content.ts +252 -190
  172. package/server/plugin/bitran/elements/include.ts +229 -229
  173. package/server/plugin/bitran/location.ts +43 -39
  174. package/server/plugin/bitran/toc.ts +94 -94
  175. package/server/plugin/bitran/transpiler.ts +18 -18
  176. package/server/plugin/build/close.ts +12 -12
  177. package/server/plugin/build/jobs/content/builderArgs.ts +8 -8
  178. package/server/plugin/build/jobs/content/generic.ts +191 -191
  179. package/server/plugin/build/jobs/content/parse.ts +113 -113
  180. package/server/plugin/build/jobs/content/path.ts +6 -6
  181. package/server/plugin/build/jobs/content/type/book.ts +9 -9
  182. package/server/plugin/build/jobs/content/type/group.ts +37 -37
  183. package/server/plugin/build/jobs/content/type/topic.ts +36 -36
  184. package/server/plugin/build/jobs/contributors.ts +69 -66
  185. package/server/plugin/build/jobs/language.ts +36 -36
  186. package/server/plugin/build/jobs/nav.ts +345 -345
  187. package/server/plugin/build/process.ts +32 -32
  188. package/server/plugin/build/rebuild.ts +66 -66
  189. package/server/plugin/build/setup.ts +19 -19
  190. package/server/plugin/content/context.ts +119 -119
  191. package/server/plugin/db/entities/Book.ts +7 -7
  192. package/server/plugin/db/entities/Content.ts +45 -45
  193. package/server/plugin/db/entities/Contribution.ts +10 -10
  194. package/server/plugin/db/entities/Contributor.ts +25 -16
  195. package/server/plugin/db/entities/File.ts +10 -10
  196. package/server/plugin/db/entities/Group.ts +14 -14
  197. package/server/plugin/db/entities/Hash.ts +15 -15
  198. package/server/plugin/db/entities/Topic.ts +20 -20
  199. package/server/plugin/db/entities/Unique.ts +21 -21
  200. package/server/plugin/db/reset.ts +12 -12
  201. package/server/plugin/db/setup.ts +49 -49
  202. package/server/plugin/global.ts +16 -16
  203. package/server/plugin/importer.ts +16 -16
  204. package/server/plugin/index.ts +9 -9
  205. package/server/plugin/logger.ts +23 -23
  206. package/server/plugin/nav/node.ts +27 -27
  207. package/server/plugin/nav/utils.ts +179 -175
  208. package/server/plugin/repository/asideMinor.ts +51 -0
  209. package/server/plugin/repository/book.ts +39 -21
  210. package/server/plugin/repository/content.ts +240 -240
  211. package/server/plugin/repository/contentId.ts +40 -40
  212. package/server/plugin/repository/contributor.ts +98 -8
  213. package/server/plugin/repository/file.ts +10 -10
  214. package/server/plugin/repository/frontNav.ts +145 -145
  215. package/server/plugin/repository/topic.ts +35 -35
  216. package/server/tsconfig.json +9 -9
  217. package/shared/aside/minor.ts +55 -51
  218. package/shared/asset.ts +22 -22
  219. package/shared/bitran/content.ts +9 -0
  220. package/shared/bitran/contentId.ts +56 -56
  221. package/shared/bitran/toc.ts +8 -8
  222. package/shared/breadcrumb.ts +7 -0
  223. package/shared/content/bookId.ts +12 -12
  224. package/shared/content/context.ts +9 -9
  225. package/shared/content/data/base.ts +32 -32
  226. package/shared/content/data/index.ts +5 -5
  227. package/shared/content/data/type/book.ts +5 -5
  228. package/shared/content/data/type/group.ts +6 -6
  229. package/shared/content/data/type/topic.ts +11 -11
  230. package/shared/content/previousNext.ts +9 -9
  231. package/shared/contributor.ts +33 -5
  232. package/shared/frontNav.ts +41 -41
  233. package/shared/icons.ts +38 -38
  234. package/shared/image.ts +5 -5
  235. package/shared/link.ts +28 -28
  236. package/shared/popover.ts +8 -8
  237. package/shared/types/language.ts +79 -74
  238. package/shared/utils/objectsEqual.ts +4 -4
  239. package/shared/utils/stringColor.ts +9 -9
  240. package/test/contentId.test.ts +91 -91
  241. package/tsconfig.json +8 -8
  242. package/utils/contentPath.ts +67 -67
  243. package/utils/slash.ts +11 -11
  244. package/utils/stress.ts +9 -9
  245. package/app/components/aside/minor/AsideMinorContributor.vue +0 -5
  246. package/app/components/main/utils/ContentDescription.vue +0 -19
  247. package/app/composables/bitranContent.ts +0 -92
  248. package/app/pages/members.vue +0 -6
  249. package/server/api/aside/minor/path.ts +0 -82
  250. package/shared/bitran/stringContent.ts +0 -6
@@ -1,18 +1,18 @@
1
- import * as erudit from './erudit';
2
- import * as contributor from './contributor';
3
- import * as bitran from './bitran';
4
- import * as content from './content';
5
- import * as asset from '@shared/asset';
6
-
7
- export function registerGlobals() {
8
- for (const [key, value] of Object.entries({
9
- ...erudit,
10
- ...contributor,
11
- ...bitran,
12
- ...content,
13
- ...asset,
14
- })) {
15
- // @ts-ignore
16
- globalThis[key] = value;
17
- }
18
- }
1
+ import * as erudit from './erudit';
2
+ import * as contributor from './contributor';
3
+ import * as bitran from './bitran';
4
+ import * as content from './content';
5
+ import * as asset from '@shared/asset';
6
+
7
+ export function registerGlobals() {
8
+ for (const [key, value] of Object.entries({
9
+ ...erudit,
10
+ ...contributor,
11
+ ...bitran,
12
+ ...content,
13
+ ...asset,
14
+ })) {
15
+ // @ts-ignore
16
+ globalThis[key] = value;
17
+ }
18
+ }
package/languages/en.ts CHANGED
@@ -1,94 +1,103 @@
1
- const english: EruditPhrases = {
2
- _language_title: 'English',
3
- _language_code: 'en',
4
-
5
- site_info_title: 'Erudit',
6
- site_info_slogan: 'Modern textbook',
7
- seo_index_title: 'Erudit - CMS for eductional sites',
8
- seo_index_description:
9
- 'Erudit is a CMS for creating and managing perfect educational sites, maintained by the community.',
10
- seo_article_description: (contentTitle) =>
11
- `Clear and interesting explanation of the topic "${contentTitle}". Illustrative examples, important properties, interesting facts, life applications, clear proofs. Here you will definitely understand the topic!`,
12
- seo_summary_description: (contentTitle) =>
13
- `Summary of the topic "${contentTitle}": key definitions, theorems, properties and examples of their use. All the most important things in a concise form!`,
14
- seo_practice_description: (contentTitle) =>
15
- `Various problems with hints and answers on the topic "${contentTitle}". Interesting conditions, hints and detailed solutions. Turn knowledge into a skill!`,
16
- index: 'Index',
17
- pages: 'Pages',
18
- search: 'Search',
19
- language: 'Language',
20
- other: 'Other',
21
- ads_replacer:
22
- 'Help us develop the project.<br><strong>Disable your ads blocker!</strong>',
23
- theme: 'Theme',
24
- theme_system: 'System',
25
- theme_light: 'Light',
26
- theme_dark: 'Dark',
27
- content: 'Content',
28
- main_page: 'Main page',
29
- members: 'Members',
30
- add_translation: 'Add translation',
31
- empty_nav: 'Empty navigation',
32
- flag_dev: 'Development',
33
- flag_dev_description:
34
- 'This material is in development! It may change in the future and even contain errors!',
35
- flag_advanced: 'Advanced',
36
- flag_advanced_description:
37
- 'This material is for learners with a high level of knowledge. It contains information that is not suitable for beginners!',
38
- flag_secondary: 'Additional',
39
- flag_secondary_description:
40
- 'This is an optional material is for learners who want to dive deeper and gain additional knowledge and context.',
41
- popover_dependencies: 'Dependencies',
42
- popover_dependencies_description:
43
- 'There is no royal way into this topic! You can only figure it out if you know the following topics:',
44
- to_index: 'To index',
45
- about_book: 'About book',
46
- close: 'Close',
47
- back: 'Back',
48
- goto: 'Go to',
49
- error: 'Error!',
50
- external_link: 'External link',
51
- external_link_warn: 'You are going to visit external resource!',
52
- internal_link: 'Internal link',
53
- internal_link_warn: 'You are going to visit internal site page!',
54
- book: 'Book',
55
- group: 'Group',
56
- topic: 'Topic',
57
- article: 'Article',
58
- summary: 'Summary',
59
- practice: 'Practice',
60
- contributor: 'Contributor',
61
- element_id: 'Element ID',
62
- preview_missing_title: 'Element not found!',
63
- preview_missing_explain: `Can't find the element with specified ID in this page!<br>Perhaps the element ID is specified incorrectly or the element has been changed/deleted.`,
64
- preview_missing_explain_mismatch: `Can't find the element with specified ID in this page!<br>The version of the linked page is different from the current version of the page!<br>This is most likely the cause of the error.`,
65
- preview_hash_mismatch_title: 'Page version mismatch!',
66
- preview_hash_mismatch_explain:
67
- 'The version of the page you see now is different from the version of the page the original link led to!<br>The content may be different from what you expected to see.',
68
- current_page_hash: 'Current hash',
69
- expected_page_hash: 'Expected hash',
70
- empty_toc: 'Empty table of contents...',
71
- contributors: 'Contributors',
72
- no_contributors: 'No contributors...',
73
- make_contribution: 'Make a contribution',
74
- material_improvement: 'Material improvement',
75
- how_to_improve: 'How to improve?',
76
- edit_page: 'Edit page',
77
- report_problem: 'Report a problem',
78
- references: 'References',
79
- reference_source_featured: 'Featured source',
80
- references_description:
81
- 'List of external sources that were used in writing this material. For a deeper dive into the material, it is recommended to read them in more detail, especially the featured sources, which are marked with an asterisk:',
82
- };
83
-
84
- export default english;
85
-
86
- export function m(
87
- number: number,
88
- one: string,
89
- few: string,
90
- includeNumber = true,
91
- ) {
92
- const text = number === 1 ? one : few;
93
- return includeNumber ? `${number} ${text}` : text;
94
- }
1
+ const english: EruditPhrases = {
2
+ _language_title: 'English',
3
+ _language_code: 'en',
4
+
5
+ site_info_title: 'Erudit',
6
+ site_info_slogan: 'Modern textbook',
7
+ seo_index_title: 'Erudit - CMS for eductional sites',
8
+ seo_index_description:
9
+ 'Erudit is a CMS for creating and managing perfect educational sites, maintained by the community.',
10
+ seo_article_description: (contentTitle) =>
11
+ `Clear and interesting explanation of the topic "${contentTitle}". Illustrative examples, important properties, interesting facts, life applications, clear proofs. Here you will definitely understand the topic!`,
12
+ seo_summary_description: (contentTitle) =>
13
+ `Summary of the topic "${contentTitle}": key definitions, theorems, properties and examples of their use. All the most important things in a concise form!`,
14
+ seo_practice_description: (contentTitle) =>
15
+ `Various problems with hints and answers on the topic "${contentTitle}". Interesting conditions, hints and detailed solutions. Turn knowledge into a skill!`,
16
+ index: 'Index',
17
+ pages: 'Pages',
18
+ search: 'Search',
19
+ language: 'Language',
20
+ other: 'Other',
21
+ ads_replacer:
22
+ 'Help us develop the project.<br><strong>Disable your ads blocker!</strong>',
23
+ theme: 'Theme',
24
+ theme_system: 'System',
25
+ theme_light: 'Light',
26
+ theme_dark: 'Dark',
27
+ content: 'Content',
28
+ main_page: 'Main page',
29
+ contributors: 'Contributors',
30
+ contributors_page_description:
31
+ 'List of people who contributed to the project materials: suggested valuable ideas, made corrections to existing material or wrote their own!',
32
+ contributors_page_invite: (link) =>
33
+ `You can also help the project, <a href="${link}" target="_blank">make a contribution</a> and get on this page!`,
34
+ contributor: 'Contributor',
35
+ contribution: 'Contribution',
36
+ contributions_explain: (count) =>
37
+ `Contributed to ${m(count, 'material', 'materials')}`,
38
+ contributor_description: (name) =>
39
+ `Page with information about the contributor "${name}" and his contribution to the project.`,
40
+ editor: 'Editor',
41
+ add_translation: 'Add translation',
42
+ empty_nav: 'Empty navigation',
43
+ flag_dev: 'Development',
44
+ flag_dev_description:
45
+ 'This material is in development! It may change in the future and even contain errors!',
46
+ flag_advanced: 'Advanced',
47
+ flag_advanced_description:
48
+ 'This material is for learners with a high level of knowledge. It contains information that is not suitable for beginners!',
49
+ flag_secondary: 'Additional',
50
+ flag_secondary_description:
51
+ 'This is an optional material is for learners who want to dive deeper and gain additional knowledge and context.',
52
+ popover_dependencies: 'Dependencies',
53
+ popover_dependencies_description:
54
+ 'There is no royal way into this topic! You can only figure it out if you know the following topics:',
55
+ to_index: 'To index',
56
+ about_book: 'About book',
57
+ close: 'Close',
58
+ back: 'Back',
59
+ goto: 'Go to',
60
+ error: 'Error!',
61
+ external_link: 'External link',
62
+ external_link_warn: 'You are going to visit external resource!',
63
+ internal_link: 'Internal link',
64
+ internal_link_warn: 'You are going to visit internal site page!',
65
+ book: 'Book',
66
+ group: 'Group',
67
+ topic: 'Topic',
68
+ article: 'Article',
69
+ summary: 'Summary',
70
+ practice: 'Practice',
71
+ element_id: 'Element ID',
72
+ preview_missing_title: 'Element not found!',
73
+ preview_missing_explain: `Can't find the element with specified ID in this page!<br>Perhaps the element ID is specified incorrectly or the element has been changed/deleted.`,
74
+ preview_missing_explain_mismatch: `Can't find the element with specified ID in this page!<br>The version of the linked page is different from the current version of the page!<br>This is most likely the cause of the error.`,
75
+ preview_hash_mismatch_title: 'Page version mismatch!',
76
+ preview_hash_mismatch_explain:
77
+ 'The version of the page you see now is different from the version of the page the original link led to!<br>The content may be different from what you expected to see.',
78
+ current_page_hash: 'Current hash',
79
+ expected_page_hash: 'Expected hash',
80
+ empty_toc: 'Empty table of contents...',
81
+ no_contributors: 'No contributors...',
82
+ make_contribution: 'Make a contribution',
83
+ material_improvement: 'Material improvement',
84
+ how_to_improve: 'How to improve?',
85
+ edit_page: 'Edit page',
86
+ report_problem: 'Report a problem',
87
+ references: 'References',
88
+ reference_source_featured: 'Featured source',
89
+ references_description:
90
+ 'List of external sources that were used in writing this material. For a deeper dive into the material, it is recommended to read them in more detail, especially the featured sources, which are marked with an asterisk:',
91
+ };
92
+
93
+ export default english;
94
+
95
+ export function m(
96
+ number: number,
97
+ one: string,
98
+ few: string,
99
+ includeNumber = true,
100
+ ) {
101
+ const text = number === 1 ? one : few;
102
+ return includeNumber ? `${number} ${text}` : text;
103
+ }
package/languages/ru.ts CHANGED
@@ -1,98 +1,107 @@
1
- const russian: EruditPhrases = {
2
- _language_title: 'Русский',
3
- _language_code: 'ru',
4
-
5
- site_info_title: 'Erudit',
6
- site_info_slogan: 'Современный учебник',
7
- seo_index_title: 'Erudit - CMS для образовательных сайтов',
8
- seo_index_description:
9
- 'Erudit — CMS для создания и управления идеальными образовательными сайтами, которые поддерживаются сообществом.',
10
- seo_article_description: (contentTitle) =>
11
- `Понятное и интересное объяснение темы «${contentTitle}». Показательные примеры, важные свойства, интересные факты, применение в жизни, понятные доказательства. Здесь вы точно разберетесь!`,
12
- seo_summary_description: (contentTitle) =>
13
- `Конспект темы «${contentTitle}»: ключевые определения, теоремы, свойства и примеры их использвания. Все самое важное и в кратком виде!`,
14
- seo_practice_description: (contentTitle) =>
15
- `Разнообразные задачи с подсказками и ответами по теме «${contentTitle}». Интересные условия, подсказки и подробные решения. Превратите знания в навык!`,
16
- index: 'Оглавление',
17
- pages: 'Страницы',
18
- search: 'Поиск',
19
- language: 'Язык',
20
- other: 'Другое',
21
- ads_replacer:
22
- 'Помогите улучшать проект.<br><strong>Включите показ рекламы!</strong>',
23
- theme: 'Тема',
24
- theme_system: 'Системная',
25
- theme_light: 'Светлая',
26
- theme_dark: 'Темная',
27
- content: 'Контент',
28
- main_page: 'Главная страница',
29
- members: 'Участники',
30
- add_translation: 'Добавить перевод',
31
- empty_nav: 'Пустая навигация',
32
- flag_dev: 'Разработка',
33
- flag_dev_description:
34
- 'Этот материал в разработке! Он может измениться в будущем и даже содержать ошибки!',
35
- flag_advanced: 'Профиль',
36
- flag_advanced_description:
37
- 'Этот материал предназначен для учеников с высоким уровнем понимания предмета. Информация здесь не предназначена для новичокв!',
38
- flag_secondary: 'Дополнение',
39
- flag_secondary_description:
40
- 'Это дополнительный материал для тех, кто хочет глубже погрузиться предмет и получить дополнительные знания и контекст.',
41
- popover_dependencies: 'Зависимости',
42
- popover_dependencies_description:
43
- 'Царского пути в эту тему нет! Вы сможете разобраться только если знаете следующие темы:',
44
- to_index: 'К оглавлению',
45
- about_book: 'Об учебнике',
46
- close: 'Закрыть',
47
- back: 'Назад',
48
- goto: 'Перейти',
49
- error: 'Ошибка!',
50
- external_link: 'Внешняя ссылка',
51
- external_link_warn: 'Вы собираетесь перейти на внешний ресурс!',
52
- internal_link: 'Внутренняя ссылка',
53
- internal_link_warn: 'Вы собираетесь перейти на внутреннюю страницу сайта!',
54
- book: 'Книга',
55
- group: 'Группа',
56
- topic: 'Тема',
57
- article: 'Статья',
58
- summary: 'Конспект',
59
- practice: 'Задачи',
60
- contributor: 'Автор',
61
- element_id: 'ID элемента',
62
- preview_missing_title: 'Элемент не найден!',
63
- preview_missing_explain:
64
- 'Не удалось найти на этой странице элемент с указанным ID!<br>Возможно, ID элемента указан неправильно или элемент был изменен/удален.',
65
- preview_missing_explain_mismatch: `Не удалось найти на этой странице элемент с указанным ID!<br>Версия страницы, на которую вела ссылка, отличается от текущей версии страницы!<br>Скорее всего, именно это и является причиной ошибки.`,
66
- preview_hash_mismatch_title: 'Несовпадение версий страницы!',
67
- preview_hash_mismatch_explain:
68
- 'Версия страницы, которую вы видите сейчас отличается от версии страницы, на которую вела исходная ссылка!<br>Содержимое может отличаться от того, что вы ожидали увидеть.',
69
- current_page_hash: 'Текущий хеш',
70
- expected_page_hash: 'Ожидаемый хеш',
71
- empty_toc: 'Пустая таблица содержимого...',
72
- contributors: 'Авторы',
73
- no_contributors: 'Авторов нет...',
74
- make_contribution: 'Внести свой вклад',
75
- material_improvement: 'Улучшение материала',
76
- how_to_improve: 'Как улучшить?',
77
- edit_page: 'Редактировать страницу',
78
- report_problem: 'Сообщить о проблеме',
79
- references: 'Источники',
80
- reference_source_featured: 'Избранный источник',
81
- references_description:
82
- 'Список внешних источников, которые использовались при написании этого материала. Для более глубокого погружения в материал рекомендуются ознакомиться с ними подробнее, особенно с избранными источниками, которые отмечены звездочкой:',
83
- };
84
-
85
- export default russian;
86
-
87
- export function m(
88
- number: number,
89
- one: string,
90
- two: string,
91
- five: string,
92
- includeNumber = true,
93
- ) {
94
- const text = [five, one, two, two, two, five][
95
- number % 100 > 10 && number % 100 < 20 ? 0 : Math.min(number % 10, 5)
96
- ];
97
- return includeNumber ? `${number} ${text}` : text;
98
- }
1
+ const russian: EruditPhrases = {
2
+ _language_title: 'Русский',
3
+ _language_code: 'ru',
4
+
5
+ site_info_title: 'Erudit',
6
+ site_info_slogan: 'Современный учебник',
7
+ seo_index_title: 'Erudit - CMS для образовательных сайтов',
8
+ seo_index_description:
9
+ 'Erudit — CMS для создания и управления идеальными образовательными сайтами, которые поддерживаются сообществом.',
10
+ seo_article_description: (contentTitle) =>
11
+ `Понятное и интересное объяснение темы «${contentTitle}». Показательные примеры, важные свойства, интересные факты, применение в жизни, понятные доказательства. Здесь вы точно разберетесь!`,
12
+ seo_summary_description: (contentTitle) =>
13
+ `Конспект темы «${contentTitle}»: ключевые определения, теоремы, свойства и примеры их использвания. Все самое важное и в кратком виде!`,
14
+ seo_practice_description: (contentTitle) =>
15
+ `Разнообразные задачи с подсказками и ответами по теме «${contentTitle}». Интересные условия, подсказки и подробные решения. Превратите знания в навык!`,
16
+ index: 'Оглавление',
17
+ pages: 'Страницы',
18
+ search: 'Поиск',
19
+ language: 'Язык',
20
+ other: 'Другое',
21
+ ads_replacer:
22
+ 'Помогите улучшать проект.<br><strong>Включите показ рекламы!</strong>',
23
+ theme: 'Тема',
24
+ theme_system: 'Системная',
25
+ theme_light: 'Светлая',
26
+ theme_dark: 'Темная',
27
+ content: 'Контент',
28
+ main_page: 'Главная страница',
29
+ contributors: 'Авторы',
30
+ contributors_page_description:
31
+ 'Список людей, которые внесли вклад в материалы проекта: предложили ценные идеи, вносили корректировки в существующий материал или же написали собственный!',
32
+ contributors_page_invite: (link) =>
33
+ `Вы тоже можете помочь проекту, <a href="${link}" target="_blank">внести свой вклад</a> и попасть на эту страницу!`,
34
+ contributor: 'Автор',
35
+ contribution: 'Вклад',
36
+ contributions_explain: (count) =>
37
+ `Вклад в ${m(count, 'материал', 'материала', 'материалов')}`,
38
+ contributor_description: (name) =>
39
+ `Страница с информацией о авторе "${name}" и его вкладе в проект.`,
40
+ editor: 'Редактор',
41
+ add_translation: 'Добавить перевод',
42
+ empty_nav: 'Пустая навигация',
43
+ flag_dev: 'Разработка',
44
+ flag_dev_description:
45
+ 'Этот материал в разработке! Он может измениться в будущем и даже содержать ошибки!',
46
+ flag_advanced: 'Профиль',
47
+ flag_advanced_description:
48
+ 'Этот материал предназначен для учеников с высоким уровнем понимания предмета. Информация здесь не предназначена для новичокв!',
49
+ flag_secondary: 'Дополнение',
50
+ flag_secondary_description:
51
+ 'Это дополнительный материал для тех, кто хочет глубже погрузиться предмет и получить дополнительные знания и контекст.',
52
+ popover_dependencies: 'Зависимости',
53
+ popover_dependencies_description:
54
+ 'Царского пути в эту тему нет! Вы сможете разобраться только если знаете следующие темы:',
55
+ to_index: 'К оглавлению',
56
+ about_book: 'Об учебнике',
57
+ close: 'Закрыть',
58
+ back: 'Назад',
59
+ goto: 'Перейти',
60
+ error: 'Ошибка!',
61
+ external_link: 'Внешняя ссылка',
62
+ external_link_warn: 'Вы собираетесь перейти на внешний ресурс!',
63
+ internal_link: 'Внутренняя ссылка',
64
+ internal_link_warn: 'Вы собираетесь перейти на внутреннюю страницу сайта!',
65
+ book: 'Книга',
66
+ group: 'Группа',
67
+ topic: 'Тема',
68
+ article: 'Статья',
69
+ summary: 'Конспект',
70
+ practice: 'Задачи',
71
+ element_id: 'ID элемента',
72
+ preview_missing_title: 'Элемент не найден!',
73
+ preview_missing_explain:
74
+ 'Не удалось найти на этой странице элемент с указанным ID!<br>Возможно, ID элемента указан неправильно или элемент был изменен/удален.',
75
+ preview_missing_explain_mismatch: `Не удалось найти на этой странице элемент с указанным ID!<br>Версия страницы, на которую вела ссылка, отличается от текущей версии страницы!<br>Скорее всего, именно это и является причиной ошибки.`,
76
+ preview_hash_mismatch_title: 'Несовпадение версий страницы!',
77
+ preview_hash_mismatch_explain:
78
+ 'Версия страницы, которую вы видите сейчас отличается от версии страницы, на которую вела исходная ссылка!<br>Содержимое может отличаться от того, что вы ожидали увидеть.',
79
+ current_page_hash: 'Текущий хеш',
80
+ expected_page_hash: 'Ожидаемый хеш',
81
+ empty_toc: 'Пустая таблица содержимого...',
82
+ no_contributors: 'Авторов нет...',
83
+ make_contribution: 'Внести свой вклад',
84
+ material_improvement: 'Улучшение материала',
85
+ how_to_improve: 'Как улучшить?',
86
+ edit_page: 'Редактировать страницу',
87
+ report_problem: 'Сообщить о проблеме',
88
+ references: 'Источники',
89
+ reference_source_featured: 'Избранный источник',
90
+ references_description:
91
+ 'Список внешних источников, которые использовались при написании этого материала. Для более глубокого погружения в материал рекомендуются ознакомиться с ними подробнее, особенно с избранными источниками, которые отмечены звездочкой:',
92
+ };
93
+
94
+ export default russian;
95
+
96
+ export function m(
97
+ number: number,
98
+ one: string,
99
+ two: string,
100
+ five: string,
101
+ includeNumber = true,
102
+ ) {
103
+ const text = [five, one, two, two, two, five][
104
+ number % 100 > 10 && number % 100 < 20 ? 0 : Math.min(number % 10, 5)
105
+ ];
106
+ return includeNumber ? `${number} ${text}` : text;
107
+ }
package/module/bitran.ts CHANGED
@@ -1,66 +1,66 @@
1
- import { globSync } from 'glob';
2
- import { addTemplate } from 'nuxt/kit';
3
- import type { Nuxt } from 'nuxt/schema';
4
-
5
- import { eruditEndNuxtPath, projectPath } from '@erudit/globalPath';
6
- import { logger } from '@erudit/module/logger';
7
-
8
- export async function setupBitranTemplates(_nuxt: Nuxt) {
9
- const serverConfigPath = projectPath('bitran.server');
10
- const appConfigPath = projectPath('bitran.app');
11
-
12
- const hasServerConfig = globSync(serverConfigPath + '.*').length > 0;
13
- const hasAppConfig = globSync(appConfigPath + '.*').length > 0;
14
- const hasIncompleteBitranConfig = hasServerConfig !== hasAppConfig;
15
-
16
- if (hasIncompleteBitranConfig) {
17
- logger.warn(
18
- `Failed to load Bitran. Make sure you have "bitran.server" and "bitran.app" files in your project root!`,
19
- );
20
- }
21
-
22
- const serverTemplateName = '#erudit/bitran/server.ts';
23
- const appTemplateName = '#erudit/bitran/app.ts';
24
-
25
- addTemplate({
26
- filename: serverTemplateName,
27
- write: true,
28
- getContents: () => `
29
- import type { ElementTranspilers } from '@bitran-js/transpiler';
30
- import { eruditTranspilers } from '@erudit-js/bitran-elements/defaultServer';
31
- ${hasServerConfig ? `import getProjectTranspilers from '${serverConfigPath}';` : ''}
32
-
33
- export default async function() {
34
- const projectTranspilers = ${hasServerConfig ? 'await getProjectTranspilers()' : '{}'};
35
- return {
36
- ...eruditTranspilers,
37
- ...projectTranspilers,
38
- } as ElementTranspilers;
39
- }
40
- `,
41
- });
42
-
43
- addTemplate({
44
- filename: appTemplateName,
45
- write: true,
46
- getContents: () => `
47
- import type { EruditBitranElements } from '@erudit-js/cog/schema';
48
- import { eruditElements } from '@erudit-js/bitran-elements/defaultApp';
49
- ${hasAppConfig ? `import getProjectElements from '${appConfigPath}';` : ''}
50
-
51
- export default async function() {
52
- const projectElements = ${hasAppConfig ? 'await getProjectElements()' : '{}'};
53
- return {
54
- ...eruditElements,
55
- ...projectElements,
56
- } as EruditBitranElements;
57
- }
58
- `,
59
- });
60
-
61
- const alias = (_nuxt.options.alias ||= {});
62
- alias['#erudit/bitran/server'] = eruditEndNuxtPath(
63
- `.nuxt/${serverTemplateName}`,
64
- );
65
- alias['#erudit/bitran/app'] = eruditEndNuxtPath(`.nuxt/${appTemplateName}`);
66
- }
1
+ import { globSync } from 'glob';
2
+ import { addTemplate } from 'nuxt/kit';
3
+ import type { Nuxt } from 'nuxt/schema';
4
+
5
+ import { eruditEndNuxtPath, projectPath } from '@erudit/globalPath';
6
+ import { logger } from '@erudit/module/logger';
7
+
8
+ export async function setupBitranTemplates(_nuxt: Nuxt) {
9
+ const serverConfigPath = projectPath('bitran.server');
10
+ const appConfigPath = projectPath('bitran.app');
11
+
12
+ const hasServerConfig = globSync(serverConfigPath + '.*').length > 0;
13
+ const hasAppConfig = globSync(appConfigPath + '.*').length > 0;
14
+ const hasIncompleteBitranConfig = hasServerConfig !== hasAppConfig;
15
+
16
+ if (hasIncompleteBitranConfig) {
17
+ logger.warn(
18
+ `Failed to load Bitran. Make sure you have "bitran.server" and "bitran.app" files in your project root!`,
19
+ );
20
+ }
21
+
22
+ const serverTemplateName = '#erudit/bitran/server.ts';
23
+ const appTemplateName = '#erudit/bitran/app.ts';
24
+
25
+ addTemplate({
26
+ filename: serverTemplateName,
27
+ write: true,
28
+ getContents: () => `
29
+ import type { ElementTranspilers } from '@bitran-js/transpiler';
30
+ import { eruditTranspilers } from '@erudit-js/bitran-elements/defaultServer';
31
+ ${hasServerConfig ? `import getProjectTranspilers from '${serverConfigPath}';` : ''}
32
+
33
+ export default async function() {
34
+ const projectTranspilers = ${hasServerConfig ? 'await getProjectTranspilers()' : '{}'};
35
+ return {
36
+ ...eruditTranspilers,
37
+ ...projectTranspilers,
38
+ } as ElementTranspilers;
39
+ }
40
+ `,
41
+ });
42
+
43
+ addTemplate({
44
+ filename: appTemplateName,
45
+ write: true,
46
+ getContents: () => `
47
+ import type { EruditBitranElements } from '@erudit-js/cog/schema';
48
+ import { eruditElements } from '@erudit-js/bitran-elements/defaultApp';
49
+ ${hasAppConfig ? `import getProjectElements from '${appConfigPath}';` : ''}
50
+
51
+ export default async function() {
52
+ const projectElements = ${hasAppConfig ? 'await getProjectElements()' : '{}'};
53
+ return {
54
+ ...eruditElements,
55
+ ...projectElements,
56
+ } as EruditBitranElements;
57
+ }
58
+ `,
59
+ });
60
+
61
+ const alias = (_nuxt.options.alias ||= {});
62
+ alias['#erudit/bitran/server'] = eruditEndNuxtPath(
63
+ `.nuxt/${serverTemplateName}`,
64
+ );
65
+ alias['#erudit/bitran/app'] = eruditEndNuxtPath(`.nuxt/${appTemplateName}`);
66
+ }