#
hs.doc.hsdocs
Manage the internal documentation web server.
This module provides functions for managing the Hammerspoon built-in documentation web server. Currently, this is the same documentation available in the Dash docset for Hammerspoon, but does not require third party software for viewing.
Future enhancements to this module under consideration include:
- Support for third-party modules to add to the documentation set at run-time
- Markdown/HTML based tutorials and How-To examples
- Documentation for the LuaSkin Objective-C Framework
- Lua Reference documentation
The intent of this sub-module is to provide as close a rendering of the same documentation available at the Hammerspoon GitHub site and Dash documentation as possible in a manner suitable for run-time modification so module developers can test out documentation additions without requiring a complete recompilation of the Hammerspoon source. As always, the most current and official documentation can be found at https://www.hammerspoon.org and in the official Hammerspoon Dash docset.
#
API Overview
Functions - API calls offered directly by the extension
browserDarkMode browserFrame forceExternalBrowser help interface moduleEntitiesInSidebar port start stop trackBrowserFrame
#
API Documentation
#
Functions
#
browserDarkMode
| | |
| --------------------------------------------|-------------------------------------------------------------------------------------|
| Signature | hs.doc.hsdocs.browserDarkMode([value]) -> currentValue
|
| Type | Function |
| Description | Get or set whether or not the Hammerspoon browser renders output in Dark mode. |
| Parameters |
- value - an optional boolean, number, or nil specifying whether or not the documentation browser renders in Dark mode.
if value is
true
, then the HTML output will always be inverted if value isfalse
, then the HTML output will never be inverted if value isnil
, then the output will be inverted only when the OS X theme is set to Dark mode if the value is a number between 0 and 100, the number specifies the inversion ratio, where 0 means no inversion, 100 means full inversion, and 50 is completely unreadable because the foreground and background are equally adjusted.
- the current, possibly new, value
- Inversion is applied through the use of CSS filtering, so while numeric values other than 0 (false) and 100 (true) are allowed, the result is generally not what is desired.
- Changes made with this function are saved with
hs.settings
with the label "_documentationServer.invertDocs" and will persist through a reload or restart of Hammerspoon.