File tree Expand file tree Collapse file tree 5 files changed +20
-30
lines changed Expand file tree Collapse file tree 5 files changed +20
-30
lines changed Original file line number Diff line number Diff line change @@ -1062,29 +1062,24 @@ export default function ControlPanel({
1062
1062
} ) ) ;
1063
1063
} ,
1064
1064
} ,
1065
- ] ,
1066
- function : ( ) => { } ,
1067
- } ,
1068
- documentation : {
1069
- children : [
1070
- {
1071
- Markdown : ( ) => {
1072
- setModal ( MODAL . CODE ) ;
1073
- const result = jsonToDocumentation ( {
1074
- tables : tables ,
1075
- relationships : relationships ,
1076
- notes : notes ,
1077
- subjectAreas : areas ,
1078
- database : database ,
1079
- title : title ,
1080
- } ) ;
1081
- setExportData ( ( prev ) => ( {
1082
- ...prev ,
1083
- data : result ,
1084
- extension : "md" ,
1085
- } ) ) ;
1086
- }
1065
+ {
1066
+ Readme : ( ) => {
1067
+ setModal ( MODAL . CODE ) ;
1068
+ const result = jsonToDocumentation ( {
1069
+ tables : tables ,
1070
+ relationships : relationships ,
1071
+ notes : notes ,
1072
+ subjectAreas : areas ,
1073
+ database : database ,
1074
+ title : title ,
1075
+ } ) ;
1076
+ setExportData ( ( prev ) => ( {
1077
+ ...prev ,
1078
+ data : result ,
1079
+ extension : "md" ,
1080
+ } ) ) ;
1087
1081
}
1082
+ } ,
1088
1083
] ,
1089
1084
function : ( ) => { } ,
1090
1085
} ,
Original file line number Diff line number Diff line change @@ -236,7 +236,6 @@ const en = {
236
236
empty_index_name : "Declared an index with no name in table '{{tableName}}'" ,
237
237
didnt_find_diagram : "Oops! Didn't find the diagram." ,
238
238
unsigned : "Unsigned" ,
239
- documentation : "Documentation" ,
240
239
} ,
241
240
} ;
242
241
Original file line number Diff line number Diff line change @@ -212,7 +212,6 @@ const es = {
212
212
edit_relationship : "{{extra}} Editar relación {{refName}}" ,
213
213
delete_relationship : "Eliminar relación {{refName}}" ,
214
214
not_found : "No encontrado" ,
215
- documentation : "Documentación" ,
216
215
} ,
217
216
} ;
218
217
Original file line number Diff line number Diff line change @@ -217,7 +217,6 @@ const fr = {
217
217
edit_relationship : "{{extra}} Modifier la relation {{refName}}" ,
218
218
delete_relationship : "Supprimer la relation {{refName}}" ,
219
219
not_found : "Non trouvé" ,
220
- documentation : "Documentation" ,
221
220
} ,
222
221
} ;
223
222
Original file line number Diff line number Diff line change 1
1
import { dbToTypes } from "../../data/datatypes" ;
2
2
import { jsonToMermaid } from "./mermaid" ;
3
+ import { databases } from "../../data/databases" ;
3
4
4
5
export function jsonToDocumentation ( obj ) {
5
6
@@ -44,16 +45,13 @@ export function jsonToDocumentation(obj) {
44
45
. map ( ( r ) => {
45
46
const startTable = obj . tables [ r . startTableId ] . name ;
46
47
const endTable = obj . tables [ r . endTableId ] . name ;
47
- return `- **${ startTable } to ${ endTable } **: ${ r . cardinality } ${ r . comment ? "(" + r . comment + ")" : "" } \n` ;
48
+ return `- **${ startTable } to ${ endTable } **: ${ r . cardinality } \n` ;
48
49
} ) . join ( "" ) : "" ;
49
50
50
- console . log ( obj . tables ) ;
51
- console . log ( obj . relationships ) ;
52
-
53
51
return `# ${ obj . title } documentation\n## Summary\n\n- [Introduction](#introduction)\n- [Database Type](#database-type)\n` +
54
52
`- [Table Structure](#table-structure)\n${ documentationSummary } \n- [Relationships](#relationships)\n- [Database Diagram](#database-Diagram)\n\n` +
55
53
`## Introduction\n\n## Database type\n\n- **Database system:** ` +
56
- `${ obj . database . type } \n## Table structure\n\n${ documentationEntities } ` +
54
+ `${ databases [ obj . database ] . name } \n## Table structure\n\n${ documentationEntities } ` +
57
55
`\n\n## Relationships\n\n${ documentationRelationships } \n\n` +
58
56
`## Database Diagram\n\n\`\`\`${ jsonToMermaid ( obj ) } \`\`\`` ;
59
57
}
You can’t perform that action at this time.
0 commit comments