Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Fixed docs after separating XML and HTML languages.
Browse files Browse the repository at this point in the history
  • Loading branch information
pomek committed Jan 29, 2020
1 parent 221aac6 commit 2f26321
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/_snippets/features/code-block-custom-languages.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="snippet-custom-languages">
<p>Put some text in the <code>&lt;body&gt;</code>:</p>
<pre><code class="language-xml"><body>Hello world!</body></code></pre>
<pre><code class="language-html"><body>Hello world!</body></code></pre>
<p>Then set the font color:</p>
<pre><code class="language-css">body { color: red }</code></pre>
</div>
2 changes: 1 addition & 1 deletion docs/_snippets/features/code-block-custom-languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ClassicEditor
codeBlock: {
languages: [
{ language: 'css', label: 'CSS' },
{ language: 'xml', label: 'HTML/XML' }
{ language: 'html', label: 'HTML' }
]
}
} )
Expand Down
2 changes: 1 addition & 1 deletion docs/_snippets/features/code-block.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<textarea id="snippet-highlight">
&lt;h2>Getting started with CKEditor 5&lt;/h2>
&lt;p>First, create an HTML element with the initial content:&lt;/p>
&lt;pre>&lt;code class="language-xml">&lt;div id="editor">
&lt;pre>&lt;code class="language-html">&lt;div id="editor">
&lt;p&gt;Here goes the initial content of the editor.&lt;/p&gt;
&lt;/div>&lt;/code>&lt;/pre>

Expand Down
7 changes: 4 additions & 3 deletions docs/features/code-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ Each code block can be assigned a programming language. The language of the code
<pre><code class="language-javascript">window.alert( 'Hello world!' )</code></pre>
```

It is possible to configure which languages are available to the users. You can use the {@link module:code-block/codeblock~CodeBlockConfig#languages `codeBlock.languages`} configuration and define your own languages. For example, the following editor supports only two languages (CSS and XML/HTML):
It is possible to configure which languages are available to the users. You can use the {@link module:code-block/codeblock~CodeBlockConfig#languages `codeBlock.languages`} configuration and define your own languages. For example, the following editor supports only two languages (CSS and HTML):

```js
ClassicEditor
.create( document.querySelector( '#editor' ), {
codeBlock: {
languages: [
{ language: 'css', label: 'CSS' },
{ language: 'xml', label: 'HTML/XML' }
{ language: 'html', label: 'HTML' }
]
}
} )
Expand Down Expand Up @@ -166,13 +166,14 @@ The {@link module:code-block/codeblock~CodeBlock} plugin registers:
{ language: 'cpp', label: 'C++' },
{ language: 'css', label: 'CSS' },
{ language: 'diff', label: 'Diff' },
{ language: 'xml', label: 'HTML/XML' },
{ language: 'html', label: 'HTML' },
{ language: 'java', label: 'Java' },
{ language: 'javascript', label: 'JavaScript' },
{ language: 'php', label: 'PHP' },
{ language: 'python', label: 'Python' },
{ language: 'ruby', label: 'Ruby' },
{ language: 'typescript', label: 'TypeScript' },
{ language: 'xml', label: 'XML' }
]
```

Expand Down
3 changes: 2 additions & 1 deletion src/codeblock.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,14 @@ export default class CodeBlock extends Plugin {
* { language: 'cpp', label: 'C++' },
* { language: 'css', label: 'CSS' },
* { language: 'diff', label: 'Diff' },
* { language: 'xml', label: 'HTML/XML' },
* { language: 'html', label: 'HTML' },
* { language: 'java', label: 'Java' },
* { language: 'javascript', label: 'JavaScript' },
* { language: 'php', label: 'PHP' },
* { language: 'python', label: 'Python' },
* { language: 'ruby', label: 'Ruby' },
* { language: 'typescript', label: 'TypeScript' },
* { language: 'xml', label: 'XML' }
* ]
*
* **Note**: The first language defined in the configuration is considered the default one. This means it will be
Expand Down

0 comments on commit 2f26321

Please sign in to comment.