Commit ce64163
Parser refactor (#43)
* rename and add new examples per template
* Remove unrequired plugin
Not required in fact.
`gitbook-plugin-ace` is required only if user pass "ace" or "acefull" to the template
option. It is specified in the README.md.
* Update readme
* Add check plugin load order
- Add winston-color for color logs
- produce a warning if gitbook-plugin-ace is not loaded (ace template won't work)
- produce an error if gitbook-plugin-ace is loaded but before include-codeblock
* update log message
* update travis tests
* Fix Readme
* use path package
* separate ace check
* Improve example
* Improve custom example
* Improve default example
* Refactor parser
- Should be cleaner and less error prone
- Define global book option map, and possible key-value map (same as in
readme).
- Use immutable Map to avoid unwanted changes.
- Pass `template`, `unindent` function arguments into the key-value map
directly for consistency.
- Systemize key-value argument for each functions.
* Add inline code remark
- include-codeblock does not work if we use it inline.
for example:
```
blabla [import](fixtures/test.js) blablabla
```
NB: we might have some works to add newline before and after block.
* Update tests
* Remove log
* up package version
* Add multi snippets feature
* Update test using templates from map
* Add support equal char for
* Fix template quotes + up version 3.1.0 major
- It seems ace does work with boolean instead of strings for booleans
type keys.
- Update version 3.1.0, changes will be major
* Update readme
* Rename options to avoid confusion
* Separate options maps
Options can be set globally or locally:
- Set an immutable default map book.json global plugin options
- Set an immutable default key-value map for local command options.
- Add functions to check map types
* Clean option file
* Move convertValue
* Refactor parser
- Refactor parseVariableFromCommand regex to be more comprehensible.
- Handle boolean type
- Add parse check depending on the value type and convert the parsed
value to its type (JSON.parse)
- Fix type check. Default l/g options map should not have `undefined`
value as value type is deduced from the map.
* Update marker check with empty string
- Update check for empty string which is not valid.
* Update package options
- Add default value options in package.json directly. Options map are
updated from it.
- Fix package default type to be consistent (avoid string). Now boolean
is `true` and not `"true"`.
* Revert options get
* Update + new test
- Update parse tests to handle better tests (simpler & different case).
- Add test for multiple markers
* Refactor lang key
break backward compatibility
- set hardcode lang as book option, or command option.
- Remove `lang-javascript` and use standard key-val format
`lang:"javascript"` or `lang:".js"`. If lang or extension (via lang) is not set,
then lang is determined rom file extension.
- Create template.js file for template specific codes.
* Add support of URL (sync)
issue #42
- Perform http GET request and retrieve url body.
- Asynchronous http (module sync-request) with caching, gzip
- Redirection not allowed.
NB: Future optimization could be to provide async operation for the
plugin.
* Update readme
* Update readme
* Remove immutable.js
- Remove immutable package
- Remove Map object to use frozen Object instead (guaranty unmodified
default map object).
- Update tests.
* Remove parser feature
- Remove URL parser source code (different branch + need update async)
- Remove URL parser test
- Remove package.json dependencies
* Add Eslint config #39 + fix coding style
See issue #39
- Use this convention https://github.com/textlint/textlint/blob/master/.eslintrc.js
- Change Error to Warn for unused vars and allow console logs.
- Add new package script : check => run eslint for javascript files in src/ and test/.
(Do not add test/fixtures, test/patterns, ...).
- Add travis eslint check.
* add eslint config
* Update reviewed code1 parent eda1d7a commit ce64163
File tree
73 files changed
+1119
-496
lines changed- examples
- ace
- custom
- default
- src
- templates
- test
- patterns
- import-ace-template
- import-acefull-template
- import-book-command-options
- import-book-options
- import-cpp-bug-workaround
- import-custom-template
- import-exlixir-extension
- import-exlixir-extenstion
- import-hardcode-not-found-warn
- import-hardcode-not-found
- import-hardcode
- import-labels-ace
- import-only
- import-rust-extension
- import-rust-extenstion
- import-slice-only-first
- import-slice-only-last
- import-slice
- import-snippet-inner
- import-snippet-multi
- import-snippet
- import-title
- import-unindent
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
73 files changed
+1119
-496
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
0 commit comments