Skip to content

Commit

Permalink
feat(docs): Markdown docs will be automattically convert to NR help f…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
zachowj committed Jan 1, 2020
1 parent b346bf4 commit 5abfb62
Show file tree
Hide file tree
Showing 19 changed files with 541 additions and 23 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/convert-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Convert Documentation

on:
push:
branches: dev
paths:
- "docs/**/*.md"

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "10.x"
- run: npm install
- name: Convert Docs
run: npm run docs:Convert
- uses: stefanzweifel/[email protected]
with:
commit_message: Convert markdown docs to Node-RED help files
branch: ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions nodes/_static/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,41 @@ li span.property-type {
padding: 10px;
margin-bottom: 10px;
}

.custom-block .custom-block-title {
font-weight: 600;
}
.custom-block.tip,
.custom-block.warning,
.custom-block.danger {
padding: 0.1rem 1.5rem;
border-left-width: 0.5rem;
border-left-style: solid;
margin: 1rem 0;
}
.custom-block.tip {
background-color: #f3f5f7;
border-color: #42b983;
}
.custom-block.warning {
background-color: rgba(255, 229, 100, 0.3);
border-color: #e7c000;
color: #6b5900;
}
.custom-block.warning .custom-block-title {
color: #b29400;
}
.custom-block.warning a {
color: #6b5900;
}
.custom-block.danger {
background-color: #ffe6e6;
border-color: #c00;
color: #4d0000;
}
.custom-block.danger .custom-block-title {
color: #900;
}
.custom-block.danger a {
color: #4d0000;
}
1 change: 1 addition & 0 deletions nodes/api/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/API.md -->
<script type="text/x-red" data-help-name="ha-api">
<h3>Configuration</h3>
<dl class="message-properties">
Expand Down
1 change: 1 addition & 0 deletions nodes/call-service/call-service.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ <h4>
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/call-service.md -->
<script type="text/x-red" data-help-name="api-call-service">
<p>Call a Home Assistant service</p>

Expand Down
1 change: 1 addition & 0 deletions nodes/current-state/current-state.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/current-state.md -->
<script type="text/x-red" data-help-name="api-current-state">
<p>Get the current state of an Entity</p>

Expand Down
1 change: 1 addition & 0 deletions nodes/entity/entity.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/sensor.md -->
<script type="text/x-red" data-help-name="ha-entity">
<p>Creates a sensor in Home Assistant that can be updated from this node.</p>
<p>This nodes requires <a href="https://github.com/zachowj/hass-node-red" target="_blank">Node-RED custom integration <i class="fa fa-external-link external-link"></i></a> to be installed in Home Assistant
Expand Down
1 change: 1 addition & 0 deletions nodes/events-all/events-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<div id="eventAlert" class="ui-state-error ha-alert-box"><strong>Alert:</strong> Leaving Event Type empty and listening for all events may overload the websocket message queue.</div>
</script>

<!-- Documentation in this file is generated from /docs/node/events-all.md -->
<script type="text/x-red" data-help-name="server-events">
<h3>Outputs</h3>
<p>The outputted message object contains the following data, underscored values are straight from home assistant and home assistant client events.</p>
Expand Down
1 change: 1 addition & 0 deletions nodes/events-state-changed/events-state-changed.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/events-state.md -->
<script type="text/x-red" data-help-name="server-state-changed">
<p class="ha-description">Outputs &#39;state_changed&#39; event types sent from Home Assistant</p>

Expand Down
1 change: 1 addition & 0 deletions nodes/fire-event/fire-event.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/fire-event.md -->
<script type="text/x-red" data-help-name="ha-fire-event">
<p>Fire an event to Home Assistants event bus</p>

Expand Down
1 change: 1 addition & 0 deletions nodes/get-entities/get-entities.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/get-entities.md -->
<script type="text/x-red" data-help-name="ha-get-entities">
<p>Get Entities based on search criteria</p>

Expand Down
1 change: 1 addition & 0 deletions nodes/get-history/get-history.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/get-history.md -->
<script type="text/html" data-help-name="api-get-history">
<p>Fetches history from Home Assistant (all history for the past day by default)</p>

Expand Down
1 change: 1 addition & 0 deletions nodes/poll-state/poll-state.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/poll-state.md -->
<script type="text/x-red" data-help-name="poll-state">
<p>Polls for state of given entity and outputs time since last changed</p>

Expand Down
1 change: 1 addition & 0 deletions nodes/render-template/render-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/get-template.md -->
<script type="text/x-red" data-help-name="api-render-template">
<p>Calls Home Assistant to render a jinja2 template</p>

Expand Down
1 change: 1 addition & 0 deletions nodes/trigger-state/trigger-state.html
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ <h3>Add Outputs</h3>
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/triger-state.md -->
<script type="text/x-red" data-help-name="trigger-state">
<p>Advanced version of &#39;server:state-changed&#39; node</p>

Expand Down
1 change: 1 addition & 0 deletions nodes/wait-until/wait-until.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
</div>
</script>

<!-- Documentation in this file is generated from /docs/node/wait-until.md -->
<script type="text/x-red" data-help-name="ha-wait-until">
<p>When an input is received the node will wait until the condition is met or the timeout occurs then will pass on the last received message.</p>

Expand Down
1 change: 1 addition & 0 deletions nodes/webhook/webhook.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
});
</script>

<!-- Documentation in this file is generated from /docs/node/webhook.md -->
<script type="text/x-red" data-template-name="ha-webhook">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
Expand Down
Loading

0 comments on commit 5abfb62

Please sign in to comment.