Skip to content

Commit

Permalink
docs: add a .js script to run with scopy and update the prefs table doc.
Browse files Browse the repository at this point in the history
Signed-off-by: AlexandraTrifan <[email protected]>
  • Loading branch information
AlexandraTrifan committed Dec 20, 2024
1 parent cbf4e4f commit f9e18af
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/gen_prefs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function main() {
var prefs = scopy.getPreferences();
var keys = Object.keys(prefs);
var rst_data = "";
var output_rst_file = "preferences_table.rst";
rst_data += "Preferences\n";
rst_data += "===========\n\n";
rst_data += ".. list-table::\n";
rst_data += " :header-rows: 1\n";
rst_data += " :widths: 20 30 50\n\n";
rst_data += " * - PreferenceId\n";
rst_data += " - Title\n";
rst_data += " - Description\n";

keys.forEach(element => {
var prefsDetails = scopy.getPreferenceDescription(element);
if (prefsDetails === undefined) {
printToConsole("Error: Preference details not found for " + element);
}
var title = (prefsDetails[0] !== undefined )? prefsDetails[0] : "---";
var description = (prefsDetails[1] !== undefined )? prefsDetails[1] : "---";
rst_data += " * - " + element + "\n";
rst_data += " - " + title + "\n";
rst_data += " - " + description + "\n";
});
fileIO.writeToFile(rst_data, output_rst_file);
printToConsole("Documentation has been generated in " + output_rst_file);
}

main()
26 changes: 26 additions & 0 deletions docs/user_guide/preferences.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. _preferences:

=============================================
Scopy Preferences
=============================================

.. image:: https://raw.githubusercontent.com/analogdevicesinc/scopy/doc_resources/resources/scopy-general-prefs.png
:align: center
..
Scopy Preferences can be accessed using the bottom left side **preferences
button**. On the right side of the page, preferences for each plugin
are available. More details can be found in their specific plugin
documentation section.

The **Open** button will try to open the specific OS explorer in
order to find the preference storage file.

Clicking the **Reset Scopy** button will reset the application to a default
configuration.

Changing some of the listed preferences will require an application
restart. More details on each preference are listed below.

.. include:: preferences_table.rst

0 comments on commit f9e18af

Please sign in to comment.