Skip to content

Commit 5c652d0

Browse files
committed
Update the README.md to include information about {@inject-html}
1 parent 16b6c84 commit 5c652d0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,32 @@ the equivalent of having the following comment in the code:
301301
/// # `This is the text that will be sent to the tool as input.`
302302
```
303303

304+
### Injecting HTML
305+
306+
It happens rarely, but sometimes what you really need is to inject some raw HTML
307+
into the dartdoc output, without it being subject to Markdown processing
308+
beforehand. This can be useful when the output of an external tool is HTML, for
309+
instance. This is where the `{@inject-html}...{@end-inject-html}` tags come in.
310+
311+
Since this HTML fragment doesn't undergo Markdown processing, reference links
312+
and other normal processing won't happen on the contained fragment.
313+
314+
So, this:
315+
```dart
316+
/// {@inject-html}
317+
/// <p>[The HTML to inject.]()</p>
318+
/// {@end-inject-html}
319+
```
320+
321+
Will result in this be emitted in its place in the HTML output (notice that the
322+
markdown link isn't linked).
323+
```
324+
<p>[The HTML to inject.]()</p>
325+
```
326+
327+
It's best to only inject HTML that is self-contained and doesn't depend upon
328+
other elements on the page, since those may change in future versions of Dartdoc.
329+
304330
### Auto including dependencies
305331

306332
If `--auto-include-dependencies` flag is provided, dartdoc tries to automatically add

0 commit comments

Comments
 (0)