Przeglądaj źródła

Docs: Created the custom build example. Closes #669.

Aleksander Nowodzinski 7 lat temu
rodzic
commit
3544e32a1b

+ 7 - 0
docs/_snippets/examples/custom-build.html

@@ -0,0 +1,7 @@
+<div id="snippet-custom-build">
+	<p>Best time to visit the city is <i>July and August</i>, when it’s cool enough to <u>not</u> break a sweat and hot enough to <mark class="marker-yellow">enjoy summer</mark>. The city which has quite a combination of both old and modern textures is located by the river of <code>Vistula</code>.</p>
+
+	<p>The historic <strong>Old Town</strong>, which was <mark class="pen-red"><s>reconstructed</s></mark> after the World War II, with its late <code>18th</code> century characteristics, is a must-see. You can start your walk from the <strong>Nowy Świat Street</strong> which will take you straight to the Old Town.</p>
+
+	<p>Then you can go to the <strong>Powiśle</strong> area and take a walk on the newly renovated promenade on the riverfront. There are also lots of cafes, bars and restaurants where you can shake off the exhaustion of the day. On Sundays, there are many parks where you can enjoy nature or <u>listen to pianists</u> from around the world playing Chopin.</p>
+</div>

+ 42 - 0
docs/_snippets/examples/custom-build.js

@@ -0,0 +1,42 @@
+/**
+ * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* globals console, window, document */
+
+import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
+import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
+import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
+import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
+import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
+import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
+import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
+import Code from '@ckeditor/ckeditor5-basic-styles/src/code';
+import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight';
+
+import { TOKEN_URL } from '@ckeditor/ckeditor5-cloudservices/tests/_utils/cloudservices-config';
+
+ClassicEditor
+	.create( document.querySelector( '#snippet-custom-build' ), {
+		plugins: [
+			Essentials,
+			Paragraph,
+			Bold,
+			Italic,
+			Underline,
+			Strikethrough,
+			Code,
+			Highlight
+		],
+		toolbar: [ 'bold', 'italic', 'underline', 'strikethrough', 'code', '|', 'highlightDropdown', '|', 'undo', 'redo' ],
+		cloudServices: {
+			tokenUrl: TOKEN_URL
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err );
+	} );

Plik diff jest za duży
+ 10 - 0
docs/examples/builds/custom-build.md