MkInstallGuide
:fa-brands-github: Show source on GitHub
Node to display an install guide.¶
Example: Regular¶
pip¶
The latest released version is available at the Python package index.
pipx¶
pipx allows for the global installation of Python applications in isolated environments.
Example: Explicit¶
pip¶
The latest released version is available at the Python package index.
pipx¶
pipx allows for the global installation of Python applications in isolated environments.
### pip
The latest released version is available at the [Python package index](https://pypi.org/project/mkdocs).
```` {.python }
pip install mkdocs
````
### pipx
[pipx](https://github.com/pypa/pipx) allows for the global installation of Python applications in isolated environments.
```` {.python }
pipx install mkdocs
````
<h3 id="pip">pip</h3>
<p>The latest released version is available at the <a href="https://pypi.org/project/mkdocs">Python package index</a>.</p>
<div class="language-python highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">pip</span> <span class="n">install</span> <span class="n">mkdocs</span>
</span></code></pre></div>
<h3 id="pipx">pipx</h3>
<p><a href="https://github.com/pypa/pipx">pipx</a> allows for the global installation of Python applications in isolated environments.</p>
<div class="language-python highlight"><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="n">pipx</span> <span class="n">install</span> <span class="n">mkdocs</span>
</span></code></pre></div>
Bases: MkTemplate
__init__
¶
__init__(
distribution: str | None = None,
*,
package_repos: list[InstallMethodStr] | None = None,
header_level: int = 3,
**kwargs: Any
) -> None
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
distribution
|
str | None
|
name of the distribution to install |
None
|
package_repos
|
list[InstallMethodStr] | None
|
package repositories the project is available on |
None
|
header_level
|
int
|
Header level for each section |
3
|
kwargs
|
Any
|
Keyword arguments passed to parent |
{}
|
| Name | Children | Inherits |
|---|---|---|
| MkTemplate mknodes.templatenodes.mktemplate Node representing a jinja template. |
graph TD
2805510712["mkinstallguide.MkInstallGuide"]
1289759389["mktemplate.MkTemplate"]
3160803176["rendercache.TemplateRenderMixin"]
2751680898["builtins.object"]
835538629["mkcontainer.MkContainer"]
1956333208["mkcontainer.MkContainerBase"]
1359323199["mknode.MkNode"]
1289759389 --> 2805510712
3160803176 --> 1289759389
2751680898 --> 3160803176
835538629 --> 1289759389
1956333208 --> 835538629
1359323199 --> 1956333208
2751680898 --> 1359323199
/home/runner/work/mknodes/mknodes/src/mknodes/templatenodes/mkinstallguide/metadata.toml
[metadata]
name = "MkInstallGuide"
icon = "mdi:help"
group = "documentation"
virtual_children = true
[examples.regular]
title = "Regular"
jinja = """
{{ mk.MkInstallGuide() }}
"""
[examples.explicit]
title = "Explicit"
jinja = """
{{ "mkdocs" | MkInstallGuide(package_repos=["pip", "pipx"]) }}
"""
[output.markdown]
template = """
{% for method in node.package_repos %}
{{ method.ID | MkHeader(level=node.header_level) }}
{{ method.info_text() }}
{{ method.install_instructions() | MkCode }}
{% endfor %}
"""
# proj = self.associated_distribution
# if method.ID == "pip" and proj and (extras := proj.info.extras):
# extras_str = ",".join(extras)
# text = f"{method.install_instructions()}[{extras_str}]"
# code = mkcode.MkCode(text)
# items.append(code)