Skip to content

Commit dd9cbc3

Browse files
author
Kay McCormick
committed
newDocument test works
1 parent ae6245d commit dd9cbc3

10 files changed

+276
-202
lines changed

__tests__/settingsHelper.test.ts

+202
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
import { fn } from "../src/settingsHelper";
2+
3+
test("1", () => {
4+
expect(fn()).toMatchInlineSnapshot(`
5+
Object {
6+
"docutilsCoreOptionParser": Object {
7+
"autoIdPrefix": "id",
8+
"errorEncoding": "UTF-8",
9+
"errorEncodingErrorHandler": "backslashreplace",
10+
"exitStatusLevel": 5,
11+
"idPrefix": "",
12+
"inputEncodingErrorHandler": "strict",
13+
"languageCode": "en",
14+
"outputEncoding": "utf-8",
15+
"outputEncodingErrorHandler": "strict",
16+
"recordDependencies": null,
17+
},
18+
"docutilsFrontendOptionParser": Object {
19+
"autoIdPrefix": "id",
20+
"errorEncoding": "UTF-8",
21+
"errorEncodingErrorHandler": "backslashreplace",
22+
"exitStatusLevel": 5,
23+
"idPrefix": "",
24+
"inputEncodingErrorHandler": "strict",
25+
"languageCode": "en",
26+
"outputEncoding": "utf-8",
27+
"outputEncodingErrorHandler": "strict",
28+
"recordDependencies": null,
29+
},
30+
"docutilsParsersRstParser": Object {
31+
"characterLevelInlineMarkup": false,
32+
"pepBaseUrl": "http://www.python.org/dev/peps/",
33+
"pepFileUrlTemplate": "pep-%04d",
34+
"rfcBaseUrl": "http://tools.ietf.org/html/",
35+
"smartQuotes": false,
36+
"syntaxHighlight": "long",
37+
"tabWidth": 8,
38+
},
39+
"docutilsReadersPepReader": Object {},
40+
"docutilsReadersStandaloneReader": Object {
41+
"docinfoXform": 1,
42+
"doctitleXform": 1,
43+
},
44+
"docutilsWritersDocutilsXmlWriter": Object {
45+
"doctypeDeclaration": 1,
46+
"xmlDeclaration": 1,
47+
},
48+
"docutilsWritersHtml4Css1Writer": Object {
49+
"attribution": "dash",
50+
"fieldNameLimit": 14,
51+
"footnoteReferences": "brackets",
52+
"initialHeaderLevel": "1",
53+
"mathOutput": "HTML math.css",
54+
"optionLimit": 14,
55+
"stylesheetDirs": Array [
56+
".",
57+
"/usr/share/docutils/writers/html4css1",
58+
"/usr/share/docutils/writers/html5_polyglot",
59+
],
60+
"stylesheetPath": Array [
61+
"html4css1.css",
62+
],
63+
"tableStyle": "",
64+
"template": "/usr/share/docutils/writers/html4css1/template.txt",
65+
"xmlDeclaration": 1,
66+
},
67+
"docutilsWritersHtml5PolyglotWriter": Object {
68+
"attribution": "dash",
69+
"footnoteReferences": "brackets",
70+
"initialHeaderLevel": "1",
71+
"mathOutput": "HTML math.css",
72+
"stylesheetDirs": Array [
73+
".",
74+
"/usr/share/docutils/writers/html5_polyglot",
75+
],
76+
"stylesheetPath": Array [
77+
"minimal.css",
78+
"plain.css",
79+
],
80+
"tableStyle": "",
81+
"template": "/usr/share/docutils/writers/html5_polyglot/template.txt",
82+
},
83+
"docutilsWritersLatex2EWriter": Object {
84+
"attribution": "dash",
85+
"documentclass": "article",
86+
"documentoptions": "a4paper",
87+
"docutilsFootnotes": true,
88+
"embedStylesheet": 0,
89+
"fontEncoding": "T1",
90+
"footnoteReferences": "superscript",
91+
"graphicxOption": "",
92+
"hyperlinkColor": "blue",
93+
"hyperrefOptions": "",
94+
"latexPreamble": "% PDF Standard Fonts
95+
\\\\usepackage{mathptmx} % Times
96+
\\\\usepackage[scaled=.90]{helvet}
97+
\\\\usepackage{courier}",
98+
"literalBlockEnv": "",
99+
"referenceLabel": null,
100+
"sectionEnumeratorSeparator": "-",
101+
"stylesheet": "",
102+
"stylesheetDirs": Array [
103+
".",
104+
],
105+
"tableStyle": Array [
106+
"standard",
107+
],
108+
"template": "default.tex",
109+
"useBibtex": null,
110+
"useLatexAbstract": 0,
111+
"useLatexDocinfo": 0,
112+
"usePartSection": 0,
113+
"useVerbatimWhenPossible": 0,
114+
},
115+
"docutilsWritersOdfOdtReader": Object {
116+
"docinfoXform": 1,
117+
"doctitleXform": 1,
118+
},
119+
"docutilsWritersOdfOdtWriter": Object {
120+
"addSyntaxHighlighting": false,
121+
"cloakEmailAddresses": false,
122+
"createLinks": false,
123+
"createSections": true,
124+
"customFooter": "",
125+
"customHeader": "",
126+
"endnotesEndDoc": false,
127+
"generateOowriterToc": true,
128+
"stylesheet": "/usr/share/docutils/writers/odf_odt/styles.odt",
129+
"tableBorderThickness": null,
130+
},
131+
"docutilsWritersPepHtmlWriter": Object {
132+
"attribution": "dash",
133+
"fieldNameLimit": 14,
134+
"footnoteReferences": "brackets",
135+
"initialHeaderLevel": "1",
136+
"mathOutput": "HTML math.css",
137+
"optionLimit": 14,
138+
"stylesheetDirs": Array [
139+
".",
140+
"/usr/share/docutils/writers/html4css1",
141+
"/usr/share/docutils/writers/html5_polyglot",
142+
],
143+
"stylesheetPath": Array [
144+
"html4css1.css",
145+
],
146+
"tableStyle": "",
147+
"template": "/usr/share/docutils/writers/html4css1/template.txt",
148+
"xmlDeclaration": 1,
149+
},
150+
"docutilsWritersS5HtmlWriter": Object {
151+
"attribution": "dash",
152+
"fieldNameLimit": 14,
153+
"footnoteReferences": "brackets",
154+
"initialHeaderLevel": "1",
155+
"mathOutput": "HTML math.css",
156+
"optionLimit": 14,
157+
"stylesheetDirs": Array [
158+
".",
159+
"/usr/share/docutils/writers/html4css1",
160+
"/usr/share/docutils/writers/html5_polyglot",
161+
],
162+
"stylesheetPath": Array [
163+
"html4css1.css",
164+
],
165+
"tableStyle": "",
166+
"template": "/usr/share/docutils/writers/html4css1/template.txt",
167+
"xmlDeclaration": 1,
168+
},
169+
"docutilsWritersXetexWriter": Object {
170+
"attribution": "dash",
171+
"documentclass": "article",
172+
"documentoptions": "a4paper",
173+
"docutilsFootnotes": true,
174+
"embedStylesheet": 0,
175+
"footnoteReferences": "superscript",
176+
"graphicxOption": "",
177+
"hyperlinkColor": "blue",
178+
"hyperrefOptions": "",
179+
"latexPreamble": "% Linux Libertine (free, wide coverage, not only for Linux)
180+
\\\\setmainfont{Linux Libertine O}
181+
\\\\setsansfont{Linux Biolinum O}
182+
\\\\setmonofont[HyphenChar=None,Scale=MatchLowercase]{DejaVu Sans Mono}",
183+
"literalBlockEnv": "",
184+
"referenceLabel": null,
185+
"sectionEnumeratorSeparator": "-",
186+
"stylesheet": "",
187+
"stylesheetDirs": Array [
188+
".",
189+
],
190+
"tableStyle": Array [
191+
"standard",
192+
],
193+
"template": "xelatex.tex",
194+
"useBibtex": null,
195+
"useLatexAbstract": 0,
196+
"useLatexDocinfo": 0,
197+
"usePartSection": 0,
198+
"useVerbatimWhenPossible": 0,
199+
},
200+
}
201+
`);
202+
});

