Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Add support to SyntaxTree 6 and Mermaid.js #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Revert unecessary change in Rakefile, simplify the default example in…
… docs/index.html and initialize select disabled til the page loads
  • Loading branch information
wenderjean committed Feb 20, 2023
commit 43fbf65a1e102860d2b43e16d48ba4fa5e97bd26
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ file "head-wasm32-unknown-wasi-full-js" do
version = JSON.parse(File.read("package.json"))["dependencies"]["ruby-head-wasm-wasi"][1..]
filename = "ruby-head-wasm32-unknown-wasi-full-js.tar.gz"

`curl -LO https://github.com/ruby/ruby.wasm/releases/download/ruby-head-wasm-wasi-#{version}/ruby-head-wasm32-unknown-wasi-full-js.tar.gz`
`curl -LO https://github.com/ruby/ruby.wasm/releases/download/ruby-head-wasm-wasi-#{version}/#{filename}`
`tar xfz #{filename}`
rm filename
end
Expand Down
10 changes: 2 additions & 8 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,14 @@ <h1>Syntax Tree</h1>
<span><button type="button" id="format" disabled>Format</button></span>

<div class="toggles">
<select>
<select disabled>
<option value="prettyPrint">AST</option>
<option value="disasm">ISEQ</option>
<option value="mermaid">GRAPH</option>
</select>
</div>
</nav>
<textarea id="editor">
SyntaxTree::Binary[
left: SyntaxTree::Int[value: "1"],
operator: :+,
right: SyntaxTree::Int[value: "1"]
]
</textarea>
<textarea id="editor">1 + 2 * 3</textarea>
<textarea id="output" disabled readonly>Loading...</textarea>
<div id="graph-container" class="graph-container"></div>
</main>
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,6 @@ Promise.all([
format.addEventListener("click", () => {
editor.setValue(ruby.format(editor.getValue()));
});

toggles.querySelector("select").removeAttribute('disabled');
});