@diplodoc/cli-tests 5.15.3 → 5.15.5

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.
@@ -622,6 +622,86 @@ path: toc.yaml
622
622
  "
623
623
  `;
624
624
 
625
+ exports[`Translate command > compose openapi spec files > filelist 1`] = `
626
+ "[
627
+ "openapi-spec.yaml",
628
+ "toc.yaml"
629
+ ]"
630
+ `;
631
+
632
+ exports[`Translate command > compose openapi spec files 1`] = `
633
+ "openapi: 3.0.1
634
+ info:
635
+ title: Перевод 1
636
+ version: v0
637
+ servers:
638
+ - url: http://localhost:8080
639
+ description: Перевод 2
640
+ paths:
641
+ /test:
642
+ get:
643
+ tags:
644
+ - Перевод 3
645
+ summary: Перевод 4
646
+ description: Перевод 5
647
+ operationId: getWithPayloadResponse
648
+ responses:
649
+ '200':
650
+ description: Перевод 6
651
+ content:
652
+ application/json:
653
+ schema:
654
+ type: object
655
+ properties:
656
+ A:
657
+ type: string
658
+ description: |
659
+ Перевод 7
660
+ - Перевод 8
661
+ - Перевод 9
662
+ - Перевод 10
663
+ components:
664
+ schemas:
665
+ RecurceTop:
666
+ type: object
667
+ properties:
668
+ A:
669
+ type: string
670
+ description: |
671
+ Перевод 7
672
+ - Перевод 8
673
+ - Перевод 9
674
+ - Перевод 10
675
+ RecurceMiddle:
676
+ type: object
677
+ properties:
678
+ B:
679
+ type: array
680
+ items:
681
+ type: object
682
+ properties:
683
+ A:
684
+ type: string
685
+ description: |
686
+ Перевод 7
687
+ - Перевод 8
688
+ - Перевод 9
689
+ - Перевод 10
690
+ "
691
+ `;
692
+
693
+ exports[`Translate command > compose openapi spec files 2`] = `
694
+ "items:
695
+ - name: Перевод 1
696
+ include:
697
+ path: openapi
698
+ includers:
699
+ - name: openapi
700
+ input: openapi-spec.yaml
701
+ mode: link
702
+ "
703
+ `;
704
+
625
705
  exports[`Translate command > do not filter files on extract > filelist 1`] = `
626
706
  "[
627
707
  "es/_includes/test.md.skl",
@@ -862,6 +942,135 @@ exports[`Translate command > extract openapi spec files 4`] = `
862
942
  </xliff>"
863
943
  `;
864
944
 
945
+ exports[`Translate command > extract openapi spec files with custom openapi schema provided > filelist 1`] = `
946
+ "[
947
+ "openapi-spec.yaml.skl",
948
+ "openapi-spec.yaml.xliff",
949
+ "toc.yaml.skl",
950
+ "toc.yaml.xliff"
951
+ ]"
952
+ `;
953
+
954
+ exports[`Translate command > extract openapi spec files with custom openapi schema provided 1`] = `
955
+ "openapi: 3.0.1
956
+ info:
957
+ title: '%%%0%%%'
958
+ version: v0
959
+ servers:
960
+ - url: http://localhost:8080
961
+ description: '%%%1%%%'
962
+ paths:
963
+ /test:
964
+ get:
965
+ tags:
966
+ - '%%%2%%%'
967
+ summary: '%%%3%%%'
968
+ description: '%%%4%%%'
969
+ operationId: getWithPayloadResponse
970
+ responses:
971
+ '200':
972
+ description: '%%%5%%%'
973
+ content:
974
+ application/json:
975
+ schema:
976
+ $ref: '#/components/schemas/RecurceTop'
977
+ components:
978
+ schemas:
979
+ RecurceTop:
980
+ type: object
981
+ properties:
982
+ A:
983
+ type: string
984
+ description: |
985
+ %%%6%%%
986
+ - %%%7%%%
987
+ - %%%8%%%
988
+ - %%%9%%%
989
+ RecurceMiddle:
990
+ type: object
991
+ properties:
992
+ B:
993
+ type: array
994
+ items:
995
+ $ref: '#/components/schemas/RecurceTop'
996
+ "
997
+ `;
998
+
999
+ exports[`Translate command > extract openapi spec files with custom openapi schema provided 2`] = `
1000
+ "<?xml version="1.0" encoding="UTF-8"?>
1001
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
1002
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
1003
+ <header>
1004
+ <skeleton>
1005
+ <external-file href="file.skl"></external-file>
1006
+ </skeleton>
1007
+ </header>
1008
+ <body>
1009
+ <trans-unit id="0">
1010
+ <source xml:space="preserve">OpenAPI definition</source>
1011
+ </trans-unit>
1012
+ <trans-unit id="1">
1013
+ <source xml:space="preserve">Generated server url</source>
1014
+ </trans-unit>
1015
+ <trans-unit id="2">
1016
+ <source xml:space="preserve">test-controller</source>
1017
+ </trans-unit>
1018
+ <trans-unit id="3">
1019
+ <source xml:space="preserve">Simple get operation. тест новой верстки 3</source>
1020
+ </trans-unit>
1021
+ <trans-unit id="4">
1022
+ <source xml:space="preserve">Defines a simple get operation with no inputs and a complex</source>
1023
+ </trans-unit>
1024
+ <trans-unit id="5">
1025
+ <source xml:space="preserve">200!!!!</source>
1026
+ </trans-unit>
1027
+ <trans-unit id="6">
1028
+ <source xml:space="preserve">Статус загрузки:</source>
1029
+ </trans-unit>
1030
+ <trans-unit id="7">
1031
+ <source xml:space="preserve"><x ctype="code_open" equiv-text="\`" id="x-1"/>UPLOADED<x ctype="code_close" equiv-text="\`" id="x-2"/> — загрузка завершена.</source>
1032
+ </trans-unit>
1033
+ <trans-unit id="8">
1034
+ <source xml:space="preserve"><x ctype="code_open" equiv-text="\`" id="x-3"/>IN_PROGRESS<x ctype="code_close" equiv-text="\`" id="x-4"/> — загрузка находится в процессе обработки.</source>
1035
+ </trans-unit>
1036
+ <trans-unit id="9">
1037
+ <source xml:space="preserve"><x ctype="code_open" equiv-text="\`" id="x-5"/>PROCESSED<x ctype="code_close" equiv-text="\`" id="x-6"/> — загрузка успешно обработана.</source>
1038
+ </trans-unit>
1039
+ </body>
1040
+ </file>
1041
+ </xliff>"
1042
+ `;
1043
+
1044
+ exports[`Translate command > extract openapi spec files with custom openapi schema provided 3`] = `
1045
+ "items:
1046
+ - name: '%%%0%%%'
1047
+ include:
1048
+ path: openapi
1049
+ includers:
1050
+ - name: openapi
1051
+ input: openapi-spec.yaml
1052
+ mode: link
1053
+ "
1054
+ `;
1055
+
1056
+ exports[`Translate command > extract openapi spec files with custom openapi schema provided 4`] = `
1057
+ "<?xml version="1.0" encoding="UTF-8"?>
1058
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
1059
+ <file original="file.ext" source-language="ru-RU" target-language="es-ES" datatype="markdown">
1060
+ <header>
1061
+ <skeleton>
1062
+ <external-file href="file.skl"></external-file>
1063
+ </skeleton>
1064
+ </header>
1065
+ <body>
1066
+ <trans-unit id="0">
1067
+ <source xml:space="preserve">openapi</source>
1068
+ </trans-unit>
1069
+ </body>
1070
+ </file>
1071
+ </xliff>"
1072
+ `;
1073
+
865
1074
  exports[`Translate command > extract yaml scheme files > filelist 1`] = `
866
1075
  "[
867
1076
  "en/index-direct.yaml.skl",
@@ -67,6 +67,24 @@ describe('Translate command', () => {
67
67
  target: 'es-ES',
68
68
  });
69
69
 
70
+ generateFilesYamlTestTemplate(
71
+ 'extract openapi spec files with custom openapi schema provided',
72
+ 'mocks/translation/custom-schema',
73
+ {
74
+ subcommand: 'extract',
75
+ source: 'ru-RU',
76
+ target: 'es-ES',
77
+ additionalArgs:
78
+ '--schema mocks/translation/custom-schema/custom-openapi-schema-30.yaml',
79
+ },
80
+ );
81
+
82
+ generateFilesYamlTestTemplate('compose openapi spec files', 'mocks/translation/compose', {
83
+ subcommand: 'compose',
84
+ source: 'ru-RU',
85
+ target: 'es-ES',
86
+ });
87
+
70
88
  generateMapTestTemplate('do not filter files on extract', 'mocks/translation/dir-files', {
71
89
  subcommand: 'extract',
72
90
  source: 'ru-RU',
@@ -10,7 +10,7 @@ export interface BuildRunArgs {
10
10
  }
11
11
 
12
12
  export interface TranslateRunArgs {
13
- subcommand: 'extract';
13
+ subcommand: 'extract' | 'compose';
14
14
  source: string;
15
15
  target: string;
16
16
  additionalArgs?: string;
@@ -1,6 +1,6 @@
1
1
  # Header
2
2
 
3
- ![_images/versions.png]
3
+ ![](_images/versions.png)
4
4
 
5
5
  ::: page-constructor
6
6
  blocks:
@@ -11,9 +11,8 @@ blocks:
11
11
  controlPosition: 'content'
12
12
  - type: 'basic-card'
13
13
  title: 'Заголовок 2'
14
- text: '![_images/camera.svg]'
14
+ text: '![](_images/versions.png)'
15
15
  border: 'shadow'
16
16
  controlPosition: 'content'
17
- image:
18
- icon: '_images/icons/bulb.svg'
17
+ icon: '_images/icons/bulb.svg'
19
18
  :::
@@ -4,4 +4,4 @@ blocks:
4
4
  text: 'Текст'
5
5
  border: 'shadow'
6
6
  controlPosition: 'content'
7
- image: '_images/mountain.jpg'
7
+ icon: '_images/mountain.jpg'
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 20.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg width="20px" height="20px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" id="search" version="1.1" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
4
+ <g id="search_1_">
5
+ <linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="57.9473" x2="407.9511" y1="351.4531" y2="149.3783">
6
+ <stop offset="0" stop-color="#F14D5C"/>
7
+ <stop offset="0.1309" stop-color="#F05454"/>
8
+ <stop offset="0.3346" stop-color="#3bf488"/>
9
+ <stop offset="0.3492"
10
+ stop-color="#ED683C"/>
11
+ <stop offset="0.714" stop-color="#1e15a3"/>
12
+ <stop offset="1" stop-color="#FDC70C"/>
13
+ </linearGradient>
14
+ <path d="M300.766,87.509c-33.056,0-64.133,12.873-87.507,36.246c-23.374,23.374-36.247,54.451-36.247,87.507
15
+ c0,24.234,6.927,47.4,19.83,67.252l-12.669,12.669c0,0.001-0.001,0.001-0.001,0.001l-90.664,90.665 c-8.353,8.354-7.88,22.418,1.055,31.353l4.261,4.262c4.669,4.668,10.736,7.028,16.658,7.028c5.417,0,10.713-1.976,14.703-5.966 l15.405-15.405l75.259-75.259l12.671-12.672c19.85,12.9,43.014,19.826,67.246,19.826c33.056,0,64.133-12.873,87.506-36.247 c48.252-48.251,48.252-126.762,0-175.014C364.898,100.382,333.821,87.509,300.766,87.509z M138.518,396.049 c-4.454,4.453-12.178,3.979-17.219-1.063l-4.261-4.262c-5.036-5.035-5.509-12.756-1.055-17.21l71.38-71.38 c3.284,4.164,6.834,8.16,10.601,11.926c3.766,3.766,7.764,7.318,11.935,10.607L138.518,396.049z M105.894,410.391l-4.261-4.26 c-5.036-5.036-5.509-12.757-1.055-17.211l2.902-2.902c0.936,4.27,3.101,8.393,6.486,11.779l4.261,4.26 c3.392,3.393,7.523,5.549,11.799,6.483l-2.914,2.914C118.658,415.908,110.934,415.432,105.894,410.391z M213.788,320.779 c0.002-0.003,0.005-0.006,0.007-0.008l0,0L213.788,320.779z M217.033,317.534c-4.201-3.248-8.229-6.775-11.998-10.544 c-3.771-3.771-7.295-7.797-10.537-11.99l8.214-8.214c3.233,4.181,6.749,8.185,10.547,11.982c3.8,3.8,7.806,7.317,11.989,10.552 L217.033,317.534z M381.201,291.697c-21.485,21.485-50.052,33.318-80.436,33.318c-30.385,0-58.951-11.833-80.436-33.318 c-21.485-21.484-33.318-50.051-33.318-80.436s11.833-58.95,33.318-80.436c21.485-21.485,50.051-33.317,80.436-33.317 c30.384,0,58.95,11.832,80.436,33.317C425.553,175.179,425.553,247.346,381.201,291.697z" fill="url(#SVGID_1_)"/>
16
+ <path d="M258.117,115.27l3.604,9.328c2.592-1.001,5.267-1.887,7.949-2.632l-2.676-9.636 C263.998,113.162,261.012,114.151,258.117,115.27z" fill="#3bf488ff"/>
17
+ <path d="M206.264,162.886l8.985,4.389c8.299-16.992,22.191-30.997,39.118-39.433l-4.46-8.95 C231.022,128.304,215.523,143.928,206.264,162.886z" fill="#1e15a3ff"/>
18
+ </g>
19
+ </svg>
@@ -64,6 +64,13 @@ Term
64
64
  15. `![code svg image 15][code]{inline=true}`
65
65
  ![svg image 15][code]{inline=true}
66
66
 
67
+ 16. `![svg with xml header](_assets/2.svg)`
68
+ ![svg with xml header](_assets/2.svg)
69
+
70
+ 17. Text link `backtick`.
71
+ ![Text link `backtick`](_assets/1.svg "Text link title `backtick`"){ width="100" }
72
+ Text link `backtick`.
73
+
67
74
  20. Сodeblocks - no inline svg
68
75
  ```
