1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 20:51:20 +02:00

change a few examples to omit ranges for cleanliness

This commit is contained in:
Ian Storm Taylor
2016-07-21 16:41:35 -07:00
parent 53c57c40d9
commit 6993b0c666
5 changed files with 17 additions and 85 deletions

View File

@@ -6,13 +6,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "The editor gives you full control over the logic you can add. For example, it's fairly common to want to add markdown-like shortcuts to editors. So that, when you start a line with \"> \" you get a blockquote that looks like this:"
}
]
}
]
},
{
"kind": "block",
@@ -20,13 +16,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "A wise quote."
}
]
}
]
},
{
"kind": "block",
@@ -34,13 +26,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "Order when you start a line with \"## \" you get a level-two heading, like this:"
}
]
}
]
},
{
"kind": "block",
@@ -48,13 +36,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "Try it out!"
}
]
}
]
},
{
"kind": "block",
@@ -62,13 +46,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "Try it out for yourself! Try starting a new line with \">\", \"-\", or \"#\"s."
}
]
}
]
}
]
}

View File

@@ -6,13 +6,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "There are certain behaviors that require rendering dynamic marks on string of text, like rendering code highlighting. For example:"
}
]
}
]
},
{
"kind": "block",
@@ -20,13 +16,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "// A simple FizzBuzz implementation.\nfor (var i = 1; i <= 100; i++) {\n if (i % 15 == 0) {\n console.log('Fizz Buzz');\n } else if (i % 5 == 0) {\n console.log('Buzz');\n } else if (i % 3 == 0) {\n console.log('Fizz');\n } else {\n console.log(i);\n }\n}"
}
]
}
]
},
{
"kind": "block",
@@ -34,13 +26,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "Try it out for yourself!"
}
]
}
]
}
]
}

View File

@@ -6,11 +6,7 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "In addition to nodes that contain editable text, you can also create other types of nodes, like images or videos."
},
]
}
]
},
@@ -24,13 +20,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": ""
}
]
}
]
},
{
"kind": "block",
@@ -38,13 +30,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "This example shows images in action. It features two ways to add images. You can either add an image via the toolbar icon above, or if you want in on a little secret, copy an image URL to your keyboard and paste it anywhere in the editor!"
}
]
}
]
}
]
}

View File

@@ -6,12 +6,8 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "In addition to block nodes, you can create inline nodes, like "
},
]
},
{
"kind": "inline",
"type": "link",
@@ -21,21 +17,13 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "hyperlinks"
},
]
},
]
},
{
"kind": "text",
"ranges": [
{
"text": "!"
},
]
}
]
},
@@ -45,13 +33,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "This example shows hyperlinks in action. It features two ways to add links. You can either add a link via the toolbar icon above, or if you want in on a little secret, copy a URL to your keyboard and paste it while a range of text is selected."
}
]
}
]
}
]
}

View File

@@ -6,13 +6,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "By default, pasting content into a Slate editor will use the content's plain text representation. This is fine for some use cases, but sometimes you want to actually be able to paste in content and have it parsed into blocks and links and things. To do this, you need to add a parser that triggers on paste. This is an example of doing exactly that!"
}
]
}
]
},
{
"kind": "block",
@@ -20,13 +16,9 @@
"nodes": [
{
"kind": "text",
"ranges": [
{
"text": "Try it out for yourself! Copy and paste some HTML content from another site into this editor."
}
]
}
]
}
]
}