-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
378 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,29 @@ | ||
|
||
## TypeScript types | ||
|
||
**See [Documentation](https://angezid.github.io/advanced-mark.js/doc-v1) for advanced-mark.js v1 on GitHub Pages.** | ||
|
||
|
||
The following TypeScript declaration files are added to `dist` folder: | ||
jquery.mark.d.ts | ||
jquery.mark.es6.d.ts | ||
jquery.mark.umd.d.ts | ||
mark.d.ts | ||
mark.es6.d.ts | ||
mark.umd.d.ts | ||
regexpcreator.d.ts | ||
regexpcreator.es6.d.ts | ||
regexpcreator.umd.d.ts | ||
* mark.d.ts | ||
* mark.es6.d.ts | ||
* jquery.mark.d.ts | ||
* jquery.mark.es6.d.ts | ||
* regexpcreator.d.ts | ||
* regexpcreator.es6.d.ts | ||
|
||
### Simple example | ||
``` js | ||
import Mark from 'advanced-mark.js/dist/mark.js'; | ||
|
||
new Mark(document.querySelector("article")).mark(['lorem','ipsum'], {}); | ||
``` | ||
**Note:** the default imported library is ES6 module -`mark.es6.js`, to import others you need to specify the full path, | ||
e.g. `import 'advanced-mark.js/dist/jquery.mark.js';`. | ||
|
||
### jQuery example | ||
#### JavaScript example | ||
``` js | ||
import "jquery/dist/jquery.js"; | ||
import Mark from 'advanced-mark.js/dist/jquery.mark.js'; | ||
// imported 'mark.es6.js' library | ||
import Mark from 'advanced-mark.js'; | ||
|
||
$("article").mark(['lorem','ipsum'], {}); | ||
new Mark(document.querySelector("article")).mark('lorem ipsum', {}); | ||
``` | ||
|
||
### RegExpCreator example | ||
#### jQuery example | ||
``` js | ||
import regCreator from 'advanced-mark.js/dist/regexpcreator.js'; | ||
import $ from 'jquery'; | ||
import 'advanced-mark.js/dist/jquery.mark.js'; | ||
|
||
console.log('Using create method ', new regCreator().create('lorem', true)); | ||
console.log('Using createDiacritics method ', new regCreator().createDiacritics('lorem')); | ||
console.log('Using createCombinePattern method ', new regCreator().createCombinePattern(['lorem', 'ipsum'], true)); | ||
$("article").mark('lorem ipsum', {}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.