Commit ad8d4868 authored by Dan Allen's avatar Dan Allen Committed by Guillaume Grossetie
Browse files

move code sample for interactive editor to pages/index.adoc

parent 931aab05
......@@ -86,7 +86,8 @@ class DocumentModelConverter {
contents: tabContentBlocks.map((b) => b.convert()).join('\n')
})
}
} else if (sectionBlock.getId() === 'editor-code') {
contents.code = sectionBlock.getSource()
} else if (sectionBlock.getContext() === 'open' && sectionBlock.getRoles().includes('card')) {
cards.push({
contents: sectionBlock.convert()
......
......@@ -77,7 +77,9 @@
<a id="toggle1_preview">Preview</a>
</div>
<div class="content" id=editor>
<div class="is-active" aria-labelledby="toggle1_asciidoc" id="editorCode"></div>
<div class="is-active" aria-labelledby="toggle1_asciidoc" id="editorCode">
<pre style="display: none">{{ content['try-it-out'].contents.code }}</pre>
</div>
<div aria-labelledby="toggle1_preview" id="editorPreview"></div>
</div>
</div>
......
......@@ -8,23 +8,9 @@ import hljs from 'highlight.js'
export function init () {
const processor = Asciidoctor()
const input = `= Hello, AsciiDoc!
This is an interactive editor.
Use it to try https://asciidoc.org[AsciiDoc].
== Section Title
* list item 1
* list item 2
[,ruby]
----
puts 'Hello, World!'
----`
const editor = document.getElementById('editorCode')
const input = editor.firstElementChild.innerText
editor.innerHTML = ''
const editorPreview = document.getElementById('editorPreview')
const state = EditorState.create({
doc: input,
......
......@@ -96,6 +96,24 @@ Start a line with a series of equal signs to make a section title.
Prefix text with an asterisk to make an item in a list.
[.attn]#Try it out below to see for yourself!#
[#editor-code,asciidoc]
------
= Hello, AsciiDoc!
This is an interactive editor.
Use it to try https://asciidoc.org[AsciiDoc].
== Section Title
* A list item
* Another list item
[,ruby]
----
puts 'Hello, World!'
----
------
[#compare.compare]
== How AsciiDoc stacks up: Compare AsciiDoc against alternative document formats
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment