senchalabs / jsduck

Simple JavaScript Duckumentation generator.
http://docs.sencha.com/
GNU General Public License v3.0
1.5k stars 238 forks source link

Custom "inline" tags for Guides #677

Open mbajolek opened 6 years ago

mbajolek commented 6 years ago

I haven't found a way to inject (via --tags) option custom guide tag handler. Currently the https://github.com/senchalabs/jsduck/wiki/Guides says about two custom guide tags: {@img and {@link ...

I would like to create a few custom tags e.g.: {@pdf that would expand into:

<object width="100%" height="100%" data="" type="application/pdf"> <embed src="" type="application/pdf" /></object>

or even more generic such {@html ... as html passthrough section.

Is there any way to achieve it with current implementation?

nene commented 6 years ago

Unfortunately not. The custom tags support only allows defining non-inline tags. And inside guides one can only use the inline tags.

mbajolek commented 6 years ago

so how about adding a new custom/inline tag, let's say quite generic to address all other cases aka: passthrough tag/macro?

{@pass
   <any HTML content>
}

e,g,:

{@pass
   <iframe src="http://my.embedded.site.com"></iframe>
}

I know it's kind of hack but sometimes you don't have a choice :) I'm trying to model it based on AsciiDoctor Passthrough pattern (or rather antipattern)