Update api.md

This commit is contained in:
Roni Lehto 2021-04-25 20:56:06 +00:00
parent b20c4fef7e
commit 0a881cf175

View File

@ -42,6 +42,9 @@ The messageData object will be converted to JSON and passed as a parsed object t
### api.getSessionId() (`String`) ### api.getSessionId() (`String`)
Returns the current session identifier Returns the current session identifier
### api.getArgs() (`Array` of `String`)
Returns the process arguments
### api.getLogger() (lo4js logger) ### api.getLogger() (lo4js logger)
Returns the `log4js` logger. Returns the `log4js` logger.
### api.getWindow() (`BrowserWindow`) ### api.getWindow() (`BrowserWindow`)
@ -53,6 +56,15 @@ Returns the absolute path to the session-specific temp folder
### api.getPluginsFolder() (`String`) ### api.getPluginsFolder() (`String`)
Returns the absolute path to L'Math's plugin folder Returns the absolute path to L'Math's plugin folder
### api.getCurrentFile() (`String`)
Returns the absolute path of the current file (or an empty string or null if none)
### api.openDevTools()
Opens developer tools in the main window
### api.renderFormula(latex (`String`), callback (`function`))
Uses the built-in MathQuill instance to render TeX to SVG.
Does not trigger the `formulaRender` or `formulaRendered` events.
---- ----
### events ### events
@ -85,6 +97,16 @@ Returns the absolute path to L'Math's plugin folder
* Called when a page has been succesfully saved to its temporary file * Called when a page has been succesfully saved to its temporary file
* Event data * Event data
* `pageId` - the id of the page * `pageId` - the id of the page
* `formulaRender`
* Called before rendering a LaTeX formula
* Event data
* `number` - value of the formula counter
* `latex` - the TeX code, **can be modified**
* `formulaRendered`
* Called before rendering a LaTeX formula
* Event data
* `number` - value of the formula counter
* `svg` - the SVG content, **can be modified**
## Frontend ## Frontend