styledocco icon indicating copy to clipboard operation
styledocco copied to clipboard

Option for custom templates

Open leandono opened this issue 13 years ago • 14 comments

Hi, In the 0.6.x release, the option of custom resources (-s) disappears. In my particular case, i use this option for customize the template of the generated documentation (the docs.jade file) with some mayor changes (for example, other navigation, styles, etc).

I understand that the option overwrites core files of styledocco (like scripts or styles), but, in the other hand, the posibility of overwrite the template gives more flexibility to the app. So i think it would be a good idea add a option for custom templates (like -t docs.jade).

Regards

leandono avatar Aug 25 '12 15:08 leandono

The reasons I removed it were:

  1. I wasn't sure if anyone was using it
  2. I prefer good defaults (and forking) over extensive configurability and endless options
  3. I was afraid of having to spend time on bug reports from people who had customized their resources, instead of improving the default experience

That being said, I am now working on a new way of including the static resources. Everything will be done from within the template instead of in StyleDocco, so to replace all the things you'd only need to use a different template.

The client side scripts are also modular, so you could potentially leave out the file which controls the UI (dropdowns, search) and only include the one which generates the preview iframes.

Issue #3 above is still valid though, but I might add it as an option without documenting it prominently in the readme.

Thanks for your feedback and for helping make StyleDocco better!

jacobrask avatar Aug 28 '12 13:08 jacobrask

Wondering what the status is on this issue. Am able to hot swap the doc.jade and doc.css, but that is not ideal for distribution. Any way I can help?

kristoferjoseph avatar Mar 27 '13 02:03 kristoferjoseph

  1. I wasn't sure if anyone was using it - Everyone was! Give it back please

elisechant-iconic avatar May 06 '13 02:05 elisechant-iconic

@kristoferjoseph I've taken over maintenance of the current release. I can see @jacobrask's reluctance to support this feature. If we provide a switch to the user, I feel we should be able to support it. We can't support templates we don't know about.

That said, I like the idea of providing alternative themes at least to the extent of colour schemes. What were you using this feature for?

marrs avatar Jun 24 '13 23:06 marrs

I think we can make this work by publishing to a view object and supporting a default template. If a user is using his own custom template, we can still support his bug request so long as he can provide a dump of the view object. If the view object is correct, then it's not our problem.

#78 seems related

marrs avatar Jun 28 '13 13:06 marrs

:+1:

shannonmoeller avatar Jul 13 '13 18:07 shannonmoeller

+1 for this feature.

stephenhutchings avatar Aug 15 '13 08:08 stephenhutchings

+1, it's now a year ago :(

mmintel avatar Jan 13 '14 12:01 mmintel

Instead of waiting for this we went ahead and created Topdoc Allows you to use a flexible yaml commenting style as well as custom templates.

kristoferjoseph avatar Jan 13 '14 15:01 kristoferjoseph

+1, it's now a year ago :(

Well, it's just me working on it and it's not my only project. I welcome patches if you want to help out. Please add new functionality against the dev0.7 branch. If you've got any questions, please ask.

Incidentally, a lot of the work in that branch is with this issue in mind, so it hasn't been forgotten about by any means.

marrs avatar Jan 13 '14 16:01 marrs

Judging from https://github.com/jacobrask/styledocco/blob/dev0.7/src/gather.js on dev0.7 we could simply add a resourcesDir option. Reading the discussion above this sort of option has been removed though. So it seems wrong to simply readd it.

@marrs, since you are the only person working on this, what would you suggest:

  1. Add resourcesDir option back in.
  2. For starters simply add a template option for referencing a custom .jade template.

ghost avatar Mar 11 '14 08:03 ghost

Is this workable? What do I need to do here to get this going? I have sort of settled on styledocco, but without being able to modify the template I will look into retrofitting dgeni/ngdoc for sass. I don't want to do that if the custom template option is feasible with styledocco.

scottux avatar Jun 09 '14 19:06 scottux

I just went in and edited my version of styledocco (inside node_modules) to pull in a custom template.

tilomitra avatar Jan 22 '15 21:01 tilomitra

@tilomitra You should consider forking the project and submitting your changes as a pull request.

shannonmoeller avatar Jan 22 '15 21:01 shannonmoeller