Browse Source

Classes diagram

pull/45/head
Jure Šorn 5 years ago
parent
commit
f1827a6107
4 changed files with 12 additions and 12 deletions
  1. 4
      README.md
  2. 4
      index.html
  3. 8
      parse.js
  4. 8
      web/script_2.js

4
README.md

@ -1548,7 +1548,7 @@ class MyClass(metaclass=MyMetaClass):
#### Type diagram (str is an instance of type, ...): #### Type diagram (str is an instance of type, ...):
```text ```text
+---------+-------------+ +---------+-------------+
| classes | metaclasses |
| Classes | Metaclasses |
+---------+-------------| +---------+-------------|
| MyClass > MyMetaClass | | MyClass > MyMetaClass |
| | v | | | v |
@ -1561,7 +1561,7 @@ class MyClass(metaclass=MyMetaClass):
#### Inheritance diagram (str is a subclass of object, ...): #### Inheritance diagram (str is a subclass of object, ...):
```text ```text
+---------+-------------+ +---------+-------------+
| classes | metaclasses |
| Classes | Metaclasses |
+---------+-------------| +---------+-------------|
| MyClass | MyMetaClass | | MyClass | MyMetaClass |
| v | v | | v | v |

4
index.html

@ -1268,7 +1268,7 @@ param_names = list(<sig>.parameters.keys())
</code></pre> </code></pre>
<h4 id="typediagramstrisaninstanceoftype">Type diagram (str is an instance of type, …):</h4> <h4 id="typediagramstrisaninstanceoftype">Type diagram (str is an instance of type, …):</h4>
<pre><code class="text language-text">┏━━━━━━━━━┯━━━━━━━━━━━━━┓ <pre><code class="text language-text">┏━━━━━━━━━┯━━━━━━━━━━━━━┓
classes │ metaclasses ┃
Classes │ Metaclasses ┃
┠─────────┼─────────────┨ ┠─────────┼─────────────┨
┃ MyClass → MyMetaClass ┃ ┃ MyClass → MyMetaClass ┃
┃ │ ↓ ┃ ┃ │ ↓ ┃
@ -1279,7 +1279,7 @@ param_names = list(&lt;sig&gt;.parameters.keys())
</code></pre> </code></pre>
<h4 id="inheritancediagramstrisasubclassofobject">Inheritance diagram (str is a subclass of object, …):</h4> <h4 id="inheritancediagramstrisasubclassofobject">Inheritance diagram (str is a subclass of object, …):</h4>
<pre><code class="text language-text">┏━━━━━━━━━┯━━━━━━━━━━━━━┓ <pre><code class="text language-text">┏━━━━━━━━━┯━━━━━━━━━━━━━┓
classes │ metaclasses ┃
Classes │ Metaclasses ┃
┠─────────┼─────────────┨ ┠─────────┼─────────────┨
┃ MyClass │ MyMetaClass ┃ ┃ MyClass │ MyMetaClass ┃
┃ ↓ │ ↓ ┃ ┃ ↓ │ ↓ ┃

8
parse.js

