Skip to content

aio: api page code snippets should be wrapped in <aio-code> #16246

Closed

Description

@sjtrimble

The API template does not render code blocks with the doc viewer's <aio-code> tags as happens when guide authors write <code-example> and <code-tabs>.

Therefore, API code snippets are not pretty-printed and rendered as they are in the guide pages. The likely solution is for dgeni to transform those snippets appropriately.

Tangentially, what would dgeni do if an author used backtick markdown inside a guide page rather than the prescribed <code-example> (or <aio-code>) technique?

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
Unable to style api page code snippets

Expected behavior
To use <aio-code> component for consistency across the site

Activity

  1. changed the title [-]aio: api page code snippets[/-] [+]aio: api page code snippets should be wrapped in <aio-code>[/+] on Apr 21, 2017
  2. Foxandxss commented on Apr 23, 2017

    @Foxandxss
    Member

    What dgeni does (Pete correct me if I am wrong) is parsing the code file to extract stuff (no idea how, reflection perhaps) and then with a template, it generates a <code> tag with the content inside.

    Not sure if we can put embedded components in those templates.

  3. petebacondarwin commented on Apr 24, 2017

    @petebacondarwin
    Contributor

    I think we need to change the current rendering for {@example } inline tags. (Really we should remove them all and just use code-example tags.

    Regarding triple back tick blocks. I am not sure. I'll have to check :-)

  4. petebacondarwin commented on Apr 29, 2017

    @petebacondarwin
    Contributor

    It appears to me that all the {@example ... } blocks are being rendered correctly.
    I'll fix the triple backticks

  5. added a commit that references this issue on Apr 29, 2017
    3cff741
  6. Foxandxss commented on Apr 29, 2017

    @Foxandxss
    Member

    It is not the fact that we are using {@example ...} correctly. Is stuff like class overview that is generating a custon code tag and not an @example

  7. added a commit that references this issue on Apr 30, 2017
    f32bfcd
  8. added a commit that references this issue on Aug 11, 2017
    a4850e3
  9. added a commit that references this issue on Aug 28, 2017
    1851e61
  10. angular-automatic-lock-bot commented on Sep 11, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  11. locked and limited conversation to collaborators on Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions