Skip to content

Commit

Permalink
Revert "feat: Native emoji w/ image-based fallbacks and improved pars…
Browse files Browse the repository at this point in the history
…ing (#1746)"

This reverts commit d50d1a1.
  • Loading branch information
Koooooo-7 committed Oct 26, 2022
1 parent 80908b9 commit e8b6a99
Show file tree
Hide file tree
Showing 18 changed files with 1,956 additions and 6,092 deletions.
3 changes: 1 addition & 2 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"sandboxes": ["2d17z"],
"packages": [".", "packages/docsify-server-renderer"],
"node": "16"
"packages": [".", "packages/docsify-server-renderer"]
}
91 changes: 0 additions & 91 deletions build/emoji.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
- [Write a Plugin](write-a-plugin.md)
- [Markdown configuration](markdown.md)
- [Language highlighting](language-highlight.md)
- [Emoji](emoji.md)

- Guide

Expand Down
90 changes: 6 additions & 84 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The config can also be defined as a function, in which case the first argument i

```html
<script>
window.$docsify = function (vm) {
window.$docsify = function(vm) {
return {
markdown: {
renderer: {
Expand Down Expand Up @@ -319,14 +319,14 @@ window.$docsify = {
markdown: {
smartypants: true,
renderer: {
link: function () {
link: function() {
// ...
},
},
},

// function
markdown: function (marked, renderer) {
markdown: function(marked, renderer) {
// ...
return marked;
},
Expand Down Expand Up @@ -398,97 +398,19 @@ window.$docsify = {

Note that if you are running an external script, e.g. an embedded jsfiddle demo, make sure to include the [external-script](plugins.md?id=external-script) plugin.

## nativeEmoji

- type: `Boolean`
- default: `false`

Render emoji shorthand codes using GitHub-style emoji images or platform-native emoji characters.

```js
window.$docsify = {
nativeEmoji: true,
};
```

```markdown
:smile:
:partying_face:
:joy:
:+1:
:-1:
```

GitHub-style images when `false`:

<output data-lang="output">
<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png" alt="smile">
<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/unicode/1f973.png" alt="partying_face">
<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/unicode/1f602.png" alt="joy">
<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png" alt="+1">
<img class="emoji" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44e.png" alt="-1">
</output>

Platform-native characters when `true`:

<output data-lang="output">
<span class="emoji">😄︎</span>
<span class="emoji">🥳︎</span>
<span class="emoji">😂︎</span>
<span class="emoji">👍︎</span>
<span class="emoji">👎︎</span>
</output>

To render shorthand codes as text, replace `:` characters with the `&colon;` HTML entity.

```markdown
&colon;100&colon;
```

<output data-lang="output">

&colon;100&colon;

</output>

## noEmoji

- type: `Boolean`
- default: `false`

Disabled emoji parsing and render all emoji shorthand as text.
Disabled emoji parse.

```js
window.$docsify = {
noEmoji: true,
};
```

```markdown
:100:
```

<output data-lang="output">

&colon;100&colon;

</output>

To disable emoji parsing of individual shorthand codes, replace `:` characters with the `&colon;` HTML entity.

```markdown
:100:

&colon;100&colon;
```

<output data-lang="output">

:100:

&colon;100&colon;

</output>
?> If this option is `false` but you don't want to emojify some specific colons, [refer to this](https://github.com/docsifyjs/docsify/issues/742#issuecomment-586313143)

## mergeNavbar

Expand All @@ -513,7 +435,7 @@ See https://github.com/lukeed/tinydate#patterns
window.$docsify = {
formatUpdated: '{MM}/{DD} {HH}:{mm}',

formatUpdated: function (time) {
formatUpdated: function(time) {
// ...

return time;
Expand Down
Loading

0 comments on commit e8b6a99

Please sign in to comment.