Skip to content

Commit

Permalink
Update website
Browse files Browse the repository at this point in the history
  • Loading branch information
FIameCaster committed Mar 26, 2024
1 parent fc8c568 commit c348cbb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h2>Advanced usage</h2>
<p>With little effort, you can fully customize which extensions are added and how they're loaded.</p>
<div style="height:45.4rem"></div>
<p>To minimize your main javascript bundle, you can dynamically import extensions.</p>
<div style="height:49.4rem"></div>
<div style="height:47.4rem"></div>

<h2>Web components</h2>
<p>The library includes a custom element wrapper for each of the 4 setups you can import.</p>
Expand Down
10 changes: 7 additions & 3 deletions website/src/dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import "prism-code-editor/search.css"
import "prism-code-editor/copy-button.css"
import "prism-code-editor/code-folding.css"
import "prism-code-editor/rtl-layout.css"
import "prism-code-editor/languages"
import "prism-code-editor/languages/clike"
import "prism-code-editor/languages/css"
import "prism-code-editor/languages/html"
import "prism-code-editor/languages/jsx"
import "prism-code-editor/languages/python"
import "prism-code-editor/languages/xml"
import "prism-code-editor/prism/languages/markup"
import "prism-code-editor/prism/languages/css-extras"
import "prism-code-editor/prism/languages/js-templates"
Expand Down Expand Up @@ -163,7 +168,7 @@ runBtn.onclick = () => {
runBtn.setAttribute("aria-hidden", "true")
let options: any
try {
options = new Function(currentOptions + ";return options")()
options = new Function(currentOptions + "\n;return options")() || {}
} catch (error) {
errorEl.removeAttribute("aria-hidden")
errorMessage.textContent = <string>error
Expand All @@ -172,7 +177,6 @@ runBtn.onclick = () => {

let newEditor: PrismEditor
try {
// Creating a new editor instead of
newEditor = makeEditor(false, options)
} catch (error) {
errorEl.removeAttribute("aria-hidden")
Expand Down
4 changes: 1 addition & 3 deletions website/src/examples2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ import('./extensions')`,
`// extensions.ts
import "prism-code-editor/search.css"
import "prism-code-editor/copy-button.css"
import "prism-code-editor/languages/html"
import "prism-code-editor/languages/clike"
import "prism-code-editor/languages/css"
import "prism-code-editor/languages"
import { searchWidget, highlightSelectionMatches } from "prism-code-editor/search"
import { defaultCommands, editHistory } from "prism-code-editor/commands"
Expand Down

0 comments on commit c348cbb

Please sign in to comment.