Merge pull request #1861 from MycroftAI/feature/mycroft-skill-member-docs

Update MycroftSkill api documentation
pull/1866/head
Kathy Reid 2018-11-06 02:55:59 +11:00 committed by GitHub
commit 1de272cf6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 8 deletions

View File

@ -3,8 +3,8 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python2 -msphinx
SPHINXPROJ = Padatious
SPHINXBUILD = python -msphinx
SPHINXPROJ = mycroft-core
SOURCEDIR = .
BUILDDIR = _build

23
doc/README.md Normal file
View File

@ -0,0 +1,23 @@
# API documentation
The scripts in this folder build the API documentation for `mycroft-core`.
##
Activate the mycroft `venv`
```
source ../venv-activate.sh
```
Install the documentation requirements
```
pip install -r requirements
```
Create the documentation
```
make html
```

View File

@ -22,6 +22,16 @@ import sys
import re
import os
import sphinx_rtd_theme
from sphinx.ext.autodoc import (
ClassLevelDocumenter, InstanceAttributeDocumenter)
def iad_add_directive_header(self, sig):
ClassLevelDocumenter.add_directive_header(self, sig)
InstanceAttributeDocumenter.add_directive_header = iad_add_directive_header
sys.path.insert(0, os.path.abspath('../'))
@ -43,7 +53,7 @@ with open(os.path.join(os.path.dirname(os.path.dirname(
flags=re.MULTILINE))
# Dependencies with different module names
autodoc_mock_imports += [
autodoc_mock_imports = list(autodoc_mock_imports) + [
'adapt',
'alsaaudio',
'dateutil',
@ -73,7 +83,6 @@ pygments_style = 'sphinx'
todo_include_todos = False
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme_options = {

View File

@ -1 +1,2 @@
six
sphinx>= 1.8.1
sphinx_rtd_theme>=0.4.2

View File

@ -225,14 +225,18 @@ class MycroftSkill(object):
self._bus = None
self._enclosure = None
self.bind(bus)
#: Mycroft global configuration. (dict)
self.config_core = Configuration.get()
self.config = self.config_core.get(self.name) or {}
self.dialog_renderer = None
self.root_dir = None
self.root_dir = None #: skill root directory
#: Filesystem access to skill specific folder.
#: See mycroft.filesystem for details.
self.file_system = FileSystemAccess(join('skills', self.name))
self.registered_intents = []
self.log = LOG.create_logger(self.name)
self.reload_skill = True # allow reloading
self.log = LOG.create_logger(self.name) #: Skill logger instance
self.reload_skill = True #: allow reloading (default True)
self.events = []
self.scheduled_repeats = []
self.skill_id = '' # will be set from the path, so guaranteed unique