162 lines
7.3 KiB
HTML
162 lines
7.3 KiB
HTML
<!DOCTYPE html>
|
||
<html class="writer-html5" lang="en" data-content_root="./">
|
||
<head>
|
||
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<title>Welcome to nodestack’s documentation! — nodestack 0.1 documentation</title>
|
||
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
||
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
|
||
|
||
|
||
<!--[if lt IE 9]>
|
||
<script src="_static/js/html5shiv.min.js"></script>
|
||
<![endif]-->
|
||
|
||
<script src="_static/documentation_options.js?v=2709fde1"></script>
|
||
<script src="_static/doctools.js?v=888ff710"></script>
|
||
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
||
<script src="_static/js/theme.js"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="next" title="API" href="api.html" />
|
||
</head>
|
||
|
||
<body class="wy-body-for-nav">
|
||
<div class="wy-grid-for-nav">
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
<div class="wy-side-scroll">
|
||
<div class="wy-side-nav-search" >
|
||
|
||
|
||
|
||
<a href="#" class="icon icon-home">
|
||
nodestack
|
||
</a>
|
||
<div role="search">
|
||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="#">nodestack</a>
|
||
</nav>
|
||
|
||
<div class="wy-nav-content">
|
||
<div class="rst-content">
|
||
<div role="navigation" aria-label="Page navigation">
|
||
<ul class="wy-breadcrumbs">
|
||
<li><a href="#" class="icon icon-home" aria-label="Home"></a></li>
|
||
<li class="breadcrumb-item active">Welcome to nodestack’s documentation!</li>
|
||
<li class="wy-breadcrumbs-aside">
|
||
<a href="_sources/index.rst.txt" rel="nofollow"> View page source</a>
|
||
</li>
|
||
</ul>
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div itemprop="articleBody">
|
||
|
||
<section id="welcome-to-nodestack-s-documentation">
|
||
<h1>Welcome to nodestack’s documentation!<a class="headerlink" href="#welcome-to-nodestack-s-documentation" title="Link to this heading">¶</a></h1>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>This project is under active development.</p>
|
||
</div>
|
||
</section>
|
||
<section id="nodestack">
|
||
<h1>Nodestack<a class="headerlink" href="#nodestack" title="Link to this heading">¶</a></h1>
|
||
<p>Nodestack is a library that allows user to build structured trees of datas.</p>
|
||
<p>Project is under active development. Have a look at the repository for usage. Feel free to push patches.</p>
|
||
<section id="content">
|
||
<h2>Content:<a class="headerlink" href="#content" title="Link to this heading">¶</a></h2>
|
||
<div class="toctree-wrapper compound">
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="api.html">API</a><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="api.html#nodestack.Node"><code class="docutils literal notranslate"><span class="pre">Node</span></code></a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</section>
|
||
<section id="installation">
|
||
<h2>Installation:<a class="headerlink" href="#installation" title="Link to this heading">¶</a></h2>
|
||
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp gp-VirtualEnv">(venv)</span> <span class="gp">$ </span>git<span class="w"> </span>clone<span class="w"> </span>https://gitea.lutix.org/ftg/nodestack.git
|
||
</pre></div>
|
||
</div>
|
||
<p>or</p>
|
||
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp gp-VirtualEnv">(venv)</span> <span class="gp">$ </span>pip<span class="w"> </span>install<span class="w"> </span>nodestack
|
||
</pre></div>
|
||
</div>
|
||
<p>Source code is hosted on my own instance of <a class="reference external" href="https://gitea.lutix.org/ftg/nodestack">gitea</a>.</p>
|
||
</section>
|
||
<section id="basic-usage">
|
||
<h2>Basic Usage:<a class="headerlink" href="#basic-usage" title="Link to this heading">¶</a></h2>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">nodestack</span>
|
||
|
||
<span class="k">class</span> <span class="nc">Person</span><span class="p">(</span><span class="n">nodestack</span><span class="o">.</span><span class="n">Node</span><span class="p">):</span>
|
||
<span class="k">pass</span>
|
||
|
||
<span class="n">bob</span> <span class="o">=</span> <span class="n">Person</span><span class="p">(</span><span class="s1">'Bob'</span><span class="p">)</span>
|
||
<span class="n">eve</span> <span class="o">=</span> <span class="n">Person</span><span class="p">(</span><span class="s1">'Eve'</span><span class="p">)</span>
|
||
<span class="n">alice</span> <span class="o">=</span> <span class="n">Person</span><span class="p">(</span><span class="s1">'Alice'</span><span class="p">)</span>
|
||
<span class="n">alice_again</span> <span class="o">=</span> <span class="n">Person</span><span class="p">(</span><span class="s1">'Alice'</span><span class="p">)</span> <span class="c1"># will raise an error</span>
|
||
|
||
|
||
<span class="c1"># Alice is parent of bob and eve</span>
|
||
<span class="n">alice</span><span class="o">.</span><span class="n">add_child</span><span class="p">(</span><span class="n">bob</span><span class="p">)</span>
|
||
<span class="n">alice</span><span class="o">.</span><span class="n">add_child</span><span class="p">(</span><span class="n">eve</span><span class="p">)</span>
|
||
|
||
<span class="n">alice</span><span class="o">.</span><span class="n">pretty_print</span><span class="p">()</span>
|
||
|
||
<span class="n">Alice</span>
|
||
<span class="o">--</span> <span class="n">Bob</span>
|
||
<span class="o">--</span> <span class="n">Eve</span>
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
||
<a href="api.html" class="btn btn-neutral float-right" title="API" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<p>© Copyright 2024, fabthegreat.</p>
|
||
</div>
|
||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||
|
||
|
||
</footer>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
<script>
|
||
jQuery(function () {
|
||
SphinxRtdTheme.Navigation.enable(true);
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
</html> |