storybook-readme icon indicating copy to clipboard operation
storybook-readme copied to clipboard

Angular Support

Open amcdnl opened this issue 7 years ago • 16 comments

Storybook now supports Angular, as such it would be awesome if this library were to implement it too.

amcdnl avatar Jan 09 '18 14:01 amcdnl

Yeah, I am going to add Angular support a bit later

tuchk4 avatar Jan 10 '18 14:01 tuchk4

It actually works, should probably just update readmes.

amcdnl avatar Jan 10 '18 18:01 amcdnl

@amcdnl how you make it work I got error import README1 from '../src/framework/content/README1.md'; error TS2307: Cannot find module '../src/framework/content/README1.md'. image

amorenew avatar Jan 31 '18 12:01 amorenew

Add this:

declare module '*.md';

amcdnl avatar Jan 31 '18 14:01 amcdnl

@amcdnl in wepback or where I add this line if it is in webpack could you share it?

amorenew avatar Jan 31 '18 14:01 amorenew

No, just in a root ts file.

amcdnl avatar Feb 01 '18 14:02 amcdnl

@amcdnl Is it work correctly? Seems withDocs method can not work :) only withReadme

tuchk4 avatar Feb 20 '18 13:02 tuchk4

Hey,

withReadme works just fine, but withDocs seems to break for me as well.

MatissJanis avatar Mar 16 '18 11:03 MatissJanis

@tuchk4 do you have any updates on fully support for Angular?

andrei-ilyukovich avatar Sep 10 '18 13:09 andrei-ilyukovich

Also it would be fine to have support for highlighting typescript blocks of code, most of the angular, react projects use this language. As far as I understand it is quite simple to just add import 'prismjs/components/prism-typescript'; in highlite.js file. What do you think, @tuchk4 ?

andrei-ilyukovich avatar Sep 11 '18 11:09 andrei-ilyukovich

@andrei-ilyukovich right now I have no time to update code to fully support angular.

But I would be happy for any help.

tuchk4 avatar Sep 12 '18 13:09 tuchk4

+1

stewones avatar Dec 02 '18 21:12 stewones

Thank you for considering adding support for Angular. I wish I had the skills to add support, but unfortunately no can do. If anyone will try their hand at this, you have a fan right here! I would also just appreciate a example snippet or a PR made to the readme on how to use it in Angular, if (part of it) already works :) @amcdnl

anneke avatar Dec 05 '18 14:12 anneke

Using with .addDecorator(withReadme(MyComponent)) I got this error :

storybook-readme: wrong arguments
    Error: storybook-readme: wrong arguments
    at http://localhost:9001/static/iframe.bundle.js:195912:15
    at Object.withReadme (http://localhost:9001/static/iframe.bundle.js:195918:70)
    at Object.<anonymous> (http://localhost:9001/static/iframe.bundle.js:202257:38)
    at Object../src/app/components/menu-applications/applications-menu.stories.ts (http://localhost:9001/static/iframe.bundle.js:202293:30)
    at __webpack_require__ (http://localhost:9001/static/iframe.bundle.js:725:30)
    at fn (http://localhost:9001/static/iframe.bundle.js:102:20)
    at webpackContext (http://localhost:9001/static/iframe.bundle.js:201761:9)
    at http://localhost:9001/static/iframe.bundle.js:828:12
    at Array.forEach (<anonymous>)

My code is like this:

storiesOf('ApplicationMenu', module)
   .addDecorator(moduleMetadata({ ... })
   .addDecorator(withReadme(MyComponent))
   .add('Basic', () => ({ ... }));

danielpcampagna avatar Dec 07 '18 10:12 danielpcampagna

the first parameter passed to the withReadme, should be your readme file, not your component.
doc. @danielpcampagna

blinkcat avatar Dec 16 '18 03:12 blinkcat

Is the full Angular support completed ?

athergeek avatar Mar 10 '22 21:03 athergeek