Skip to content
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

Syntax highlighting, theme and autocomplete #824

Open
thefubon opened this issue Nov 29, 2021 · 0 comments
Open

Syntax highlighting, theme and autocomplete #824

thefubon opened this issue Nov 29, 2021 · 0 comments

Comments

@thefubon
Copy link

thefubon commented Nov 29, 2021

Please tell me how to add these: syntax highlighting, theme and autocomplete.
Here is my code:

<link rel="stylesheet" href="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<script src="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>

<textarea id="MyID" name="content"><?= @$data['content'] ?></textarea>

// SimpleMDE Config
var simplemde = new SimpleMDE({
  element: document.getElementById("MyID"),
  //autofocus: true,
  //lineWrapping: false,
  placeholder: "Type here...",
  renderingConfig: {
	  singleLineBreaks: false,
	  codeSyntaxHighlighting: true,
  },
  toolbar: ["preview", "side-by-side", "fullscreen"],
});

How do I add my own styles and scripts inside the editor so that it doesn't affect global styles?
Example:

var simplemde = new SimpleMDE({
  css: https://cdn.jsdelivr.net/npm/uikit@3.9.4/dist/css/uikit.min.css
  js: https://cdn.jsdelivr.net/npm/uikit@3.9.4/dist/js/uikit.min.js
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant