OscarGodson / EpicEditor

EpicEditor is an embeddable JavaScript Markdown editor with split fullscreen editing, live previewing, automatic draft saving, offline support, and more. For developers, it offers a robust API, can be easily themed, and allows you to swap out the bundled Markdown parser with anything you throw at it.
http://epiceditor.com
MIT License
4.25k stars 334 forks source link

What are the "scripts and assets"? #350

Closed ethel-dev closed 9 years ago

ethel-dev commented 9 years ago

I am only getting some text and 4 unlabeled buttons with EpicEditor quickstart? What are the "scripts and assets." Basically I'm asking what stylesheets and such I should add.

OscarGodson commented 9 years ago

If you load up EpicEditor without the assets your console should give you errors about the missing files and that way you can see where its looking for the files. For example:

index html 2014-12-14 01-36-00

To get EpicEditor running there's 5 files:

  1. Some HTML file that includes all the CSS and JS assets
  2. EpicEditor JS file
  3. A base CSS file
  4. A preview CSS file
  5. A editor CSS file

You can set the paths of the CSS files with the theme option. By default it looks in the path you see in the image above, but you can set it to whatever you want like:

var opts = {
  theme: {
    base: '/path/to/my/themes/base/epiceditor.css',
    preview: '/path/to/my/themes/preview/preview-dark.css',
    editor: '/path/to/my/themes/editor/epic-dark.css'
  }
}
var editor = new EpicEditor(opts);
ethel-dev commented 9 years ago

So what would my <head> look like? What scripts and stylesheets would it have?

OscarGodson commented 9 years ago

Your head would have nothing. Above the </body> tag you'd have the epiceditor.min.js file and thats it.

OscarGodson commented 9 years ago

It loads the CSS files which you see it trying to load and fail if you load the JS file and the CSS files aren't in the right place.

ethel-dev commented 9 years ago

It doesn't do anything, it still does the same thing.

OscarGodson commented 9 years ago

"it doesn't do anything" isn't much info. Can you give me a screenshot of your JS console?

ethel-dev commented 9 years ago

I fixed it.

ethel-dev commented 9 years ago

I needed my container to be empty, but instead I was putting the <script> in the container.

OscarGodson commented 9 years ago

:+1: