meteor-ghostdown icon indicating copy to clipboard operation
meteor-ghostdown copied to clipboard

How to init the body content for ghostdown?

Open haunguyen90 opened this issue 9 years ago • 3 comments

Hi Jeremy,

This is a great project for markdown code There's one little thing that I can't figure out: How to init the body content for ghostdown? I use your project to create a blog, so when I edit a blog how can I render the body content, I used set Session for ''editor-markdown" and "editor-html", but it not work

I'm looking forward to hearing from you thank you

haunguyen90 avatar May 10 '15 18:05 haunguyen90

You can grab the markdown, html, and word count with the following session variables:

Session.get('editor-markdown'); 
Session.get('editor-html');
Session.get('editor-word-count'); 

At that point, it's up to you to insert the content into your database. This package is just the editor functionality.

You can test the session variables on the demo page. Just type something in the markdown pane and then open your browser console and run any of the Session.get() lines above. They should output each of those values to the console.

jshimko avatar May 10 '15 20:05 jshimko

hi, I think you missunderstood me example, I use ghostdown editor to create a blog, then I use Session.get('editor-html') to get content then I save it to database. when I edit this blog, I want this content auto fill to markdown area then I can continue edit blog. I used Session.set('editor-markdown', myHtml), but It didn't show my content to markdown area so Would you like show me how to do that? thank you

haunguyen90 avatar May 11 '15 04:05 haunguyen90

Yes, I am facing the same problem: How to preload content for ghostdown editor. Just for example, the other editor package epic have the function: http://epiceditor.meteor.com/preload

BTW, I really like the style ghostdown presents.

vampirefan avatar May 22 '15 03:05 vampirefan