diff --git a/.github/PULL_REQUEST_TEMPLATE/translation.md b/.github/PULL_REQUEST_TEMPLATE/translation.md index d17a2cc..cda10fe 100644 --- a/.github/PULL_REQUEST_TEMPLATE/translation.md +++ b/.github/PULL_REQUEST_TEMPLATE/translation.md @@ -26,6 +26,7 @@ Please specify the language you are adding or modifying: ## Motivation and Context Explain why this translation (addition, fix, or update) is needed. + - For fixes, please describe the original error. - For updates, briefly explain the context of the new strings. diff --git a/docs/contributing.md b/docs/contributing.md index 86bacf0..d86a567 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -55,50 +55,50 @@ Want to get your hands dirty with the code? Awesome! We appreciate all code cont account. 2. **Clone Your Fork:** Clone your forked repository to your local machine. - ```bash - git clone https://github.com/YOUR_USERNAME/mushroom-strategy.git - cd mushroom-strategy - ``` + ```bash + git clone https://github.com/YOUR_USERNAME/mushroom-strategy.git + cd mushroom-strategy + ``` -3. **Create a New Branch:** Create a new branch for your feature or bug fix. Use a descriptive name (e.g., - `feature/my-awesome-feature`, `bugfix/fix-admonition-rendering`). +3. **Create a New Branch:** Create a new branch for your feature or bug fix. + Use a descriptive name (e.g., `feature/my-awesome-feature`, `bugfix/fix-admonition-rendering`). - ```bash - git checkout -b feature/my-new-feature - ``` + ```bash + git checkout -b feature/my-new-feature + ``` 4. **Set up Development Environment:** - * Ensure you have Node.js and npm installed. - * Install project dependencies: `npm install` - * You can build the strategy with `npm run build` (for production) or `npm run build-dev` (for development/testing). - * Copy the built files to your Home Assistant's `www/community/mushroom-strategy` folder for testing. + * Ensure you have Node.js and npm installed. + * Install project dependencies: `npm install` + * You can build the strategy with `npm run build` (for production) or `npm run build-dev` (for development/testing). + * Copy the built files to your Home Assistant's `www/community/mushroom-strategy` folder for testing. 5. **Make Your Changes:** Implement your bug fix or new feature. 6. **Test Your Changes:** Thoroughly test your changes to ensure they work as expected and don't introduce new issues. 7. **Commit Your Changes:** - * We follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for clear commit history. - * Example: `feat: add new card option` or `fix: correct card rendering issue` + * We follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for clear commit history. + * Example: `feat: add new card option` or `fix: correct card rendering issue` - ```bash - git add . - git commit -m "feat: add super cool new feature" - ``` + ```bash + git add . + git commit -m "feat: add super cool new feature" + ``` 8. **Push to Your Fork:** - ```bash - git push origin feature/my-new-feature - ``` + ```bash + git push origin feature/my-new-feature + ``` 9. **Create a Pull Request (PR):** - * Go to your forked repository on GitHub. - * You should see a prompt to create a pull request from your new branch to the `main` branch of - `DigiLive/mushroom-strategy`. - * Provide a clear title and description for your PR, referencing any related issues. - * Be prepared to discuss your changes and address any feedback during the review process. + * Go to your forked repository on GitHub. + * You should see a prompt to create a pull request from your new branch to the `main` branch of + `DigiLive/mushroom-strategy`. + * Provide a clear title and description for your PR, referencing any related issues. + * Be prepared to discuss your changes and address any feedback during the review process. --- @@ -123,10 +123,10 @@ Examples: fr, fr-CA, zh-Hans. Each language has its own `locale.json` file (e.g., `en.json`, `nl.json`, `pt-BR.json`). 3. **Create or Update:** - * **To create a new language:** Copy an existing `.json` file (e.g., `en.json`), rename it to your language - code (e.g., `de.json` for German), and translate the property values. - * **To update an existing language:** Open the `.json` file for your language and update any missing or - outdated translations. + * **To create a new language:** Copy an existing `.json` file (e.g., `en.json`), rename it to your language + code (e.g., `de.json` for German), and translate the property values. + * **To update an existing language:** Open the `.json` file for your language and update any missing or + outdated translations. 4. **Submit a Pull Request:** Once your translations are complete, submit a pull request with your changes. Clearly state which language you are contributing to or updating. @@ -154,8 +154,8 @@ Examples: fr, fr-CA, zh-Hans. /** Registry of currently supported languages */ const languages: Record = { - en, - 'pt-BR': pt_br, + en, + 'pt-BR': pt_br, }; ``` diff --git a/docs/faq.md b/docs/faq.md index ba4af19..fdf54dc 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1,3 +1,5 @@ +# Frequently Asked Questions + ??? question "How do I add a device or entity to an area?" You can add devices to an area by going to `Settings` found at the bottom of the sidebar. @@ -8,10 +10,11 @@ 4. Select :material-pencil: or :material-cog: in the top right corner. 5. Choose an area in the area field. - !!! warning + !!! warning If you created an entity manually (in your `configuration.yaml`), you may need to create a `unique_id` before you can set an area to it. - See Home Assistant's [documentation][uniqueIdUrl] for more info about unique ids. + See Home Assistant's [documentation](https://www.home-assistant.io/faq/unique_id){: target="_blank"} for more + info about unique ids. ??? question "How do I hide entities from the Strategy?" @@ -24,8 +27,8 @@ !!! note - If you don't want to hide the entity from all dashboards, you can use [Card Options][cardOptionsUrl] to hide - specific entities and devices. + If you don't want to hide the entity from all dashboards, you can use [Card Options](options/card-options.md) + to hide specific entities and devices. ??? question "How do I get the id of entities, devices and areas?" @@ -48,9 +51,3 @@ 1. Select `Settings` at the bottom of the sidebar. 2. Select `Areas`. 3. Select :material-pencil: of the area you want to get the id of. - - - -[uniqueIdUrl]: https://www.home-assistant.io/faq/unique_id - -[cardOptionsUrl]: options/card-options.md diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index e793602..165096d 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -2,9 +2,10 @@ ## Prerequisites -Mushroom dashboard strategy and dependencies are available in [HACS][hacsUrl] (Home Assistant Community Store). +Mushroom dashboard strategy and dependencies are available in [HACS][hacsUrl]{: target="_blank"} (Home Assistant +Community Store). Install HACS if you don't have it already. -For assistance, you can follow the [installation guide][hacsInstallationGuideUrl]. +For assistance, you can follow the [installation guide][hacsInstallationGuideUrl]{: target="_blank"}. Once you have HACS installed, you can install custom integration and plug-ins. This guide offers you badges to open your Home Assistant on the correct page. @@ -19,15 +20,16 @@ You need to install the following HACS integrations before you can use this stra Click the badges below and follow the installation instructions. They will open the HACS repository at your Home Assistant instance directly. -[![Open in HACS at your Home Assistant instance.][hacsBadge]][hacsMushroomUrl] to install [Mushroom][mushroomUrl]. -[![Open in HACS at your Home Assistant instance.][hacsBadge]][hacsMiniGraphUrl] to -install [Mini graph card][miniGraphUrl]. +[![Open in HACS at your Home Assistant instance.][hacsBadge]][hacsMushroomUrl]{: target="_blank"} to install +[Mushroom][mushroomUrl]{: target="_blank"}. +[![Open in HACS at your Home Assistant instance.][hacsBadge]][hacsMiniGraphUrl]{: target="_blank"} to +install [Mini graph card][miniGraphUrl]{: target="_blank"}. ## Dashboard Installation If you meet all the prerequisites, click the badge below to install the strategy. -[![Open in HACS at your Home Assistant instance.][hacsBadge]][hacsStrategyUrl] +[![Open in HACS at your Home Assistant instance.][hacsBadge]][hacsStrategyUrl]{: target="_blank"} ## Local Installation @@ -38,7 +40,7 @@ If you require testing a custom build for debug purposes, follow these steps: 2. Copy the build file(s) to folder `/www/community/mushroom-strategy`. 3. If file `mushroom-strategy.js.gz` exists in that folder, rename or delete it. -!!! note +!!! note Refresh the cache of the client you use to access Home Assistant. ## Updating @@ -46,7 +48,7 @@ Refresh the cache of the client you use to access Home Assistant. By default, Home Assistant will notify you when an update of the strategy is available. You can update the strategy by going to `Settings` found at the bottom of the sidebar. -!!! tip +!!! tip You can enable notifications of pre-releases. * Go to `Settings` > `Devices & services` > `Entities`. diff --git a/docs/index.md b/docs/index.md index cafb9e1..9aa92a0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -46,4 +46,3 @@ engage with the community! to ❤️ [sponsor the project](https://github.com/sponsors/DigiLive) to support its continued development! Your support helps us grow and improve. -// TODO: add contribution and pre-release diff --git a/docs/options/area-options.md b/docs/options/area-options.md index d41420f..7c64085 100644 --- a/docs/options/area-options.md +++ b/docs/options/area-options.md @@ -14,8 +14,8 @@ Each configuration is identified by an area id and can have the following option Also, all options from the Template mushroom card and/or Home Assistant Area card are supported. Please follow the links below to see the additional options per card type. -* [Mushroom Template Card][templateDocUrl]. -* [Home Assistant Area Card][areaDocUrl]. +* [Mushroom Template Card][templateDocUrl]{: target="_blank"}. +* [Home Assistant Area Card][areaDocUrl]{: target="_blank"}. ## Extra Cards diff --git a/docs/options/domain-options.md b/docs/options/domain-options.md index 7af5225..0f26361 100644 --- a/docs/options/domain-options.md +++ b/docs/options/domain-options.md @@ -18,9 +18,10 @@ In the different views, the cards belonging to a specific domain will be horizon The number of cards per row can be configured with this option. !!! note -* Domain `default` represents any other domain than supported by this strategy. -* The `showControls` option will default to false for domain which can't be controlled. -* The `hide_config_entities` and `hide_diagnostic_entities` options are only available as an "All domains" option. + + * Domain `default` represents any other domain than supported by this strategy. + * The `showControls` option will default to false for domain which can't be controlled. + * The `hide_config_entities` and `hide_diagnostic_entities` options are only available as an "All domains" option. --- diff --git a/docs/options/home-view-options.md b/docs/options/home-view-options.md index 7d8295c..97c0eaa 100644 --- a/docs/options/home-view-options.md +++ b/docs/options/home-view-options.md @@ -85,6 +85,8 @@ You can define a custom entity to use by setting an entity id. !!! note To hide the weather chip, you should hide or disable the entity itself. +### Example + ```yaml strategy: type: custom:mushroom-strategy @@ -100,7 +102,7 @@ strategy: ## Extra Chips To add custom chips, you can configure them in `extra_chips`. -See [Mushroom Chips][chipDocUrl] for all available chips. +See [Mushroom Chips][chipDocUrl]{: target="_blank"} for all available chips. !!! tip You can build your chips in a temporary card in another dashboard and copy the `chips` group from the YAML of that diff --git a/docs/options/index.md b/docs/options/index.md index 4679094..6b616c7 100644 --- a/docs/options/index.md +++ b/docs/options/index.md @@ -43,5 +43,3 @@ strategy: icon: mdi:sofa icon_color: green ``` - - diff --git a/docs/options/view-options.md b/docs/options/view-options.md index 2dbeb86..bced26a 100644 --- a/docs/options/view-options.md +++ b/docs/options/view-options.md @@ -51,7 +51,7 @@ views: [] ## Extra Views The `extra_views` group enables you to specify the configuration of additional views. -Each view can have the options as described in the [Home Assistant documentation][viewDocUrl]. +Each view can have the options as described in the [Home Assistant documentation][viewDocUrl]{: target="_blank"}. !!! tip You can build your view in a temporary dashboard and copy the `views` group from the YAML of that dashboard into @@ -77,4 +77,3 @@ strategy: [viewDocUrl]: https://www.home-assistant.io/dashboards/views/#views - diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css new file mode 100644 index 0000000..780cf72 --- /dev/null +++ b/docs/stylesheets/extra.css @@ -0,0 +1,16 @@ +a[target="_blank"]::after { + background-image: url('data:image/svg+xml;utf8,'); + background-repeat: no-repeat; + background-size: cover; + content: ""; + display: inline-block; + height: 0.8em; + margin-left: 0.3em; + opacity: 0.7; + vertical-align: middle; + width: 0.8em; +} + +[data-md-color-scheme="slate"] a[target="_blank"]::after { + filter: invert(100%); +} diff --git a/mkdocs.yml b/mkdocs.yml index 3bcedaf..de9f4f5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -37,6 +37,9 @@ theme: - content.action.edit - content.footnote.tooltips +extra_css: + - stylesheets/extra.css + nav: - Home: index.md - Getting Started: