balthazar / ng-markdown

:memo: [DEPRECATED] Markdown directive for AngularJS
http://apercu.github.io/ng-markdown/
MIT License
12 stars 1 forks source link

Readonly view? #18

Closed staxmanade closed 9 years ago

staxmanade commented 10 years ago

Love this angular plugin so far. Easy to install and use...

Is there an easy way to get a 'preview' read-only view of the markdown?

I have one page for general input of markdown (where I want both the editor and preview), but on subsequent pages I only want to see the markdown in a read-only mode. Is this possible with ng-markdown?

Thanks for your efforts.

balthazar commented 10 years ago

Hi, always nice to ear that :cat:

I have planed to create one filter and one service to render the markdown, I don't think it will be enough because of the syntax highlight and general stylish, but that sound like a good idea to have a only preview directive.

I'll work on it this week and the next, but if you want to help it's always welcome ;)

staxmanade commented 10 years ago

:+1:

balthazar commented 10 years ago

Can you please checkout on the develop branch and give me some feedback about this ? ;)

{{ bind | ngMarkdown }}

ngMarkdown.get('**strong**');

<ng-markdown-preview ng-model="bind"></ng-markdown-preview>
staxmanade commented 10 years ago

Thanks for the quick turn-around... I won't be able to verify for a couple days. Based on a quick glance of the changes and your sample comment above - I like it. Thanks @Apercu

balthazar commented 10 years ago

Okay, will try it a little more and create tests to pass this as a new release :)

staxmanade commented 9 years ago

Hey @Apercu,

I started playing with the new preview work. Overall, it appears to be working fine. I noticed a couple issues while playing with it I hope you wouldn't mind taking a deeper look into...

In the following plnkr.co: http://plnkr.co/edit/tIemN29tiNuH1qOZk27J?p=preview

I'm seeing the following issues:

1: there is some javascript replace error - but it still seems to work. Should probably dig into this and why the error...

TypeError: Cannot read property 'replace' of undefined
    at makeHtml (https://rawgit.com/Apercu/ng-markdown/develop/dist/ng-markdown.js:325:24)
    at Object.get (https://rawgit.com/Apercu/ng-markdown/develop/dist/ng-markdown.js:14:28)
    at https://rawgit.com/Apercu/ng-markdown/develop/dist/ng-markdown.js:145:43
    at https://code.angularjs.org/1.2.25/angular.js:14304:28
    at completeOutstandingRequest (https://code.angularjs.org/1.2.25/angular.js:4397:10)
    at https://code.angularjs.org/1.2.25/angular.js:4705:7 

2: The un-minified css has a reference to a .map error causing a failed lookup.

https://raw.githubusercontent.com/Apercu/ng-markdown/develop/dist/ng-markdown.css.map 404 (Not Found) 
balthazar commented 9 years ago

I think your two issues should be good now, will go for the tests, feel free to tell me if you spot anything else ;)

staxmanade commented 9 years ago

:+1: Thanks for the quick turn-around.

balthazar commented 9 years ago

Active since release 2.4.0 (https://github.com/Apercu/ng-markdown/commit/045d8a8177e5e9dee0ee05b37db9c02d20177b1f) !