Support of <table> and other HTML elements

In our internal docs we used HTML <table> tags such as

        <tr><th>Heading example</th></tr>
        <tr><td>Some value</td></tr>

When DocC generates the archive and webpages, they seem to be missing. Then I tried to swap them with Markdown-syntax tables, and they display correctly.


  • Is the raw HTML <table> tag supported in DocC?
  • Does DocC support other HTML tags?

Thank you.

Raw HTML is not supported in docc, as I understand it. There was discussion at some point for special-casing <sup> and <sub>, but that's it.

1 Like

As far as I can tell, DocC will strip most HTML tags (as well as their children), and for other tags children can be rendered as plain text without styling. I've written a few special rules to automatically transform common HTML tags into Markdown, including <table>.

Thanks for your answers!
It would be helpful if the DocC team can provide a list of supported syntax for Apple's documentation markup so there's less guessing game. :slightly_smiling_face:

The current source of truth for this is here: Formatting your documentation content. But I agree it doesn't do a great job of fully specifying the syntax. @ronnqvist and @sofiaromorales have both been spending time recently thinking about how to improve the overall documentation story for Swift-DocC and that page has definitely come under scrutiny.

If there are specific things you'd like to see improved, filing a GitHub issue on the repo is always appreciated.

But yes, as has been written above in this thread, DocC doesn't support HTML markup, with the exception of HTML comments.