Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* text eol=lf
* text=auto
*.sh text eol=lf
17 changes: 17 additions & 0 deletions src/fake_bpy_module/generator/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ def depart_section(self, _: nodes.section) -> None:
self.doc_writer.addln("--------------------")
self.doc_writer.new_line()

def visit_substitution_definition(
self, node: nodes.substitution_definition
) -> None:
name = node.attributes["names"][0]
self.doc_writer.add(f"SUBSTITUTION REPLACEMENT '{name}':")
self.doc_writer.new_line()
print(
f"WARNING. Found substitution definition by name '{name}'. "
"It's not fully supported and may be not handled properly."
)

def depart_substitution_definition(
self, _: nodes.substitution_definition
) -> None:
self.doc_writer.new_line()
self.doc_writer.new_line()

def visit_emphasis(self, _: nodes.emphasis) -> None:
self.doc_writer.add("*")

Expand Down
3 changes: 2 additions & 1 deletion src/fake_bpy_module/transformer/rst_specific_node_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def _apply(self, document: nodes.document) -> None:
nodes.enumerated_list | nodes.definition_list |
nodes.block_quote | nodes.line_block | nodes.literal_block |
nodes.section | nodes.field_list | nodes.note |
nodes.warning | nodes.target | CodeNode):
nodes.warning | nodes.target |
nodes.substitution_definition | CodeNode):
code_doc_node = CodeDocumentNode()
self._replace(node, code_doc_node)
append_child(code_doc_node, node)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.. module:: module_1
.. module:: module_1
Original file line number Diff line number Diff line change
@@ -1,60 +1,63 @@
"""
Paragraph: *Emphasis*

* Bullet List Item 1
* Bullet List Item 1-1
* Bullet List Item 1-2
* Bullet List Item 2
* Bullet List Item 2-1
* Bullet List Item 2-2
* Bullet List Item 2-3
* Bullet List Item 3
* Bullet List Item 3-1

1. Enumerated List Item 1
1. Enumerated List Item 1-1
2. Enumerated List Item 1-2
2. Enumerated List Item 2
1. Enumerated List Item 2-1
2. Enumerated List Item 2-2
3. Enumerated List Item 2-3
3. Enumerated List Item 3
1. Enumerated List Item 3-1

field-list-item-1: Field List Item 1 Contents
field-list-item-2: Field List Item 2 Contents

Definition List Item 1
Definition List Item 1 Contents

Definition List Item 2
Definition List Item 2 Contents

```
Literal Block Contents
```

Module: module_ref, Ref: ref_ref, Class: class_ref
Function: function_ref, Data: data_ref, Const: const_ref

[NOTE]
Note Contents

[WARNING]
Warning Contents

Line Block Contents 1
Line Block Contents 2

[QUOTE]
Quote Block Contents 1
Quote Block Contents 2

Target

"""

import typing
import collections.abc
import typing_extensions
import numpy.typing as npt
"""
SUBSTITUTION REPLACEMENT 'TEST_REPLACEMENT':
Test replacement text.

Paragraph: *Emphasis*

* Bullet List Item 1
* Bullet List Item 1-1
* Bullet List Item 1-2
* Bullet List Item 2
* Bullet List Item 2-1
* Bullet List Item 2-2
* Bullet List Item 2-3
* Bullet List Item 3
* Bullet List Item 3-1

1. Enumerated List Item 1
1. Enumerated List Item 1-1
2. Enumerated List Item 1-2
2. Enumerated List Item 2
1. Enumerated List Item 2-1
2. Enumerated List Item 2-2
3. Enumerated List Item 2-3
3. Enumerated List Item 3
1. Enumerated List Item 3-1

field-list-item-1: Field List Item 1 Contents
field-list-item-2: Field List Item 2 Contents

Definition List Item 1
Definition List Item 1 Contents

Definition List Item 2
Definition List Item 2 Contents

```
Literal Block Contents
```

Module: module_ref, Ref: ref_ref, Class: class_ref
Function: function_ref, Data: data_ref, Const: const_ref

[NOTE]
Note Contents

[WARNING]
Warning Contents

Line Block Contents 1
Line Block Contents 2

[QUOTE]
Quote Block Contents 1
Quote Block Contents 2

Target

"""

import typing
import collections.abc
import typing_extensions
import numpy.typing as npt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
basic.rst
<title>
Title
<substitution_definition names="TEST_REPLACEMENT">
Test replacement text.
<paragraph>
Paragraph:
<emphasis>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<code-document>
<title>
Title
<substitution_definition names="TEST_REPLACEMENT">
Test replacement text.
<paragraph>
Paragraph:
<emphasis>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Title
=====

.. |TEST_REPLACEMENT| replace:: Test replacement text.

Paragraph: *Emphasis*

* Bullet List Item 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<document source="<string>">
<source-filename>
add_bpy_ops_override_parameters.rst
<module>
<name>
bpy.ops.pose
<description>
<function function_type="function">
<name>
function_1
<description>
function_1 description
<argument-list>
<argument argument_type="arg">
<name>
arg_1
<description>
function_1 arg_1 description
<default-value>
<data-type-list>
<data-type>
function_1 arg_1 type
<return>
<description>
<data-type-list>
<function function_type="function">
<name>
function_2
<description>
function_2 description
<argument-list>
<return>
<description>
<data-type-list>
<document source="<string>">
<source-filename>
add_bpy_ops_override_parameters.rst
<module>
<name>
bpy.ops.pose
<description>
<function function_type="function">
<name>
function_1
<description>
function_1 description
<argument-list>
<argument argument_type="arg">
<name>
arg_1
<description>
function_1 arg_1 description
<default-value>
<data-type-list>
<data-type>
function_1 arg_1 type
<return>
<description>
<data-type-list>
<function function_type="function">
<name>
function_2
<description>
function_2 description
<argument-list>
<return>
<description>
<data-type-list>
Loading
Loading