CATcher:
MarkBind:
RepoSense:
TEAMMATES:
List the aspects you learned, and the resources you used to learn them, and a brief summary of each resource.
Collection of Title and headings in generation:
Site/index.ts
.Page.collectHeadingsAndKeywords
records headings and keywords inside rendered page into this.headings and this.keywords respectively.Page Generation and Vue Initialization
core-web/src/index.js
, the setupWithSearch()
updates the SearchData by collecting the pages from the site data.
setupWithSearch()
is added as a script in the file template page.njk
used to render the HTML structure of Markbind pages.VueCommonAppFactory.js
provides a factory function (appFactory) to set up the common data and methods for Vue application shared between server-side and client-side, and provides the common data properties and methods.
searchData[]
and searchCallback()
, which are relevant in the following portion.<searchbar/>
, this is where to use MarkBind's search functionality, we set the appropriate values: <searchbar :data="searchData" :on-hit="searchCallback"></searchbar>
Vue Components: Searchbar/SearchbarPageItem.vue Searchbar.vue
searchData[]
in data
, filters and ranks the data based on keyword matches and populates the dropdown with searchbarPageItems
.on-hit
function when a search result is selected, passing the selected item.
SearchbarPageItem.vueAbout PageFind: A fully static search library that aims to perform well on large sites, while using as little of users bandwidth as possible, and without hosting any infrastructure.
Documentation:
It runs after the website framework, and only requires the folder containing the built static files of the website. A short explanation of how it works would be:
...
Angular Component Communication:
@Output
and EventEmitter
.Conditional Class Application:
ngClass
directive.[class]
binding syntax.Event Binding:
(event)
binding syntax to handle user interactions.(change)="handleChange($event)"
to trigger functions when events like change
occur, passing the event object as an argument.Angular Official Documentation:
@Output
and EventEmitter
to enable child-to-parent communication.Udemy Course: "Angular - The Complete Guide" by Maximilian Schwarzmüller:
By combining these resources, I was able to implement a basic dark mode feature that functions effectively but still requires refinement. One key area for improvement is ensuring the dark mode state persists when navigating between routes. Currently, when the route changes (e.g., from localhost:4200/web/
to another route), the boolean variable controlling the dynamic CSS class allocation using ngClass
resets to its default light mode, even if dark mode was active prior to the route change.
I suspect this behavior occurs because the page component is re-rendered during navigation, causing the component's state (including the boolean variable) to be re-initialized. To address this, I plan to research and implement a solution to persist the dark mode state. A promising approach might involve using a shared Angular service to store and manage the state globally, ensuring it remains consistent across routes. While I am not yet an expert in Angular, I am confident that further exploration and practice will help me refine this feature.