Repository navigation
Draw a hierarchy as a tree with the 'tree' directive - #18
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 10 minor |
| CodeStyle | 22 minor |
| Complexity | 1 minor |
🟢 Metrics 83 complexity · 0 duplication
Metric Results Complexity 83 Duplication 0
🟢 Coverage 98.85% diff coverage · +5.23% coverage variation
Metric Results Coverage variation ✅ +5.23% coverage variation (-1.00%) Diff coverage ✅ 98.85% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (4e11707) 1138 674 59.23% Head commit (b21f0ee) 1311 (+173) 845 (+171) 64.45% (+5.23%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#18) 174 172 98.85% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #18 +/- ##
==========================================
+ Coverage 58.43% 63.61% +5.17%
==========================================
Files 7 10 +3
Lines 1138 1311 +173
Branches 188 220 +32
==========================================
+ Hits 665 834 +169
- Misses 464 466 +2
- Partials 9 11 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
The content is an indented list in the style of a YAML block sequence; an entry's text is inline ReST, so roles like ':class:' and ':ref:' link. Options set an icon per root, node and leaf, the expanded and collapsed icons, and how many levels are expanded initially. HTML draws every entry with children as a foldable '<details>' element and the stylesheet draws the lines; other builders render nested bullet lists. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
An entry starts with '-' or with a marker declared by ':icons:', each with its own icon - e.g. '> 📁' for an empty directory. A trailing colon is text again. The examples write icons as characters. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
1ddcce8 to
4ee117b
Compare
sphinx_rtd_theme spaces every block in a list item by 12px. Below an entry's '<details>', that margin ended up between the entry and its next sibling, outside both of their lines, and left a gap in the vertical line. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
…ndscape The node classes move to pyTooling.Sphinx.Node, their HTML visitors to pyTooling.Sphinx.HTML as visit_*/depart_* with a translate* pair each. NODES lists every node with its visitors per output format as a RegisteredNode, and setup() registers them in a loop. LaTeX visitors are optional: the tree has none and falls back to its base-classes. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
…-string Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
New Features
pyTooling.Sphinx.Tree:tree: draws a hierarchy (a directory, a class hierarchy, a testsuite's structure) as a tree. It replaces a hierarchy drawn by hand in a code block.-gives an entry the icon of its kind.:icons:declares more markers, each with its own icon, whatever the entry's kind is - e.g.> 📁for an empty directory, which is a leaf.:class:,:mod:and:ref:link.:root-icon:,:node-icon:and:leaf-icon:: none by default.:expanded-icon:and:collapsed-icon::▾/▸by default.:icons::<marker> <icon>, separated by commas, also across lines. A marker is one character, not a letter or a digit; declaring-replaces the kind icons.U+1F4C1). An option without a value draws no icon.:expanded-levels:: how many levels are expanded initially. Default: all.:class:: additional CSS classes.<details>/<summary>element, so it folds and unfolds on a click, without JavaScript.├,└) and shows the expanded or the collapsed icon. It resets a theme's vertical margins inside a list item: sphinx_rtd_theme's 12px below a<details>left a gap in the vertical line.aria-hidden.--pyTooling-tree-*).TreeItemandTreeLabelderive fromlist_itemandparagraph. Sphinx dispatches a visitor along the MRO, so a builder without its own visitor falls back to the base class.pyTooling.Tree.Nodeinstances.Landscape, so its nodes can be merged in unchanged:pyTooling.Sphinx.Node: the node classesTreeItemandTreeLabel,RegisteredNode(name,node,html, optionallatex), and the type aliasesvisitFunc/departFunc.pyTooling.Sphinx.HTML:visit_*/depart_*per node and atranslate*pair of both.pyTooling.Sphinx.NODES: every node with its visitors;setup()registers them in a loop.Documentation
:expanded-levels: 1), the content rules, the options, the CSS custom properties and the error messages.pyTooling.Sphinxand in News.doc/conf.py: an annotatedautodoc-skip-memberhandler skips the membersTreeItemandTreeLabelinherit fromdocutils.nodes. Otherwise:inherited-members:renders each of them, and their docutils-style doc-strings caused 42 build errors.Unit Tests
tests/unit/Tree.pycovers the content parser and the icon option converter::icons:converter: markers and icons across lines, no value, and each error message.tests/unit/Extension.py:Registration.Nodes:setup()registers exactly the entries ofNODES.TreeRenderingbuilds small projects: the HTML structure (<details>, both expander icons, kind classes, a resolved:ref:),:expanded-levels:, the LaTeX output (three nesteditemize, no icons), and the line numbers of both kinds of error.Project._buildtakes the builder's name.