Comments (5)
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.
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.
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.
🎉 This issue has been resolved in version 15.10.0-beta.1 🎉
The release is available on:
v15.10.0-beta.1
- GitHub release
Your semantic-release bot 📦🚀
from ng-doc.
🎉 This issue has been resolved in version 15.10.0 🎉
The release is available on:
v15.10.0
- GitHub release
Your semantic-release bot 📦🚀
from ng-doc.
Related Issues (20)
- Support for native i18n / $localize + localized markdown HOT 3
- [Feature] Demo Pane viewport and theme support
- [Feature] Custom Tabs in Demo HOT 5
- [Feature] Display Component Properties in Component Tabs and on Page HOT 1
- [Bug] Configure Home icon route path of breadcrumb
- Add plugin for customizing the transformation of markdown to HTML
- [Query] Usage of Snippets
- [Bug] Support angular17html in code fences HOT 2
- [Feature] Support inline template syntax highlighting HOT 2
- [Query] Usage of Recreate option in the Playground HOT 2
- [Bug] API Link Reference missing for optional properties of a component HOT 2
- [Feature] Customising Playground HOT 2
- [Feature] Add possibility to provide custom properties for custom sidebar HOT 2
- [Query] What is ```twig fence code and what all the markdown fence code supported in Ng Docs? HOT 3
- [Feature] Add tabs for common macros and Angular components to display their usage variations along with previews
- Demo/Demo Pane Crash with "Unexpected end of JSON input" [Bug] HOT 4
- [Bug] Build / serve crash when using Angular 18.1 HOT 9
- [Bug] Anchor seems not working with french accents HOT 3
- [Bug] "Octal escape sequences are not allowed" validation error using generated demo-assets code HOT 1
- [Bug] 17.6.15 Build failed HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-doc.