@magic/transmute 0.0.55 → 0.0.57

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 (2) hide show
  1. package/README.md +124 -53
  2. package/package.json +12 -12
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  ## @magic/transmute
2
+
2
3
  transmutes html and markdown to @magic view fragments
3
4
 
4
5
  [![NPM version][npm-image]][npm-url]
@@ -7,10 +8,10 @@ transmutes html and markdown to @magic view fragments
7
8
  [![Coverage Status][coveralls-image]][coveralls-url]
8
9
  [![Known Vulnerabilities][snyk-image]][snyk-url]
9
10
 
10
-
11
11
  ### installation
12
12
 
13
13
  #### cli:
14
+
14
15
  ```bash
15
16
  npm i -g @magic/transmute
16
17
 
@@ -19,6 +20,7 @@ magic-transmute
19
20
  ```
20
21
 
21
22
  #### javascript api
23
+
22
24
  ```bash
23
25
  npm i --save @magic/transmute
24
26
  ```
@@ -30,40 +32,47 @@ npm i --save @magic/transmute
30
32
  `magic-transmute --help`
31
33
 
32
34
  #### commands:
33
- * markdown - convert markdown to magic functions
34
- * html - convert html to magic functions
35
- * file - convert file to magic functions
35
+
36
+ - markdown - convert markdown to magic functions
37
+ - html - convert html to magic functions
38
+ - file - convert file to magic functions
36
39
 
37
40
  #### flags:
38
- * --add-wrapper - add export default[] to the returned string. - alias: ["--addWrapper"]
39
- * --no-pretty - do not run prettier. - alias: ["--noPretty"]
40
- * --markdown - force markdown parser to run. - alias: ["--mark", "-m"]
41
- * --output - output file path - alias: ["--out", "-o"]
42
- * --input - input file path - alias: ["--in", "-i"]
43
- * --help - this help text - alias: ["-help", "help", "--h", "-h"]
44
- * --str - an input string of either html or markdown, depending on running command
41
+
42
+ - --add-wrapper - add export default[] to the returned string. - alias: ["--addWrapper"]
43
+ - --no-pretty - do not run prettier. - alias: ["--noPretty"]
44
+ - --markdown - force markdown parser to run. - alias: ["--mark", "-m"]
45
+ - --output - output file path - alias: ["--out", "-o"]
46
+ - --input - input file path - alias: ["--in", "-i"]
47
+ - --help - this help text - alias: ["-help", "help", "--h", "-h"]
48
+ - --str - an input string of either html or markdown, depending on running command
45
49
 
46
50
  ##### transpile html string:
51
+
47
52
  `magic-transmute html --str '<a href="https://magic.github.io">magic!</a>'`
48
53
 
49
54
  ##### transpile markdown string:
55
+
50
56
  `magic-transmute markdown --str '[magic!](https://magic.github.io)'`
51
57
 
52
58
  ##### html file:
59
+
53
60
  `magic-transmute file --input input.html --output output.mjs`
54
61
 
55
62
  ##### markdown file
63
+
56
64
  (.markdown and .md get recognized):
57
65
 
58
66
  `magic-transmute file --input input.md --output output.mjs`
59
67
 
60
68
  ##### force markdown
69
+
61
70
  (arbitrary file extensions)
62
71
 
63
72
  `magic-transmute file --input input.txt --output output.mjs --markdown`
64
73
 
65
-
66
74
  #### api examples