69
76
  Codeblock fence
@@ -105,3 +112,50 @@ Codeblock with inline code
105
112
  `![code svg image 22](_assets/1.svg)`
106
113
  1. ![code svg image 23](_assets/1.svg)
107
114
  ```
115
+
116
+ 1. Codeblock in table with asset
117
+
118
+ #|
119
+ || **col1** | **col2** | **col3** ||
120
+ || col1 |
121
+ ```swift
122
+ some code ![svg image 24](_assets/1.svg =120x)
123
+ ``` | ![svg image 24](_assets/1.svg =120x) ||
124
+ |#
125
+
126
+ 1. Codeblock in cat
127
+
128
+ {% cut "first level" %}
129
+
130
+ ![svg image 25](_assets/1.svg)
131
+ ```md
132
+ ![code svg image 25](_assets/1.svg)
133
+ ```
134
+ {% cut "second level" %}
135
+
136
+ ![svg image 25](_assets/1.svg)
137
+
138
+ ```md
139
+ ![code svg image 26](_assets/1.svg)
140
+ ```
141
+
142
+ {% endcut %}
143
+
144
+ {% endcut %}
145
+
146
+ 1. Codeblock in tabs
147
+
148
+ {% list tabs %}
149
+ - first
150
+
151
+ ![svg image 25](_assets/1.svg)
152
+ ```md
153
+ ![code svg image 25](_assets/1.svg)
154
+ ```
155
+ - second
156
+
157
+ ![svg image 25](_assets/1.svg)
158
+ ```md
159
+ ![code svg image 25](_assets/1.svg)
160
+ ```
161
+ {% endlist %}
@@ -0,0 +1,41 @@
1
+ openapi: 3.0.1
2
+ info:
3
+ title: '%%%0%%%'
4
+ version: v0
5
+ servers:
6
+ - url: http://localhost:8080
7
+ description: '%%%1%%%'
8
+ paths:
9
+ /test:
10
+ get:
11
+ tags:
12
+ - '%%%2%%%'
13
+ summary: '%%%3%%%'
14
+ description: '%%%4%%%'
15
+ operationId: getWithPayloadResponse
16
+ responses:
17
+ '200':
18
+ description: '%%%5%%%'
19
+ content:
20
+ application/json:
21
+ schema:
22
+ $ref: '#/components/schemas/RecurceTop'
23
+ components:
24
+ schemas:
25
+ RecurceTop:
26
+ type: object
27
+ properties:
28
+ A:
29
+ type: string
30
+ description: |
31
+ %%%6%%%
32
+ - %%%7%%%
33
+ - %%%8%%%
34
+ - %%%9%%%
35
+ RecurceMiddle:
36
+ type: object
37
+ properties:
38
+ B:
39
+ type: array
40
+ items:
41
+ $ref: '#/components/schemas/RecurceTop'
@@ -0,0 +1,52 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
3
+ <file original="file.ext" source-language="ru-RU" target-language="en-US" datatype="markdown">
4
+ <header>
5
+ <skeleton>
6
+ <external-file href="file.skl"></external-file>
7
+ </skeleton>
8
+ </header>
9
+ <body>
10
+ <trans-unit id="0">
11
+ <source xml:space="preserve">OpenAPI definition</source>
12
+ <target>Перевод 1</target>
13
+ </trans-unit>
14
+ <trans-unit id="1">
15
+ <source xml:space="preserve">Generated server url</source>
16
+ <target>Перевод 2</target>
17
+ </trans-unit>
18
+ <trans-unit id="2">
19
+ <source xml:space="preserve">test-controller</source>
20
+ <target>Перевод 3</target>
21
+ </trans-unit>
22
+ <trans-unit id="3">
23
+ <source xml:space="preserve">Simple get operation. тест новой верстки 3</source>
24
+ <target>Перевод 4</target>
25
+ </trans-unit>
26
+ <trans-unit id="4">
27
+ <source xml:space="preserve">Defines a simple get operation with no inputs and a complex</source>
28
+ <target>Перевод 5</target>
29
+ </trans-unit>
30
+ <trans-unit id="5">
31
+ <source xml:space="preserve">200!!!!</source>
32
+ <target>Перевод 6</target>
33
+ </trans-unit>
34
+ <trans-unit id="6">
35
+ <source xml:space="preserve">Статус загрузки:</source>
36
+ <target>Перевод 7</target>
37
+ </trans-unit>
38
+ <trans-unit id="7">
39
+ <source xml:space="preserve"><x ctype="code_open" equiv-text="`" id="x-1"/>UPLOADED<x ctype="code_close" equiv-text="`" id="x-2"/> — загрузка завершена.</source>
40
+ <target>Перевод 8</target>
41
+ </trans-unit>
42
+ <trans-unit id="8">
43
+ <source xml:space="preserve"><x ctype="code_open" equiv-text="`" id="x-3"/>IN_PROGRESS<x ctype="code_close" equiv-text="`" id="x-4"/> — загрузка находится в процессе обработки.</source>
44
+ <target>Перевод 9</target>
45
+ </trans-unit>
46
+ <trans-unit id="9">
47
+ <source xml:space="preserve"><x ctype="code_open" equiv-text="`" id="x-5"/>PROCESSED<x ctype="code_close" equiv-text="`" id="x-6"/> — загрузка успешно обработана.</source>
48
+ <target>Перевод 10</target>
49
+ </trans-unit>
50
+ </body>
51
+ </file>
52
+ </xliff>
@@ -0,0 +1,8 @@
1
+ items:
2
+ - name: '%%%0%%%'
3
+ include:
4
+ path: openapi
5
+ includers:
6
+ - name: openapi
7
+ input: openapi-spec.yaml
8
+ mode: link
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
3
+ <file original="file.ext" source-language="ru-RU" target-language="en-US" datatype="markdown">
4
+ <header>
5
+ <skeleton>
6
+ <external-file href="file.skl"></external-file>
7
+ </skeleton>
8
+ </header>
9
+ <body>
10
+ <trans-unit id="0">
11
+ <source xml:space="preserve">openapi</source>
12
+ <target>Перевод 1</target>
13
+ </trans-unit>
14
+ </body>
15
+ </file>
16
+ </xliff>