gen/defaults.ts

+3-190
Original file line numberDiff line numberDiff line change
@@ -1,192 +1,5 @@
11
import { Settings } from './Settings';
22

3-
export default defaults: Settings = {
4-
"docutilsReadersStandaloneReader" : {
5-
"docinfoXform" : 1,
6-
"doctitleXform" : 1
7-
},
8-
"docutilsReadersPepReader" : {},
9-
"docutilsWritersHtml4Css1Writer" : {
10-
"xmlDeclaration" : 1,
11-
"stylesheetPath" : [
12-
"html4css1.css"
13-
],
14-
"initialHeaderLevel" : "1",
15-
"stylesheetDirs" : [
16-
".",
17-
"/usr/share/docutils/writers/html4css1",
18-
"/usr/share/docutils/writers/html5_polyglot"
19-
],
20-
"footnoteReferences" : "brackets",
21-
"template" : "/usr/share/docutils/writers/html4css1/template.txt",
22-
"mathOutput" : "HTML math.css",
23-
"attribution" : "dash",
24-
"tableStyle" : "",
25-
"optionLimit" : 14,
26-
"fieldNameLimit" : 14
27-
},
28-
"docutilsWritersXetexWriter" : {
29-
"stylesheetDirs" : [
30-
"."
31-
],
32-
"hyperrefOptions" : "",
33-
"useVerbatimWhenPossible" : 0,
34-
"documentoptions" : "a4paper",
35-
"embedStylesheet" : 0,
36-
"useLatexDocinfo" : 0,
37-
"literalBlockEnv" : "",
38-
"graphicxOption" : "",
39-
"hyperlinkColor" : "blue",
40-
"usePartSection" : 0,
41-
"stylesheet" : "",
42-
"useBibtex" : null,
43-
"attribution" : "dash",
44-
"template" : "xelatex.tex",
45-
"documentclass" : "article",
46-
"tableStyle" : [
47-
"standard"
48-
],
49-
"referenceLabel" : null,
50-
"footnoteReferences" : "superscript",
51-
"docutilsFootnotes" : true,
52-
"latexPreamble" : "% Linux Libertine (free, wide coverage, not only for Linux)\n\\setmainfont{Linux Libertine O}\n\\setsansfont{Linux Biolinum O}\n\\setmonofont[HyphenChar=None,Scale=MatchLowercase]{DejaVu Sans Mono}",
53-
"useLatexAbstract" : 0,
54-
"sectionEnumeratorSeparator" : "-"
55-
},
56-
"docutilsWritersS5HtmlWriter" : {
57-
"footnoteReferences" : "brackets",
58-
"optionLimit" : 14,
59-
"fieldNameLimit" : 14,
60-
"tableStyle" : "",
61-
"attribution" : "dash",
62-
"mathOutput" : "HTML math.css",
63-
"template" : "/usr/share/docutils/writers/html4css1/template.txt",
64-
"xmlDeclaration" : 1,
65-
"stylesheetPath" : [
66-
"html4css1.css"
67-
],
68-
"initialHeaderLevel" : "1",
69-
"stylesheetDirs" : [
70-
".",
71-
"/usr/share/docutils/writers/html4css1",
72-
"/usr/share/docutils/writers/html5_polyglot"
73-
]
74-
},
75-
"docutilsWritersOdfOdtWriter" : {
76-
"addSyntaxHighlighting" : false,
77-
"stylesheet" : "/usr/share/docutils/writers/odf_odt/styles.odt",
78-
"createLinks" : false,
79-
"createSections" : true,
80-
"generateOowriterToc" : true,
81-
"tableBorderThickness" : null,
82-
"customFooter" : "",
83-
"cloakEmailAddresses" : false,
84-
"endnotesEndDoc" : false,
85-
"customHeader" : ""
86-
},
87-
"docutilsWritersHtml5PolyglotWriter" : {
88-
"initialHeaderLevel" : "1",
89-
"stylesheetPath" : [
90-
"minimal.css",
91-
"plain.css"
92-
],
93-
"footnoteReferences" : "brackets",
94-
"tableStyle" : "",
95-
"attribution" : "dash",
96-
"mathOutput" : "HTML math.css",
97-
"template" : "/usr/share/docutils/writers/html5_polyglot/template.txt",
98-
"stylesheetDirs" : [
99-
".",
100-
"/usr/share/docutils/writers/html5_polyglot"
101-
]
102-
},
103-
"docutilsCoreOptionParser" : {
104-
"errorEncoding" : "UTF-8",
105-
"outputEncodingErrorHandler" : "strict",
106-
"idPrefix" : "",
107-
"outputEncoding" : "utf-8",
108-
"exitStatusLevel" : 5,
109-
"languageCode" : "en",
110-
"inputEncodingErrorHandler" : "strict",
111-
"errorEncodingErrorHandler" : "backslashreplace",
112-
"autoIdPrefix" : "id",
113-
"recordDependencies" : null
114-
},
115-
"docutilsWritersLatex2EWriter" : {
116-
"useBibtex" : null,
117-
"attribution" : "dash",
118-
"tableStyle" : [
119-
"standard"
120-
],
121-
"latexPreamble" : "% PDF Standard Fonts\n\\usepackage{mathptmx} % Times\n\\usepackage[scaled=.90]{helvet}\n\\usepackage{courier}",
122-
"useLatexAbstract" : 0,
123-
"footnoteReferences" : "superscript",
124-
"docutilsFootnotes" : true,
125-
"hyperrefOptions" : "",
126-
"embedStylesheet" : 0,
127-
"documentoptions" : "a4paper",
128-
"useVerbatimWhenPossible" : 0,
129-
"useLatexDocinfo" : 0,
130-
"graphicxOption" : "",
131-
"fontEncoding" : "T1",
132-
"template" : "default.tex",
133-
"documentclass" : "article",
134-
"referenceLabel" : null,
135-
"sectionEnumeratorSeparator" : "-",
136-
"stylesheetDirs" : [
137-
"."
138-
],
139-
"usePartSection" : 0,
140-
"hyperlinkColor" : "blue",
141-
"stylesheet" : "",
142-
"literalBlockEnv" : ""
143-
},
144-
"docutilsWritersPepHtmlWriter" : {
145-
"xmlDeclaration" : 1,
146-
"stylesheetPath" : [
147-
"html4css1.css"
148-
],
149-
"initialHeaderLevel" : "1",
150-
"stylesheetDirs" : [
151-
".",
152-
"/usr/share/docutils/writers/html4css1",
153-
"/usr/share/docutils/writers/html5_polyglot"
154-
],
155-
"footnoteReferences" : "brackets",
156-
"template" : "/usr/share/docutils/writers/html4css1/template.txt",
157-
"mathOutput" : "HTML math.css",
158-
"attribution" : "dash",
159-
"tableStyle" : "",
160-
"optionLimit" : 14,
161-
"fieldNameLimit" : 14
162-
},
163-
"docutilsWritersDocutilsXmlWriter" : {
164-
"xmlDeclaration" : 1,
165-
"doctypeDeclaration" : 1
166-
},
167-
"docutilsFrontendOptionParser" : {
168-
"errorEncoding" : "UTF-8",
169-
"outputEncodingErrorHandler" : "strict",
170-
"idPrefix" : "",
171-
"outputEncoding" : "utf-8",
172-
"exitStatusLevel" : 5,
173-
"languageCode" : "en",
174-
"errorEncodingErrorHandler" : "backslashreplace",
175-
"inputEncodingErrorHandler" : "strict",
176-
"autoIdPrefix" : "id",
177-
"recordDependencies" : null
178-
},
179-
"docutilsWritersOdfOdtReader" : {
180-
"doctitleXform" : 1,
181-
"docinfoXform" : 1
182-
},
183-
"docutilsParsersRstParser" : {
184-
"rfcBaseUrl" : "http://tools.ietf.org/html/",
185-
"tabWidth" : 8,
186-
"smartQuotes" : false,
187-
"characterLevelInlineMarkup" : false,
188-
"pepBaseUrl" : "http://www.python.org/dev/peps/",
189-
"pepFileUrlTemplate" : "pep-%04d",
190-
"syntaxHighlight" : "long"
191-
}
192-
};
3+
const defaults: Settings = {"docutilsCoreOptionParser":{"tocBacklinks":"entry","footnoteBacklinks":1,"sectnumXform":1,"reportLevel":2,"haltLevel":4,"exitStatusLevel":5,"traceback":null,"inputEncodingErrorHandler":"strict","outputEncoding":"utf-8","outputEncodingErrorHandler":"strict","errorEncoding":"UTF-8","errorEncodingErrorHandler":"backslashreplace","languageCode":"en","recordDependencies":null,"idPrefix":"","autoIdPrefix":"id"},"docutilsFrontendOptionParser":{"tocBacklinks":"entry","footnoteBacklinks":1,"sectnumXform":1,"reportLevel":2,"haltLevel":4,"exitStatusLevel":5,"traceback":null,"inputEncodingErrorHandler":"strict","outputEncoding":"utf-8","outputEncodingErrorHandler":"strict","errorEncoding":"UTF-8","errorEncodingErrorHandler":"backslashreplace","languageCode":"en","recordDependencies":null,"idPrefix":"","autoIdPrefix":"id"},"docutilsParsersRstParser":{"pepBaseUrl":"http://www.python.org/dev/peps/","pepFileUrlTemplate":"pep-%04d","rfcBaseUrl":"http://tools.ietf.org/html/","tabWidth":8,"fileInsertionEnabled":1,"rawEnabled":1,"syntaxHighlight":"long","smartQuotes":false,"characterLevelInlineMarkup":false},"docutilsWritersDocutilsXmlWriter":{"xmlDeclaration":1,"doctypeDeclaration":1},"docutilsWritersPepHtmlWriter":{"template":"/usr/share/docutils/writers/html4css1/template.txt","stylesheetPath":["html4css1.css"],"embedStylesheet":1,"stylesheetDirs":[".","/usr/share/docutils/writers/html4css1","/usr/share/docutils/writers/html5_polyglot"],"initialHeaderLevel":"1","fieldNameLimit":14,"optionLimit":14,"footnoteReferences":"brackets","attribution":"dash","compactLists":1,"compactFieldLists":1,"tableStyle":"","mathOutput":"HTML math.css","xmlDeclaration":1},"docutilsWritersLatex2EWriter":{"documentclass":"article","documentoptions":"a4paper","docutilsFootnotes":true,"footnoteReferences":"superscript","useLatexCitations":false,"attribution":"dash","stylesheet":"","embedStylesheet":0,"stylesheetDirs":["."],"latexPreamble":"% PDF Standard Fonts\n\\usepackage{mathptmx} % Times\n\\usepackage[scaled=.90]{helvet}\n\\usepackage{courier}","template":"default.tex","useLatexToc":1,"usePartSection":0,"useLatexDocinfo":0,"useLatexAbstract":0,"hyperlinkColor":"blue","hyperrefOptions":"","compoundEnumerators":null,"sectionPrefixForEnumerators":null,"sectionEnumeratorSeparator":"-","literalBlockEnv":"","useVerbatimWhenPossible":0,"tableStyle":["standard"],"graphicxOption":"","fontEncoding":"T1","referenceLabel":null,"useBibtex":null},"docutilsWritersOdfOdtWriter":{"stylesheet":"/usr/share/docutils/writers/odf_odt/styles.odt","cloakEmailAddresses":false,"tableBorderThickness":null,"addSyntaxHighlighting":false,"createSections":true,"createLinks":false,"endnotesEndDoc":false,"generateOowriterToc":true,"customHeader":"","customFooter":""},"docutilsWritersOdfOdtReader":{"doctitleXform":1,"docinfoXform":1,"sectsubtitleXform":0},"docutilsWritersHtml4Css1Writer":{"template":"/usr/share/docutils/writers/html4css1/template.txt","stylesheetPath":["html4css1.css"],"embedStylesheet":1,"stylesheetDirs":[".","/usr/share/docutils/writers/html4css1","/usr/share/docutils/writers/html5_polyglot"],"initialHeaderLevel":"1","fieldNameLimit":14,"optionLimit":14,"footnoteReferences":"brackets","attribution":"dash","compactLists":1,"compactFieldLists":1,"tableStyle":"","mathOutput":"HTML math.css","xmlDeclaration":true},"docutilsWritersXetexWriter":{"documentclass":"article","documentoptions":"a4paper","docutilsFootnotes":true,"footnoteReferences":"superscript","useLatexCitations":0,"attribution":"dash","stylesheet":"","embedStylesheet":0,"stylesheetDirs":["."],"latexPreamble":"% Linux Libertine (free, wide coverage, not only for Linux)\n\\setmainfont{Linux Libertine O}\n\\setsansfont{Linux Biolinum O}\n\\setmonofont[HyphenChar=None,Scale=MatchLowercase]{DejaVu Sans Mono}","template":"xelatex.tex","useLatexToc":1,"usePartSection":0,"useLatexDocinfo":0,"useLatexAbstract":0,"hyperlinkColor":"blue","hyperrefOptions":"","compoundEnumerators":null,"sectionPrefixForEnumerators":null,"sectionEnumeratorSeparator":"-","literalBlockEnv":"","useVerbatimWhenPossible":0,"tableStyle":["standard"],"graphicxOption":"","referenceLabel":null,"useBibtex":null},"docutilsWritersHtml5PolyglotWriter":{"template":"/usr/share/docutils/writers/html5_polyglot/template.txt","stylesheetPath":["minimal.css","plain.css"],"embedStylesheet":1,"stylesheetDirs":[".","/usr/share/docutils/writers/html5_polyglot"],"initialHeaderLevel":"1","footnoteReferences":"brackets","attribution":"dash","compactLists":true,"compactFieldLists":true,"tableStyle":"","mathOutput":"HTML math.css","xmlDeclaration":false},"docutilsWritersS5HtmlWriter":{"template":"/usr/share/docutils/writers/html4css1/template.txt","stylesheetPath":["html4css1.css"],"embedStylesheet":1,"stylesheetDirs":[".","/usr/share/docutils/writers/html4css1","/usr/share/docutils/writers/html5_polyglot"],"initialHeaderLevel":"1","fieldNameLimit":14,"optionLimit":14,"footnoteReferences":"brackets","attribution":"dash","compactLists":1,"compactFieldLists":1,"tableStyle":"","mathOutput":"HTML math.css","xmlDeclaration":1},"docutilsReadersPepReader":{},"docutilsReadersStandaloneReader":{"doctitleXform":1,"docinfoXform":1,"sectsubtitleXform":0}};
4+
;
5+
export default defaults;

gen/newSettingsSpec.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)