Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool: Add Watcher feature to Manifest and SSG #47

Merged
merged 10 commits into from
Jul 6, 2024
Merged

Conversation

SakuraIsayeki
Copy link
Member

No description provided.

This commit adds a new feature to the SSG command by introducing the `--generate-manifest` flag. When this flag is used, a manifest file will be generated for the local vault if it is missing. The manifest file contains information about all the files in the vault.

The changes include:
- Added a new boolean property `GenerateManifest` to the `GenerateStaticSiteCommandSettings` class.
- Modified the `ExecuteAsync` method in the `GenerateStaticSite` class to check if the `GenerateManifest` flag is set and generate a manifest using the `GenerateManifestAsync` method from the `GenerateManifestCommand`.
- Created a new internal static method called `WriteStaticFilesAsync`, which writes static files to disk.
- Updated existing code to use this new method instead of duplicating code.

These changes enhance the functionality of the SSG command by providing an option to generate a manifest file for better organization and management of files in the vault.
- Updated the `code-block-syntax` mixin in `_mixins.scss`
- Added support for multiple languages by accepting an array of language names
- Each language now has its own CSS class and pre tag styling

This commit improves the flexibility and extensibility of the code block syntax mixin, allowing it to handle multiple programming languages more effectively.
This commit adds a new `--watch` command option to the `GenerateManifestCommand` class. When this option is specified, the command will watch the vault for changes and automatically regenerate the manifest whenever a change is detected. The generated manifest will then be written to disk.

The code changes include:
- Added a new `Watch` property to the `GenerateManifestSettings` class.
- Modified the validation logic in the `Validate()` method of the `GenerateManifestSettings` class to allow for watching even if force mode is not enabled.
- Added logic in the `GenerateManifestCommand` class to handle watching for vault updates and regenerating the manifest accordingly.
- Updated error handling in case an error occurs while regenerating or writing the manifest.

These changes enhance the functionality of generating manifests by providing an automated way to keep them up-to-date with any changes made to the vault.
This commit adds a file change debouncing mechanism to the `FileSystemVault` class. It introduces a dictionary of file change locks, which helps mitigate duplicate dispatches of a given file change event. The debounce period between file changes is set to 100 milliseconds.

The code changes include:
- Addition of `_fileChangeLocks` dictionary to store file change locks
- Introduction of `DebouncePeriod` constant for setting the debounce period
- Implementation of logic to check and update the reference hash at the time of lock acquisition
- Dispatching the `VaultUpdate` event only if the debounce period has elapsed since the last change
This commit adds support for the `--watch` flag in the SSG (Static Site Generator) command. The `--watch` flag allows the tool to watch the vault for changes and automatically regenerate the static site when changes are detected.

In the `GenerateManifestCommand.cs` file:
- Added a new property `Watch` to the `GenerateManifestCommandSettings` class.
- Modified the existing code to handle the new `Watch` flag.
- Updated status messages and error handling related to watching for vault changes.

In the `GenerateStaticSiteCommand.cs` file:
- Added a new property `Watch` to the `GenerateStaticSiteCommandSettings` class.
- Modified the existing code to handle the new `Watch` flag.
- Updated status messages and error handling related to watching for vault changes.

These changes enable users of our tool to conveniently generate and update their static sites by simply using the `--watch` flag.
@SakuraIsayeki SakuraIsayeki self-assigned this Jul 5, 2024
@SakuraIsayeki SakuraIsayeki added the enhancement New feature or request label Jul 5, 2024
The ToRelativePath method in the FileSystemVault class has been updated to replace backslashes with forward slashes. This change ensures consistent path formatting across different platforms.
- Changed the text "Regenerating manifest" to "Regenerating SSG assets"
- Removed the "Features" section from `Index.md`.
- Updated the content and structure of `Static Site Generation.md` to provide more detailed information about exporting Obsidian vaults to HTML files.
- Added developer features section in `Static Site Generation.md` and `Vault Manifests.md`, providing additional options for development and automation purposes.
- Updated the default exclusions list in `Vault Manifests.md`.
- Added developer features section in `Vault Manifests.md`, explaining extra functionalities available for developers when using the manifest command.
- Updated font sizes for h2, h3, h4, h5, and h6 headings in _global.scss
- Adjusted margin-bottom for font styles mixin in _mixins.scss

This commit updates the font sizes for various heading levels (h2 to h6) in the global styles. The font size values have been adjusted to improve readability and visual hierarchy. Additionally, the margin-bottom value in the font styles mixin has been modified to create more consistent spacing between elements.
This commit adds new callout colors to the `_content.scss` file. Specifically, it includes the colors for "note" and "tip" callouts. These colors are used to set the background color of the respective callouts and adjust their title text color accordingly.
@SakuraIsayeki SakuraIsayeki merged commit 431341f into main Jul 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

1 participant