Skip to content

Commit

Permalink
Upd: Further documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Sep 22, 2024
1 parent e617470 commit 5e86b0a
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/030-running.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Running
On startup myMPD does the following:

- Check and create `cachedir` and `workdir` directories.
- `cachedir` and `workdir` must exist, if not started as root.
- `cachedir` and `workdir` must exist and be writeable for the user, if not started as root.
- Reads environment at first startup.
- Binds to the configured http and ssl port.
- Dropping privileges, if started as root.
Expand Down
7 changes: 5 additions & 2 deletions docs/040-debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ Tips to debug problems with myMPD. Try these steps and reproduce the error.
- Reset loglevel: `unset MYMPD_LOGLEVEL`

!!! note
Use [systemd-run](030-running.md#manual-startup), if you use a distribution with systemd
Use [systemd-run](030-running.md#manual-startup), if you use a distribution with systemd.

### Get logs from running myMPD

You can set the log level in the Maintenance dialog to `debug` and get the output from your logging service, for systemd it is: `journalctl -fu mympd`.
You can set the log level in the Maintenance dialog to `debug` and get the output from your logging service.

- Systemd: `journalctl -fu mympd`
- Syslog: `tail -f /var/log/messages` (or the logfile for facility `daemon`)

## Webbrowser logging

Expand Down
1 change: 1 addition & 0 deletions docs/060-references/api/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
title: API Documentation
6 changes: 3 additions & 3 deletions docs/060-references/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ myMPD uses a JSON-RPC 2 for the communication between frontend and backend.

## JSON-RPC Id

The json rpc is the combination of two numeric ids.
The json-rpc Id is the combination of two numeric ids.

1. Client ID: Generated on initial loading of the client, 6 digits
2. Request ID: Incremented on each request, 3 digits, wraps around
1. Client ID: Generated on initial loading of the client, first 6 digits
2. Request ID: Incremented on each request, last 3 digits, wraps around

The websocket connection registers the Client ID on the webserver. This registration is used to send async responses from the webserver to a specific client.

Expand Down
15 changes: 4 additions & 11 deletions docs/060-references/api/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@
title: API Methods
---

<form>
<div class="form-group row">
<label for="selectMethod" class="col-sm-2 col-form-label">Goto method</label>
<div class="col-sm-10">
<select class="custom-select" id="selectMethod"></select>
</div>
</div>
</form>
<select class="custom-select" id="selectMethod"></select>

<table class="table">
<table>
<thead>
<tr><th>Method</th><th>Parameters</th></tr>
</thead>
<tbody>
</tbody>
</table>
<script src="assets/apidoc.js"></script>
<script src="assets/create-apidoc.js"></script>
<script src="../../../assets/apidoc.js"></script>
<script src="../../../assets/create-apidoc.js"></script>
7 changes: 3 additions & 4 deletions docs/060-references/partitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Following items are partition specific:

You can select and manage partitions in the web interface. The selected partition for the web interface is saved in the browsers localStorage.

## Notes

- The `default` partition can not be deleted.
- Do not use a partition with the name `!all!`. It is used internally by myMPD.
!!! note
- The `default` partition can not be deleted.
- Do not use a partition with the name `!all!`. It is used internally by myMPD.
Binary file removed docs/assets/MaterialIcons-Regular.woff2
Binary file not shown.
11 changes: 8 additions & 3 deletions docs/assets/create-apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ function init() {
tbody.appendChild(tr);
}

let options = '<option></option>';
let options = '<option value="">Show method</option>';
for (const method of methods) {
options += '<option value="' + method + '">' + method + '</option>';
}

let select = document.getElementById('selectMethod');
select.innerHTML = options;
select.addEventListener('change', function() {
const m = this.options[this.selectedIndex].value;
select.addEventListener('change', function(event) {
const m = event.target.options[this.selectedIndex].value;
if (m !== '') {
for (const row of tbody.rows) {
if (row.getAttribute('id') === m) {
Expand All @@ -36,6 +36,11 @@ function init() {
}
}
}
else {
for (const row of tbody.rows) {
row.classList.remove('d-none');
}
}
}, false);
}

Expand Down
4 changes: 4 additions & 0 deletions docs/assets/css/mympd.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
--md-accent-fg-color: #28a745;
--md-accent-fg-color--transparent: #28a745;
}

.d-none {
display: none;
}

0 comments on commit 5e86b0a

Please sign in to comment.