75
+
67
76
  ```javascript
68
77
  import transmute from '@magic/transmute'
69
78
 
@@ -85,47 +94,60 @@ console.log(magic)
85
94
  #### changelog
86
95
 
87
96
  ##### 0.0.1
97
+
88
98
  first release
89
99
 
90
100
  ##### 0.0.2
101
+
91
102
  update dependencies
92
103
 
93
104
  ##### 0.0.3
105
+
94
106
  fix cli
95
107
 
96
108
  ##### 0.0.4
109
+
97
110
  update @magic dependencies to use npm packages instead of github
98
111
 
99
112
  ##### 0.0.5
100
- * extract state from html and markdown files
101
- * allow usage of state variables in markdown and html
113
+
114
+ - extract state from html and markdown files
115
+ - allow usage of state variables in markdown and html
102
116
 
103
117
  ##### 0.0.6
104
- * pass options from LexLex to marked.Lexer
105
- * only implant state in html if it has not been passed as argument
106
- * correctly camelCase object keys for html tags
107
- * correctly merge passed state with in-file state for markdown and html
118
+
119
+ - pass options from LexLex to marked.Lexer
120
+ - only implant state in html if it has not been passed as argument
121
+ - correctly camelCase object keys for html tags
122
+ - correctly merge passed state with in-file state for markdown and html
108
123
 
109
124
  ##### 0.0.7 - broken
125
+
110
126
  remove commonjs support, node >= 13.5.0 required
111
127
 
112
128
  ##### 0.0.8
129
+
113
130
  export correct cli file
114
131
 
115
132
  ##### 0.0.9
133
+
116
134
  do not lowercase @magic-module names, some other minor changes
117
135
 
118
136
  ##### 0.0.10
137
+
119
138
  do not wrap @magic-modules in p tags
120
139
 
121
140
  ##### 0.0.11
122
- * remove eval from state injection function.
123
- * correctly handle both ${} and {{}} variables in markdown and html files.
141
+
142
+ - remove eval from state injection function.
143
+ - correctly handle both ${} and {{}} variables in markdown and html files.
124
144
 
125
145
  ##### 0.0.12
146
+
126
147
  state keys in ${} and {{ }} get trimmed... doh.
127
148
 
128
149
  ##### 0.0.13
150
+
129
151
  return originalState, which is the state derived from the markdown/html file.
130
152
  this allows @magic to use this state for individual pages when building them.
131
153
 
@@ -133,142 +155,192 @@ this allows @magic to use this state for individual pages when building them.
133
155
 
134
156
  ##### FULL @magic-module api available from markdown.
135
157
 
136
- * nested state variables in template strings eg {{state.test.deep.var}} now work.
137
- * replace parse5 with posthtml.
138
- * custom markdown and custom html renderers added.
139
- * @magic-modules in markdown and html can have keys that are arrays or objects now.
158
+ - nested state variables in template strings eg {{state.test.deep.var}} now work.
159
+ - replace parse5 with posthtml.
160
+ - custom markdown and custom html renderers added.
161
+ - @magic-modules in markdown and html can have keys that are arrays or objects now.
140
162
 
141
163
  ##### 0.0.15
164
+
142
165
  if the value of a ${state.variable} in a template string is an array, this array gets join(' ')ed
143
166
 
144
167
  ##### 0.0.16
168
+
145
169
  render/html: empty arrays and objects return an empty string.
146
170
 
147
171
  ##### 0.0.17
172
+
148
173
  render/markdown.codespan: do not show linenumbers for codespans.
149
174
 
150
175
  ##### 0.0.18
151
- * handle &quot; escapes.
152
- * string delimiters ', " AND ` in a string do not error, get escaped instead.
176
+
177
+ - handle &quot; escapes.
178
+ - string delimiters ', " AND ` in a string do not error, get escaped instead.
153
179
 
154
180
  ##### 0.0.19
155
- * actually escape multiple html entities in a string, not just the first occurrence
181
+
182
+ - actually escape multiple html entities in a string, not just the first occurrence
156
183
 
157
184
  ##### 0.0.20
185
+
158
186
  update dependencies
159
187
 
160
188
  ##### 0.0.21
189
+
161
190
  update dependencies
162
191
 
163
192
  ##### 0.0.22
193
+
164
194
  update prettier, @magic/cli
165
195
 
166
196
  ##### 0.0.23
197
+
167
198
  Link and Img do not get wrapped in a paragraph (anymore)
168
199
 
169
200
  ##### 0.0.24
201
+
170
202
  update marked and prettier
171
203
 
172
204
  ##### 0.0.25
205
+
173
206
  update dependencies
174
207
 
175
208
  ##### 0.0.26
176
- * bump required node version to 14.2.0
177
- * update dependencies
209
+
210
+ - bump required node version to 14.2.0
211
+ - update dependencies
178
212
 
179
213
  ##### 0.0.27
180
- * update dependencies
181
- * FIX: command line interface was broken.
214
+
215
+ - update dependencies
216
+ - FIX: command line interface was broken.
182
217
 
183
218
  ##### 0.0.28
184
- * update dependencies
185
- * move magic-modules/no-spy to devDependencies
186
219
 
187
- ##### 0.0.29
220
+ - update dependencies
221
+ - move magic-modules/no-spy to devDependencies
222
+
223
+ ##### 0.0.29
224
+
188
225
  update dependencies
189
226
 
190
- ##### 0.0.30
227
+ ##### 0.0.30
228
+
191
229
  update dependencies
192
230
 
193
231
  ##### 0.0.31
232
+
194
233
  update dependencies
195
234
 
196
- ##### 0.0.32
235
+ ##### 0.0.32
236
+
197
237
  update dependencies
198
238
 
199
239
  ##### 0.0.33
200
- * update dependencies
201
- * fix markdown html handling changes
202
240
 
203
- ##### 0.0.34
204
- * update dependencies
241
+ - update dependencies
242
+ - fix markdown html handling changes
243
+
244
+ ##### 0.0.34
245
+
246
+ - update dependencies
247
+
248
+ ##### 0.0.35
205
249
 
206
- ##### 0.0.35
207
250
  update dependencies
208
251
 