@ -32,7 +32,7 @@ const TOC =
const DIAGRAM_1_A = const DIAGRAM_1_A =
'+---------+-------------+\n' + '+---------+-------------+\n' +
'| classes | metaclasses |\n' +
'| Classes | Metaclasses |\n' +
'+---------+-------------|\n' + '+---------+-------------|\n' +
'| MyClass > MyMetaClass |\n' + '| MyClass > MyMetaClass |\n' +
'| | v |\n' + '| | v |\n' +
@ -43,7 +43,7 @@ const DIAGRAM_1_A =
const DIAGRAM_1_B = const DIAGRAM_1_B =
'┏━━━━━━━━━┯━━━━━━━━━━━━━┓\n' + '┏━━━━━━━━━┯━━━━━━━━━━━━━┓\n' +
'┃ classes │ metaclasses ┃\n' +
'┃ Classes │ Metaclasses ┃\n' +
'┠─────────┼─────────────┨\n' + '┠─────────┼─────────────┨\n' +
'┃ MyClass → MyMetaClass ┃\n' + '┃ MyClass → MyMetaClass ┃\n' +
'┃ │ ↓ ┃\n' + '┃ │ ↓ ┃\n' +
@ -54,7 +54,7 @@ const DIAGRAM_1_B =
const DIAGRAM_2_A = const DIAGRAM_2_A =
'+---------+-------------+\n' + '+---------+-------------+\n' +
'| classes | metaclasses |\n' +
'| Classes | Metaclasses |\n' +
'+---------+-------------|\n' + '+---------+-------------|\n' +
'| MyClass | MyMetaClass |\n' + '| MyClass | MyMetaClass |\n' +
'| v | v |\n' + '| v | v |\n' +
@ -65,7 +65,7 @@ const DIAGRAM_2_A =
const DIAGRAM_2_B = const DIAGRAM_2_B =
'┏━━━━━━━━━┯━━━━━━━━━━━━━┓\n' + '┏━━━━━━━━━┯━━━━━━━━━━━━━┓\n' +
'┃ classes │ metaclasses ┃\n' +
'┃ Classes │ Metaclasses ┃\n' +
'┠─────────┼─────────────┨\n' + '┠─────────┼─────────────┨\n' +
'┃ MyClass │ MyMetaClass ┃\n' + '┃ MyClass │ MyMetaClass ┃\n' +
'┃ ↓ │ ↓ ┃\n' + '┃ ↓ │ ↓ ┃\n' +

8
web/script_2.js

@ -1,6 +1,6 @@
const DIAGRAM_1_A = const DIAGRAM_1_A =
'+---------+-------------+\n' + '+---------+-------------+\n' +
'| classes | metaclasses |\n' +
'| Classes | Metaclasses |\n' +
'+---------+-------------|\n' + '+---------+-------------|\n' +
'| MyClass > MyMetaClass |\n' + '| MyClass > MyMetaClass |\n' +
'| | v |\n' + '| | v |\n' +
@ -11,7 +11,7 @@ const DIAGRAM_1_A =
const DIAGRAM_1_B = const DIAGRAM_1_B =
'┏━━━━━━━━━┯━━━━━━━━━━━━━┓\n' + '┏━━━━━━━━━┯━━━━━━━━━━━━━┓\n' +
'┃ classes │ metaclasses ┃\n' +
'┃ Classes │ Metaclasses ┃\n' +
'┠─────────┼─────────────┨\n' + '┠─────────┼─────────────┨\n' +
'┃ MyClass → MyMetaClass ┃\n' + '┃ MyClass → MyMetaClass ┃\n' +
'┃ │ ↓ ┃\n' + '┃ │ ↓ ┃\n' +
@ -22,7 +22,7 @@ const DIAGRAM_1_B =
const DIAGRAM_2_A = const DIAGRAM_2_A =
'+---------+-------------+\n' + '+---------+-------------+\n' +
'| classes | metaclasses |\n' +
'| Classes | Metaclasses |\n' +
'+---------+-------------|\n' + '+---------+-------------|\n' +
'| MyClass | MyMetaClass |\n' + '| MyClass | MyMetaClass |\n' +
'| v | v |\n' + '| v | v |\n' +
@ -33,7 +33,7 @@ const DIAGRAM_2_A =
const DIAGRAM_2_B = const DIAGRAM_2_B =
'┏━━━━━━━━━┯━━━━━━━━━━━━━┓\n' + '┏━━━━━━━━━┯━━━━━━━━━━━━━┓\n' +
'┃ classes │ metaclasses ┃\n' +
'┃ Classes │ Metaclasses ┃\n' +
'┠─────────┼─────────────┨\n' + '┠─────────┼─────────────┨\n' +
'┃ MyClass │ MyMetaClass ┃\n' + '┃ MyClass │ MyMetaClass ┃\n' +
'┃ ↓ │ ↓ ┃\n' + '┃ ↓ │ ↓ ┃\n' +

Loading…
Cancel
Save