grunt-ngdocs icon indicating copy to clipboard operation
grunt-ngdocs copied to clipboard

Inline partials not embeeded correctly

Open cheplv opened this issue 8 years ago • 4 comments

Resolve inline partials multiple tasks bug when generates same index.html multiple times - embedded partials are cleaned.

cheplv avatar Apr 22 '16 09:04 cheplv

I don't understand the problem this solves, could you please give an example how to reproduce?

m7r avatar Apr 24 '16 10:04 m7r

As an example of configuration: options.inlinePartials = true;

Embeds all generated documents as script in body. When you have more than one ngdoc task - then index.html is rewriten from template instead of add new templates after body tag.

Grunt task: tutorial : { src : [ 'content/tutorial/.ngdoc' ], title : 'WLC Tutorial' }, api : { src : [ 'src/core/__/.js', '!src/core//*.spec.js' ], title : 'WLC Core' }, themes : { src : [ 'src/themes//.js', '!src/themes/__/.spec.js' ], title : 'WLC Themes' }

cheplv avatar Apr 25 '16 11:04 cheplv

I see the problem. Your proposal works if you always run all ngdoc tasks together and always a new process.

if you build only a sub task there will be partials missing. if you will rebuild for example witch grunt-watch you get duplicate templates in the html.

I think the easiest solution is to keep the partials on the hard drive and always include all. The partials should be ignored in from version control (git). Thats a exercise for the user and could be added to the readme.

What do you think?

m7r avatar Apr 27 '16 06:04 m7r

I'll test all your mentioned configurations and try to make one single change, will look after. Another one error is when you have 2 tasks and you make both as API only first will render correctly - for others there will be like normal list rendering.

cheplv avatar Apr 27 '16 09:04 cheplv