209
- ##### 0.0.36
252
+ ##### 0.0.36
253
+
210
254
  update dependencies
211
255
 
212
256
  ##### 0.0.37
213
- * bump required node version to 14.15.4
214
- * update dependencies
215
257
 
216
- ##### 0.0.38
258
+ - bump required node version to 14.15.4
259
+ - update dependencies
260
+
261
+ ##### 0.0.38
262
+
217
263
  update dependencies
218
264
 
219
- ##### 0.0.39
265
+ ##### 0.0.39
266
+
220
267
  update dependencies (marked)
221
268
 
222
269
  ##### 0.0.40
270
+
223
271
  update dependencies (posthtml-parser)
224
272
 
225
273
  ##### 0.0.41
274
+
226
275
  remove call to undefined cleanUrl from markdown.image
227
276
 
228
- ##### 0.0.42
277
+ ##### 0.0.42
278
+
229
279
  update dependencies
230
280
 
231
281
  ##### 0.0.43
232
- * if the array returned by transmute has a length of 1, return that item instead
233
- * update dependencies
282
+
283
+ - if the array returned by transmute has a length of 1, return that item instead
284
+ - update dependencies
234
285
 
235
286
  ##### 0.0.44
287
+
236
288
  do return arrays in all cases. adapt tests to accomodate for that
237
289
 
238
- ##### 0.0.45
290
+ ##### 0.0.45
291
+
239
292
  update dependencies
240
293
 
241
294
  ##### 0.0.46
295
+
242
296
  update dependencies to avoid circular dependencies in @magic/types
243
297
 
244
298
  ##### 0.0.47
299
+
245
300
  update dependencies
246
301
 
247
302
  ##### 0.0.48
303
+
248
304
  update dependencies
249
305
 
250
- ##### 0.0.49
306
+ ##### 0.0.49
307
+
251
308
  update dependencies
252
309
 
253
310
  ##### 0.0.50
311
+
254
312
  update dependencies
255
313
 
256
314
  ##### 0.0.51
315
+
257
316
  update dependencies
258
317
 
259
318
  ##### 0.0.52
319
+
260
320
  update dependencies
261
321
 
262
322
  ##### 0.0.53
323
+
263
324
  update dependencies
264
325
 
265
326
  ##### 0.0.54
327
+
266
328
  update dependencies
267
329
 
268
330
  ##### 0.0.55
331
+
269
332
  update dependencies
270
333
 
271
- ##### 0.0.56 - unreleased
334
+ ##### 0.0.56
335
+
336
+ update dependencies
337
+
338
+ ##### 0.0.57
339
+
340
+ update dependencies
341
+
342
+ ##### 0.0.58 - unreleased
343
+
272
344
  ...
273
345
 
274
346
  [npm-image]: https://img.shields.io/npm/v/@magic/transmute.svg
@@ -281,4 +353,3 @@ update dependencies
281
353
  [coveralls-url]: https://coveralls.io/github/magic/transmute
282
354
  [snyk-image]: https://snyk.io/test/github/magic/transmute/badge.svg
283
355
  [snyk-url]: https://snyk.io/test/github/magic/transmute
284
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic/transmute",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "author": "Wizards & Witches",
5
5
  "homepage": "https://magic.github.io/transmute",
6
6
  "license": "AGPL-3.0",
@@ -35,24 +35,24 @@
35
35
  "calls": "calls"
36
36
  },
37
37
  "dependencies": {
38
- "@magic/cases": "0.0.8",
39
- "@magic/cli": "0.0.42",
40
- "@magic/entities": "0.0.11",
41
- "@magic/log": "0.1.16",
42
- "@magic/types": "0.1.21",
43
- "marked": "4.0.15",
38
+ "@magic/cases": "0.0.9",
39
+ "@magic/cli": "0.0.44",
40
+ "@magic/entities": "0.0.13",
41
+ "@magic/log": "0.1.18",
42
+ "@magic/types": "0.1.23",
43
+ "marked": "4.2.12",
44
44
  "posthtml-parser": "0.11.0",
45
- "prettier": "2.6.2"
45
+ "prettier": "2.8.4"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@magic-modules/git-badges": "0.0.12",
49
49
  "@magic-modules/light-switch": "0.0.11",
50
- "@magic-modules/no-spy": "0.0.7",
50
+ "@magic-modules/no-spy": "0.0.8",
51
51
  "@magic-modules/pre": "0.0.11",
52
52
  "@magic-themes/docs": "0.0.14",
53
- "@magic/core": "0.0.141",
54
- "@magic/format": "0.0.41",
55
- "@magic/test": "0.2.12"
53
+ "@magic/core": "0.0.149",
54
+ "@magic/format": "0.0.51",
55
+ "@magic/test": "0.2.15"
56
56
  },
57
57
  "keywords": [
58
58
  "magic",