GithubHelp home page GithubHelp logo

Comments (5)

R-Bower avatar R-Bower commented on June 27, 2024 1

This is not supported at the moment, and I am not yet sure if it will be. It is quite easy to add, but the main problem lies in the intersection of the Nunjucks and Angular APIs, which in theory can also be fixed. However, I am concerned about the numerous edge cases that may arise when implementing Angular components in this way, which I am unaware of. I am still thinking about this feature, and I might try to release it as an experimental feature for the builder.

In any case, I have added support for PageProcessor, which allows you to replace HTML elements with Angular components. Here are examples of internal page processors

@skoropadas The page processor approach can work so long as you don't need additional properties from the markdown. Could you expose a way for us to tap into the markdown-to-html process in the builder? There are use cases for extending this.

Here's an example use case:
My design system has a specific component for the inline-alert. In my React + MDX library, I've built a Vite plugin that parses the content with remark to add support for additional nodes.

One thing we support is github's beta alert system:

> [!note/Custom Title]
> Neat, a custom title

Which renders as:
image

I've tried overriding the ng-doc blockquote page processor, but there is no way for me to supply a custom title. I would need to tap into the markdown-to-html process in the builder to add support for an attribute like this.

As an aside, I'm very impressed with what you've done with this builder. It was a huge undertaking and it works beautifully.

from ng-doc.

skoropadas avatar skoropadas commented on June 27, 2024 1

@R-Bower Thank you very much! You are one of the longest-standing users, so your feedback is very important to me! ❤️

In fact, I am seriously trying to add support for using Angular components within Markdown. I think you know that currently, ng-doc simply renders markdown and then inserts it into the page using innerHTML. This generally works, but it makes it impossible to use Angular components directly, which is why I added Page Processors.

However, the problem is that Page Processors cause issues with SSR, as Angular does not support hydration for such dynamic content. Therefore, I would like to add support for Angular components in markdown in version 18 and deprecate Page Processors.

Regarding customization within markdown-to-html, I think I will migrate this function to the remark library and add the ability to pass custom plugins to it. But this will not happen before the release of version 18. The support for multiple markdown files for one page discussed in #24 forced a significant overhaul of the builder, which is actually for the better since it should become more stable.

In any case, I would ask you to create a ticket for plugin support for transforming markdown to HTML so that I can prioritize it and start working on it in the future.

from ng-doc.

skoropadas avatar skoropadas commented on June 27, 2024

This is not supported at the moment, and I am not yet sure if it will be. It is quite easy to add, but the main problem lies in the intersection of the Nunjucks and Angular APIs, which in theory can also be fixed. However, I am concerned about the numerous edge cases that may arise when implementing Angular components in this way, which I am unaware of. I am still thinking about this feature, and I might try to release it as an experimental feature for the builder.

In any case, I have added support for PageProcessor, which allows you to replace HTML elements with Angular components. Here are examples of internal page processors

from ng-doc.

akhileshThapliyal avatar akhileshThapliyal commented on June 27, 2024

This is not supported at the moment, and I am not yet sure if it will be. It is quite easy to add, but the main problem lies in the intersection of the Nunjucks and Angular APIs, which in theory can also be fixed. However, I am concerned about the numerous edge cases that may arise when implementing Angular components in this way, which I am unaware of. I am still thinking about this feature, and I might try to release it as an experimental feature for the builder.

In any case, I have added support for PageProcessor, which allows you to replace HTML elements with Angular components. Here are examples of internal page processors

Noted, thank you so much :). Ng Doc is awesome :). I will keep an eye on the future release and this thread to see when this feature will be available in the coming months :)

from ng-doc.

skoropadas avatar skoropadas commented on June 27, 2024

@akhileshThapliyal Thank you! Let's keep this ticket to track the status

from ng-doc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.