Skip to content

Commit 4233d14

Browse files
authored
feat: sets-up class for CiceroMark to OOXML transformer (#399)
* feat: sets-up class for CiceroMark to OOXML transformer Defines constructor Defines the function for converting CiceroMark to OOXML Signed-off-by: k-kumar-01 <[email protected]> * feat: sets-up class for CiceroMark to OOXML transformer Removes contructor Nodes declared as class variable Signed-off-by: k-kumar-01 <[email protected]>
1 parent a9ab07e commit 4233d14

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
'use strict';
16+
17+
/**
18+
* Transforms the ciceromark to OOXML
19+
*/
20+
class CiceroMarkToOOXMLTransfomer {
21+
22+
definedNodes = {
23+
computedVariable: 'org.accordproject.ciceromark.ComputedVariable',
24+
heading: 'org.accordproject.commonmark.Heading',
25+
item: 'org.accordproject.commonmark.Item',
26+
list: 'org.accordproject.commonmark.List',
27+
listBlock: 'org.accordproject.ciceromark.ListBlock',
28+
paragraph: 'org.accordproject.commonmark.Paragraph',
29+
softbreak: 'org.accordproject.commonmark.Softbreak',
30+
text: 'org.accordproject.commonmark.Text',
31+
variable: 'org.accordproject.ciceromark.Variable',
32+
emphasize: 'org.accordproject.commonmark.Emph',
33+
};
34+
35+
/**
36+
* Transforms the given CiceroMark JSON to OOXML
37+
*
38+
* @param {Object} ciceromark CiceroMark JSON to be converted
39+
* @param {Object} counter Counter for different variables based on node name
40+
* @param {string} ooxml Initial OOXML string
41+
* @returns {string} Converted OOXML string i.e. CicecoMark->OOXML
42+
*/
43+
toOOXML(ciceromark, counter, ooxml) {
44+
let globalOOXML = ooxml;
45+
return globalOOXML;
46+
}
47+
}
48+
49+
module.exports = CiceroMarkToOOXMLTransfomer;

0 commit comments

Comments
 (0)