]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - docs/tips-and-tricks.md
Code review fixes
[github/bastienwirtz/homer.git] / docs / tips-and-tricks.md
index 94167fbad4b8e6aaed078ab12a44ab012f059b9e..17bba9afd8905c8b77f21db2c0c6a8ed56342549 100644 (file)
@@ -3,6 +3,7 @@
 Here is a collection of neat tips and tricks that Homer users have come up with!
 
 ## Use Homer as a custom "new tab" page
+
 #### `by @vosdev`
 
 These extensions for [Firefox](https://addons.mozilla.org/firefox/addon/custom-new-tab-page) and [Chrome & Friends](https://chrome.google.com/webstore/detail/new-tab-changer/occbjkhimchkolibngmcefpjlbknggfh) allow you to have your homer dashboard in your new tab page, while leaving focus on the address bar meaning you can still type right away if you want to search or go to a page that is not on your homer dash.
@@ -22,11 +23,12 @@ The Firefox extension loads Homer in an iframe on your new tab page, meaning you
 ```
 
 ## YAML Anchors
+
 #### `by @JamiePhonic`
 
 Since Homer is configured using YAML, it supports all of YAML's helpful features, such as anchoring!
 
-For example, you can define tags and tag styles for each "item" in a service. 
+For example, you can define tags and tag styles for each "item" in a service.
 Using Anchoring, you can define all your tags and their styles once like this: (for example)
 
 ```yaml
@@ -70,6 +72,7 @@ The end result is that if you want to update the name or style of any particular
 Great if you have a lot of services or a lot of tags!  
 
 ## Remotely edit your config with Code Server
+
 #### `by @JamiePhonic`
 
 Homer doesn't yet provide a way to edit your configuration from inside Homer itself, but that doesn't mean it can't be done!
@@ -78,14 +81,17 @@ You can setup and use [Code-Server](https://github.com/cdr/code-server) to edit
 
 If you're running Homer in docker, you can setup a Code-Server container and pass your homer config directory into it.
 Simply pass your homer config directory as an extra -v parameter to your code-server container:
-```
+
+```sh
 -v '/your/local/homer/config-dir/':'/config/homer':'rw'
 ```
+
 This will map your homer config directory (For example, /docker/appdata/homer/) into code-server's `/config/` directory, in a sub folder called `homer`
 
 As a bonus, Code-Server puts the "current folder" as a parameter in the URL bar, so you could add a `links:` entry in Homer that points to your code-server instance with the directory pre-filled for essentially 1 click editing!
 
 For example:
+
 ```yml
 links:
   - name: Edit config
@@ -93,9 +99,11 @@ links:
     url: https://vscode.example.net/?folder=/config/homer
     target: "_blank" # optional html tag target attribute
 ```
+
 where the path after `?folder=` is the path to the folder where you mounted your homer config INSIDE the Code-Server container.
 
 ### Example Code-Server docker create command
+
 ```sh
 docker create \
   --name=code-server \
@@ -111,13 +119,13 @@ docker create \
   linuxserver/code-server
 ```
 
-
 ## Get the news headlines in Homer
 
 ### Mapping Fields
+
 Most times, the url you're getting headlines from follows a different schema than the one expected by Homer.
 
-For example, if you would like to show jokes from ChuckNorris.io, you'll find that the url https://api.chucknorris.io/jokes/random is giving you info like this:
+For example, if you would like to show jokes from ChuckNorris.io, you'll find that the url <https://api.chucknorris.io/jokes/random> is giving you info like this:
 
 ```json
 {
@@ -179,6 +187,6 @@ If the URL you specified returns a JSON object that defines a `title` and `conte
 
 So, using [Node-Red](https://nodered.org/docs/getting-started/) and a quick flow, you can process an RSS feed to replace the message with a news item!
 
-To get started, simply import [this flow](https://flows.nodered.org/flow/4b6406c9a684c26ace0430dd1826e95d) into your Node-Red instance and change the RSS feed in the "Get News RSS Feed" node to one of your choosing! 
+To get started, simply import [this flow](https://flows.nodered.org/flow/4b6406c9a684c26ace0430dd1826e95d) into your Node-Red instance and change the RSS feed in the "Get News RSS Feed" node to one of your choosing!
 
 So far, the flow has been tested with BBC News and Sky News, however it should be easy to modify the flow to work with other RSS feeds if they don't work out of the box!