-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Master new template and update files for TB84 and 85 (#43)
* new template * upd files for Tb84 and 85
- Loading branch information
Showing
42 changed files
with
8,024 additions
and
1,547 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
_build | ||
chrome_settings_overrides.rst | ||
__pycache__ | ||
versionwarning-data.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: conf.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from docutils import nodes | ||
from docutils.parsers.rst import Directive | ||
from docutils.parsers.rst import directives | ||
from docutils.statemachine import ViewList | ||
from sphinx.util.nodes import nested_parse_with_titles | ||
|
||
|
||
def make_div_node(self, classname, lines): | ||
div = nodes.container() | ||
div['classes'] = [classname] | ||
|
||
rst = ViewList() | ||
# Add the content one line at a time. | ||
# Second argument is the filename to report in any warnings | ||
# or errors, third argument is the line number. | ||
for line in lines: | ||
rst.append(line, "make_div.rst", 0) | ||
# Create a node. | ||
node = nodes.section() | ||
node.document = self.state.document | ||
# Parse the rst. | ||
nested_parse_with_titles(self.state, rst, node) | ||
|
||
div.extend(node) | ||
return [div] | ||
|
||
class ApiHeaderDirective(Directive): | ||
|
||
optional_arguments = 1 | ||
final_argument_whitespace = False | ||
has_content = True | ||
option_spec = { | ||
"label": directives.unchanged_required, | ||
"annotation": directives.unchanged_required | ||
} | ||
|
||
def run(self): | ||
ApiHeaderNode = nodes.container() | ||
ApiHeaderNode['classes'] = ["api-header-node"] | ||
|
||
ApiHeaderSection = nodes.container() | ||
ApiHeaderSection['classes'] = ["api-header-section"] | ||
if 'label' in self.options: | ||
ApiHeaderSection.extend(make_div_node(self, "api-header-label", [self.options['label']])) | ||
if 'annotation' in self.options: | ||
ApiHeaderSection.extend(make_div_node(self, "api-header-annotation", [self.options['annotation']])) | ||
ApiHeaderNode.append(ApiHeaderSection) | ||
|
||
self.state.nested_parse(self.content, self.content_offset, ApiHeaderNode) | ||
|
||
return [ApiHeaderNode] | ||
|
||
|
||
def setup(app): | ||
app.add_directive("api-header", ApiHeaderDirective) | ||
|
||
return { | ||
'version': '0.1', | ||
'parallel_read_safe': True, | ||
'parallel_write_safe': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
from docutils import nodes | ||
from docutils.parsers.rst import Directive | ||
from docutils.parsers.rst import directives | ||
from docutils.statemachine import ViewList | ||
from sphinx.util.nodes import nested_parse_with_titles | ||
|
||
|
||
def make_div_node(self, classname, lines): | ||
div = nodes.container() | ||
div['classes'] = [classname] | ||
|
||
rst = ViewList() | ||
# Add the content one line at a time. | ||
# Second argument is the filename to report in any warnings | ||
# or errors, third argument is the line number. | ||
for line in lines: | ||
rst.append(line, "make_div.rst", 0) | ||
# Create a node. | ||
node = nodes.section() | ||
node.document = self.state.document | ||
# Parse the rst. | ||
nested_parse_with_titles(self.state, rst, node) | ||
|
||
div.extend(node) | ||
return [div] | ||
|
||
class ApiMemberDirective(Directive): | ||
|
||
optional_arguments = 0 | ||
final_argument_whitespace = False | ||
has_content = True | ||
option_spec = { | ||
"type": directives.unchanged, | ||
"name": directives.unchanged, | ||
"annotation": directives.unchanged | ||
} | ||
|
||
def run(self): | ||
apiMemberNode = nodes.container() | ||
apiMemberNode['classes'] = ["api-member-node"] | ||
|
||
apiMemberDefinition = nodes.container() | ||
apiMemberDefinition['classes'] = ["api-member-definition"] | ||
apiMemberDefinition.extend(make_div_node(self, "api-member-bullet", ['-'])) | ||
|
||
if 'name' in self.options: | ||
apiMemberDefinition.extend(make_div_node(self, "api-member-name", [self.options['name']])) | ||
if 'type' in self.options: | ||
apiMemberDefinition.extend(make_div_node(self, "api-member-type", [self.options['type']])) | ||
if 'annotation' in self.options: | ||
apiMemberDefinition.extend(make_div_node(self, "api-member-annotation", [self.options['annotation']])) | ||
apiMemberNode.append(apiMemberDefinition) | ||
|
||
if len(self.content) > 0: | ||
apiMemberDescription = nodes.container() | ||
apiMemberDescription['classes'] = ["api-member-description"] | ||
self.state.nested_parse(self.content, self.content_offset, apiMemberDescription) | ||
apiMemberNode.append(apiMemberDescription) | ||
|
||
return [apiMemberNode] | ||
|
||
|
||
def setup(app): | ||
app.add_directive("api-member", ApiMemberDirective) | ||
|
||
return { | ||
'version': '0.1', | ||
'parallel_read_safe': True, | ||
'parallel_write_safe': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
from docutils import nodes | ||
from docutils.parsers.rst import Directive | ||
from docutils.parsers.rst import directives | ||
from docutils.statemachine import ViewList | ||
from sphinx.util.nodes import nested_parse_with_titles | ||
|
||
def make_div_node(self, classname, lines): | ||
div = nodes.container() | ||
div['classes'] = [classname] | ||
|
||
rst = ViewList() | ||
# Add the content one line at a time. | ||
# Second argument is the filename to report in any warnings | ||
# or errors, third argument is the line number. | ||
for line in lines: | ||
rst.append(line, "make_div.rst", 0) | ||
# Create a node. | ||
node = nodes.section() | ||
node.document = self.state.document | ||
# Parse the rst. | ||
nested_parse_with_titles(self.state, rst, node) | ||
|
||
div.extend(node) | ||
return [div] | ||
|
||
def visit_node(self, node): | ||
pass | ||
|
||
def depart_node(self, node=None): | ||
self.body.append("</div><div class='api-section-body'>") | ||
|
||
class ApiMainSectionAnnotation(nodes.General, nodes.Element): | ||
pass | ||
|
||
class ApiMainSectionDirective(Directive): | ||
optional_arguments = 1 | ||
final_argument_whitespace = True | ||
has_content = False | ||
|
||
def run(self): | ||
node = ApiMainSectionAnnotation() | ||
if self.arguments and len(self.arguments): | ||
node.extend(make_div_node(self, "api-section-annotation", [self.arguments[0]])) | ||
return [node] | ||
|
||
|
||
def setup(app): | ||
app.add_node(ApiMainSectionAnnotation, html=(visit_node, depart_node)) | ||
app.add_directive("api-section-annotation-hack", ApiMainSectionDirective) | ||
|
||
return { | ||
'version': '0.1', | ||
'parallel_read_safe': True, | ||
'parallel_write_safe': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.