GithubHelp home page GithubHelp logo

Comments (5)

skoropadas avatar skoropadas commented on July 21, 2024 1

NgDoc also parses the content of each page after it has been converted to HTML. When I created the search functionality, I actually thought about what you were trying to do, and I decided that in the future, I would add a plugin system for the builder that would allow you to modify the original HTML or, in your case, use them as hooks to generate content for the search.

NgDoc itself generates indexes for lunr.js, which is fairly primitive, but it's sufficient in most cases. However, I also have plans to switch from lunr.js to lyra, which I think will improve the search functionality and also provide the ability to do what you're doing now without having to manually parse HTML, since lyra has a plugin for that.

Overall, since I already have plans to switch to lyra and improve the search functionality, you can wait and turn this task into an improvement task for the search. I can prioritize this task since the plugin system takes much more time than the search functionality. Just describe what you would like to see, and I will try to make it happen.

However, if you still decide to create your own solution, the indexes that I generate for the current search functionality will not work for you since they are indexes for the lunr.js library. You can look at the indexes.json file in the Network tab, but it's not very readable and cannot be used without lunr.js.

Integrating it into the build process without plugins is currently not possible. The only option is to manually parse the HTML in the .ng-doc folder after the build, but that can create additional problems. For example, the page routes can be predicted based on the directory path, but that may not always work, and I cannot guarantee that they won't change in the future. So, it seems easier and faster if I release updates for the search functionality (which I don't like anyway 😄).

from ng-doc.

skoropadas avatar skoropadas commented on July 21, 2024 1

While working on this task, I realized that it will most likely be a Breaking Change, because ideally, I would like to allow configuring the search results and also the ability to replace the default search field.

Therefore, after releasing this ticket, it will be necessary to manually add NgDocSearchEngine class to the providers section and also place the ng-doc-search component inside the ng-doc-header tag.

This way, if you or another user wants to adjust the search, they can provide a custom NgDocSearchEngine class that will be used by the ng-doc-search component, or completely replace the ng-doc-search component with their own version so that they don't have dependencies they don't need in the bundle.

from ng-doc.

R-Bower avatar R-Bower commented on July 21, 2024

Overall, since I already have plans to switch to lyra and improve the search functionality, you can wait and turn this task into an improvement task for the search. I can prioritize this task since the plugin system takes much more time than the search functionality. Just describe what you would like to see, and I will try to make it happen.

Sounds good to me.

However, if you still decide to create your own solution, the indexes that I generate for the current search functionality will not work for you since they are indexes for the lunr.js library. You can look at the indexes.json file in the Network tab, but it's not very readable and cannot be used without lunr.js.

I ran into this issue as well during my implementation.

Integrating it into the build process without plugins is currently not possible. The only option is to manually parse the HTML in the .ng-doc folder after the build, but that can create additional problems. For example, the page routes can be predicted based on the directory path, but that may not always work, and I cannot guarantee that they won't change in the future. So, it seems easier and faster if I release updates for the search functionality (which I don't like anyway 😄).

This is good to know, thank you.

from ng-doc.

github-actions avatar github-actions commented on July 21, 2024

🎉 This issue has been resolved in version 15.10.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

from ng-doc.

github-actions avatar github-actions commented on July 21, 2024

🎉 This issue has been resolved in version 15.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.