xonsh/docs/_templates/index.html
2024-08-06 13:24:35 +02:00

735 lines
36 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- This is SEO section. Don't change if you don't know how it will affect Google and other search engines. -->
<title>The Xonsh Shell — Python-powered shell. Python shell. Python in the shell. Shell in Python. Shell and Python. Python and shell.</title>
<meta name="description" content="The xonsh shell is a Python-powered shell. Full-featured and cross-platform.">
<meta name="keywords" content="xonsh, xonsh shell, python shell, terminal, console, bash alternative, zsh alternative, fish alternative, devops tools, hacking tools">
<meta name="twitter:image:src" content="https://xon.sh/_static/landing2/images/xonsh_landing_preview.png" />
<meta name="twitter:site" content="https://xon.sh/" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="The Xonsh Shell — Python-powered shell" />
<meta name="twitter:description" content="The xonsh shell is a Python-powered shell. Full-featured and cross-platform." />
<meta property="og:image" content="https://xon.sh/_static/landing2/images/xonsh_landing_preview.png" />
<meta property="og:image:alt" content="The xonsh shell is a Python-powered shell. Full-featured and cross-platform." />
<meta property="og:site_name" content="The xonsh shell" />
<meta property="og:type" content="object" />
<meta property="og:title" content="The Xonsh Shell — Python-powered shell." />
<meta property="og:url" content="https://xon.sh/" />
<meta property="og:description" content="The xonsh shell is a Python-powered shell. Full-featured and cross-platform." />
<!-- The end of SEO section. -->
<link rel="shortcut icon" type="image/png" href="_static/landing2/images/conch_pixel-128.png">
<link rel="stylesheet" type="text/css" href="_static/landing2/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="_static/landing2/css/owl.css">
<link rel="stylesheet" type="text/css" href="_static/landing2/css/magnific-popup.css">
<link rel="stylesheet" type="text/css" href="_static/landing2/css/icofont.css">
<link rel="stylesheet" type="text/css" href="_static/landing2/css/animate.css">
<link rel="stylesheet" type="text/css" href="_static/landing2/css/style.css">
<link rel="stylesheet" type="text/css" href="_static/landing2/css/responsive.css">
<style>
.code {
background: #31363b;
color: white;
text-align: left;
font-family: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
padding: 20px;
border-radius: 10px;
}
[unselectable-text] {
color: #3daee9;
}
[unselectable-text]::after {
content: attr(unselectable-text);
}
</style>
</head>
<body>
<div class="preloader" style="display: none;">
<div class="d-table">
<div class="d-table-cell align-middle">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
</div>
</div>
<header id="header" class="">
<div class="container">
<nav class="navbar navbar-light navbar-expand-lg justify-content-center">
<a class="logo" href="https://xon.sh"><img src="_static/landing2/images/logo.png" alt="logo"></a>
<button class="navbar-toggler ml-1" type="button" data-toggle="collapse" data-target="#NavbarContent">
<span class="icofont-navigation-menu"></span>
</button>
<div class="navbar-collapse collapse justify-content-between align-items-center w-100" id="NavbarContent">
<ul class="navbar-nav mx-auto text-center">
<li class="nav-item">
<a class="nav-link active" href="#home-area" data-scroll-nav="0">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about-area" data-scroll-nav="1">What is Xonsh?</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#features-area" data-scroll-nav="2">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#faq-area" data-scroll-nav="3">Install</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#product-area" data-scroll-nav="4">Xontribs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#blog-area" data-scroll-nav="5">Talks</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contents.html">Docs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/xonsh/xonsh" target="_blank">Github</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/sponsors/xonsh" target="_blank">Donate</a>
</li>
</ul>
</div>
</nav>
</div>
</header>
<section id="home-area" data-scroll-index="0" style="background-image: url(_static/landing2/images/banner-1.png)">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-5">
<div class="caption-img text-center d-table">
<div class="d-table-cell align-middle">
<img src="_static/landing2/images/conch_ascii.png" class="img-fluid" alt="" width="260px">
</div>
</div>
</div>
<div class="col-lg-6 col-md-7">
<div class="caption d-table">
<div class="d-table-cell align-middle" >
<h2 style="color:white;"><b>XONSH</b> is a Python-powered shell</h2>
<br>
<p style="font-size: 20px; font-weight: 1;">Xonsh is a modern, full-featured and cross-platform shell. The language is a superset of Python 3.6+ with additional shell primitives that you are used to from Bash and IPython.
It works on all major systems including Linux, OSX, and Windows. Xonsh is meant for the daily use of experts and novices.</p>
<a href="#" data-scroll-nav="3"><i class="icofont-download"></i> Install</a>
<a href="https://xon.sh/contents.html" target="_blank"><i class="icofont-ui-note"></i> Docs</a>
<a href="https://github.com/xonsh/xonsh" target="_blank"><i class="icofont-github"></i> Github</a>
<a href="https://github.com/sponsors/xonsh" target="_blank"><i class="icofont-dollar"></i> Donate</a>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="about-area" data-scroll-index="1">
<div class="container text-center section-heading">
<h2>What is Xonsh?</h2>
<p>The xonsh shell lets you easily mix Python and shell commands in a powerful and simplified approach to the command line.</p>
</div>
<div class="container" style="margin-top: 30px">
<div class="row">
<div class="col-lg-6 col-md-7">
<div class="about-content">
<h3>Xonsh is the Shell</h3>
<p>The xonsh language has shell primitives that you are used to from Bash. <a href="https://xon.sh/tutorial.html" target="_blank">Read more →</a></p>
</div>
</div>
<div class="col-lg-6 col-md-5">
<div class="text-center">
<pre class="code">
<span unselectable-text="@ "></span><b>cd</b> /home
<span unselectable-text="@ "></span><b>cat</b> /etc/passwd | <b>grep</b> root
<span unselectable-text="@ "></span><b>ls</b> -la</pre>
</div>
</div>
</div>
</div>
<div class="container" style="margin-top: 30px">
<div class="row">
<div class="col-lg-6 col-md-7">
<div class="about-content">
<h3>Xonsh is Python</h3>
<p>The xonsh language is a superset of Python 3.6+ and you can run Python code and import modules. <a href="https://xon.sh/tutorial.html" target="_blank">Read more →</a></p>
</div>
</div>
<div class="col-lg-6 col-md-5">
<div class="text-center">
<pre class="code">
<span unselectable-text="@ "></span>2 + 2
<span unselectable-text="@ "></span><b>import</b> json
<span unselectable-text=" "></span>j = json.loads(<span style="color: lightblue;">'{"Hello": "world!", "Answer": 42}'</span>)
<span unselectable-text=" "></span><b>print</b>(j[<span style="color: lightblue;">'Answer'</span>])</pre>
</div>
</div>
</div>
</div>
<div class="container" style="margin-top: 30px">
<div class="row">
<div class="col-lg-6 col-md-7">
<div class="about-content">
<h3>Xonsh is the Shell in Python</h3>
<p>With xonsh you can combine Python with shell commands. <a href="https://xon.sh/tutorial.html" target="_blank">Read more →</a></p>
</div>
</div>
<div class="col-lg-6 col-md-5">
<div class="text-center">
<pre class="code">
<span unselectable-text="@ "></span><b>len</b>(<span style="color: lightgreen">$(curl -L https://xon.sh)</span>)
<span unselectable-text="@ "></span><b>for</b> filename <b>in</b> <span style="color: yellow">`.*`</span>:
<span unselectable-text=" "></span> <b>print</b>(filename)
<span unselectable-text=" "></span> <b>du</b> -sh <span style="color: lightsalmon">@(filename)</span></pre>
</div>
</div>
</div>
</div>
<div class="container" style="margin-top: 30px">
<div class="row">
<div class="col-lg-6 col-md-7">
<div class="about-content">
<h3>Xonsh is Python in the Shell</h3>
<p>Prepare environment variables and arguments in Python and use them in shell commands. <a href="https://xon.sh/tutorial.html" target="_blank">Read more →</a></p>
</div>
</div>
<div class="col-lg-6 col-md-5">
<div class="text-center">
<pre class="code">
<span unselectable-text="@ "></span>var = <span style="color: lightblue;">'he'</span> + <span style="color: lightblue;">'llo'</span>
<span unselectable-text="@ "></span><b>echo</b> <span style="color: lightsalmon">@(var)</span> > /tmp/<span style="color: lightsalmon">@(var)</span>
<span unselectable-text="@ "></span><b>echo</b> <span style="color: lightsalmon">@(i for i in range(42))</span></pre>
</div>
</div>
</div>
</div>
</section>
<section id="features-area" data-scroll-index="2">
<div class="container">
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-8 offset-md-2">
<div class="section-heading text-center">
<h2>Xonsh Features</h2>
<p>Xonsh is a super-charged shell that enables you to work quickly and effectively! Some of the features that help set xonsh apart are:</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="features-single">
<div class="icon">
<i class="icofont-terminal"></i>
</div>
<div class="content">
<h4>Combine shell commands with Python or vice versa.</h4>
<p>The language is a superset of Python 3.6+ with additional shell primitives that you are used to from Bash and IPython.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="features-single">
<div class="icon">
<i class="icofont-light-bulb"></i>
</div>
<div class="content">
<h4>Xontribs - the 3rd-party extension system.</h4>
<p>Xontributions, or xontribs, are a set of tools and conventions for extending the functionality of xonsh.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="features-single">
<div class="icon">
<i class="icofont-history"></i>
</div>
<div class="content">
<h4>Rich interface to discover history</h4>
<p>The xonsh shell creates history files with rich structure and metadata and an API for interacting with them.</p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="features-single">
<div class="icon">
<i class="icofont-fix-tools"></i>
</div>
<div class="content">
<h4>Powerful prompt customisation</h4>
<p>Customisable tab completion, key bindings, color styles are on board by default.</p>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="faq-area" data-scroll-index="3">
<div class="container">
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-8 offset-md-2">
<div class="section-heading text-center">
<h2>Install Xonsh</h2>
<p>Xonsh can be installed and run with various package managers, by using appimage, or from a docker container.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-8 offset-lg-2 col-md-10 offset-md-1">
<div id="accordion" role="tablist">
<div class="card">
<div class="card-header active" role="tab" id="faq1">
<h5 class="mb-0">
<a data-toggle="collapse" href="#collapse0" aria-expanded="true" aria-controls="collapse0">PyPi package</a>
</h5>
</div>
<div id="collapse0" class="collapse show" role="tabpanel" aria-labelledby="faq1" data-parent="#accordion">
<div class="card-body">
<p>Install the <a href="https://github.com/xonsh/xonsh/releases">latest release</a>:</p>
<pre class="code">python -m pip install 'xonsh[full]'</pre>
<a href="https://xon.sh/packages.html">Learn more →</a>
</div>
</div>
</div>
<div class="card">
<div class="card-header" role="tab" id="faq2">
<h5 class="mb-0">
<a data-toggle="collapse" href="#collapse1" aria-expanded="false" aria-controls="collapse1">Install as a core shell</a>
</h5>
</div>
<div id="collapse1" class="collapse" role="tabpanel" aria-labelledby="faq2" data-parent="#accordion">
<div class="card-body">
<p>
When using xonsh as a default shell (and we do!), it's important to ensure that it is installed
in a Python environment that is independent of changes from the system package manager.
If you are installing xonsh via your system package-manager, this is handled for you.
If you install xonsh outside of your system package manager, you can use
<a href="https://github.com/anki-code/xonsh-install">xonsh-install</a> for this.
</p>
</div>
</div>
</div>
<div class="card">
<div class="card-header" role="tab" id="faq3">
<h5 class="mb-0">
<a class="collapsed" data-toggle="collapse" href="#collapse2" aria-expanded="false" aria-controls="collapse2">Conda package</a>
</h5>
</div>
<div id="collapse2" class="collapse" role="tabpanel" aria-labelledby="faq2" data-parent="#accordion">
<div class="card-body">
<p>Install:</p>
<pre class="code">
conda config --add channels conda-forge
conda install xonsh</pre>
<a href="https://xon.sh/packages.html">Learn more →</a>
</div>
</div>
</div>
<div class="card">
<div class="card-header" role="tab" id="faq4">
<h5 class="mb-0">
<a class="collapsed" data-toggle="collapse" href="#collapse3" aria-expanded="false" aria-controls="collapse3">Portable Linux AppImage</a>
</h5>
</div>
<div id="collapse3" class="collapse" role="tabpanel" aria-labelledby="faq3" data-parent="#accordion">
<div class="card-body">
<p>
<a href="https://appimage.org/">AppImage</a> is a format for distributing portable software on Linux without needing superuser permissions to install the application.
The xonsh AppImage file contains both xonsh and Python and allows xonsh to be run on any AppImage-supported Linux distribution without installation or root access.
</p>
<p>
Download and run:
</p>
<pre class="code">
wget https://github.com/xonsh/xonsh/releases/latest/download/xonsh-x86_64.AppImage
chmod +x xonsh-x86_64.AppImage
./xonsh-x86_64.AppImage</pre>
<a href="https://xon.sh/appimage.html" target="_blank">Learn more →</a>
</div>
</div>
</div>
<div class="card">
<div class="card-header" role="tab" id="faq5">
<h5 class="mb-0">
<a class="collapsed" data-toggle="collapse" href="#collapse4" aria-expanded="false" aria-controls="collapse4">Docker container</a>
</h5>
</div>
<div id="collapse4" class="collapse" role="tabpanel" aria-labelledby="faq4" data-parent="#accordion">
<div class="card-body">
<p>
Xonsh publishes a handful of containers, primarily targeting CI and automation use cases. All of them are published on <a href="https://hub.docker.com/u/xonsh">Docker Hub</a>.
</p>
<p>
Run the xonsh shell in a small size docker container:
</p>
<pre class="code">docker run -it --rm xonsh/xonsh:slim</pre>
</div>
</div>
</div>
<div class="card">
<div class="card-header" role="tab" id="faq6">
<h5 class="mb-0">
<a class="collapsed" data-toggle="collapse" href="#collapse5" aria-expanded="false" aria-controls="collapse5">Platform package managers: brew, apt, pacman, dnf, guix</a>
</h5>
</div>
<div id="collapse5" class="collapse" role="tabpanel" aria-labelledby="faq5" data-parent="#accordion">
<div class="card-body">
<p>
Another way is to install xonsh from the package manager that is supplied by the operating system. This way is <b>not</b> recommended
because in operating systems without the <a href="https://en.wikipedia.org/wiki/Rolling_release">rolling release concept</a>
the xonsh shell version may be very old (<a href="https://github.com/xonsh/xonsh/releases/">check latest release</a>).
</p>
<p>OSX brew:</p><pre class="code">brew install xonsh</pre>
<p>Debian/Ubuntu apt:</p><pre class="code">apt install xonsh</pre>
<p>Arch Linux pacman:</p><pre class="code">pacman -S xonsh</pre>
<p>Fedora dnf:</p><pre class="code">dnf install xonsh</pre>
<p>GNU guix:</p><pre class="code">guix install xonsh</pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="text-center">
<p style="margin-top: 30px;">
<a href="https://xon.sh/contents.html#installation" target="_blank"> <i class="icofont-ui-note"></i> More installation methods →</a>
</p>
</div>
</div>
</section>
<section id="product-area" data-scroll-index="4">
<div class="container">
<div class="row">
<div class="col-lg-6 offset-lg-3 col-md-8 offset-md-2">
<div class="section-heading text-center">
<h2>Xontribs</h2>
<p>Xontributions, or xontribs, are a set of tools and conventions for extending the functionality of xonsh. </p>
</div>
</div>
</div>
<div class="row" id="github_xontribs">
<div class="col-lg-3 col-md-6">
<div class="product-single text-center">
<div class="prod-details">
<p>
<a href="https://github.com/anki-code/xontrib-pipeliner" target="_blank">pipeliner</a>
</p>
<p>Let your pipe lines from the standard output flow thru the Python code in the xonsh shell. </p>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="product-single text-center">
<div class="prod-details">
<p>
<a href="https://github.com/anki-code/xontrib-output-search" target="_blank">output-search</a>
</p>
<p>Get identifiers, paths, URLs and words from the previous command output and use them for the next command in the xonsh shell. </p>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="product-single text-center">
<div class="prod-details">
<p>
<a href="https://github.com/anki-code/xontrib-back2dir" target="_blank">back2dir</a>
</p>
<p>Return to the most recently used directory when starting the xonsh shell.</p>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6">
<div class="product-single text-center">
<div class="prod-details">
<p>
<a href="https://github.com/anki-code/xontrib-argcomplete" target="_blank">argcomplete</a>
</p>
<p>Argcomplete support to tab completion of python and xonsh scripts in the xonsh shell. </p>
</div>
</div>
</div>
</div>
<div class="row" id="github_xontribs_api">
</div>
<div class="col-lg-12">
<div class="load-more-btn text-center">
<a href="https://github.com/topics/xontrib" target="_blank"><i class="icofont-download"></i> More xontribs →</a>
</div>
</div>
</div>
</section>
<section id="blog-area" data-scroll-index="5">
<div class="container">
<div class="col-lg-6 offset-lg-3 col-md-8 offset-md-2">
<div class="section-heading text-center">
<h2>Talks about xonsh</h2>
<p>Some interesting publications around xonsh.</p>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="blog-single">
<a href="https://analyticsindiamag.com/top-10-trending-python-projects-on-github-2020/" target="_blank"><img src="_static/landing2/images/blog-1.jpg" class="img-fluid" alt=""></a>
<div class="post-content">
<a href="">25 Aug, 2020</a>
<h3 class="m-0"><a href="https://analyticsindiamag.com/top-10-trending-python-projects-on-github-2020/" target="_blank">Xonsh in TOP10 trending projects</a></h3>
<p>We're listing down the top 10 trending open-source projects In Python on GitHub and the xonsh shell is one of these projects.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="blog-single">
<a href="https://www.youtube.com/watch?v=ujo9sbqHFqw" target="_blank"><img src="_static/landing2/images/blog-3.jpg" class="img-fluid" alt=""></a>
<div class="post-content">
<a href="">11 Jul, 2019</a>
<h3 class="m-0"><a href="https://www.youtube.com/watch?v=ujo9sbqHFqw" target="_blank">Xonsh on Scipy 2019 conference</a></h3>
<p>A. Scopatz and G. Forsyth gave a two hour presentation of xonsh.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="blog-single">
<a href="https://www.youtube.com/watch?v=uaje5I22kgE" target="_blank"><img src="_static/landing2/images/blog-2.jpg" class="img-fluid" alt=""></a>
<div class="post-content">
</small><a href="">01 Jun, 2016</a>
<h3 class="m-0"><a href="https://www.youtube.com/watch?v=uaje5I22kgE" target="_blank">Xonsh on PyCon 2016 </a></h3>
<p>The first big presentation of Xonsh from Anthony Scopatz!</p>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="contact-area">
<div class="container">
</div>
</section>
<footer id="footer">
<div class="container">
<div class="container text-white" >
<div class="row footer_inner ">
<div class="col-lg-3 col-sm-6 ">
<div class="f_title">
<h4>Xonsh</h4>
</div>
<p>
<a href="https://xon.sh/">Website</a>
</p>
<p>
<a href="https://xon.sh/contents.html">Documentation</a></li>
</p>
<p>
<a href="https://github.com/xonsh/xonsh/releases">Releases</a>
</p>
<p>
<a href="https://github.com/xonsh/xonsh">Source Code</a>
</p>
<p>
<a href="https://hub.docker.com/u/xonsh">Docker Hub</a>
</p>
<p>
<a href="https://github.com/sponsors/xonsh">Donate</a>
</p>
</div>
<div class="col-lg-3 col-sm-6">
<div class="f_title">
<h4>Community</h4>
</div>
<p>
<a href="https://xonsh.zulipchat.com/join/hbvue5rimpdkwkdjuiqfs7tv/">Zulip Community</a>
</p>
<p>
<a href="https://github.com/xonsh/xonsh/issues">Issue Tracker</a>
</p>
<p>
<a href="https://github.com/xonsh/xonsh/discussions">Discussions</a>
</p>
<p>
<a href="https://mastodon.online/@xonsh">Mastodon</a>
</p>
<p>
<a href="https://groups.google.com/forum/#!forum/xonsh">Mailing List</a>
</p>
<p>
<a href="http://www.oftc.net/">IRC</a>, <a href="https://gitter.im/xonsh/xonsh">Gitter</a>
</p>
</div>
<div class="col-lg-3 col-sm-6">
<div class="f_title">
<h4>Xontribs</h4>
</div>
<p>
<a href="https://github.com/topics/xontrib">Github xontribs</a>
</p>
<p>
<a href="https://github.com/xonsh/awesome-xontribs#awesome-xontribs">Awesome xontribs</a>
</p>
<p>
<a href="https://xon.sh/tutorial_xontrib.html">Xontrib tutorial</a>
</p>
<p>
<a href="https://github.com/xonsh/xontrib-template">Xontrib template</a>
</p>
</div>
<div class="col-lg-3 col-sm-6">
<div class="f_title">
<h4>Open Source</h4>
</div>
<p>
<a href="https://github.com/xonsh/xonsh/blob/main/license" target="_blank">License</a>
</p>
<p>
<a href="https://github.com/xonsh/xonsh" target="_blank">Github</a>
</p>
<p>
<a href="https://xon.sh/devguide.html" target="_blank">Developers Guide</a>
</p>
</div>
</div>
</div>
</div>
</footer>
<script src="_static/landing2/js/jquery-3.js"></script>
<script src="_static/landing2/js/popper.js"></script>
<script src="_static/landing2/js/bootstrap.js"></script>
<script src="_static/landing2/js/magnific-popup.js"></script>
<script src="_static/landing2/js/owl.js"></script>
<script src="_static/landing2/js/scrollIt.js"></script>
<script src="_static/landing2/js/validator.js"></script>
<script src="_static/landing2/js/contact.js"></script>
<script src="_static/landing2/js/custom.js"></script>
<script language="JavaScript">
var tagsToReplace = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;'
};
function replaceTag(tag) {
return tagsToReplace[tag] || tag;
}
function safe_tags_replace(str) {
return str.replace(/[&<>]/g, replaceTag);
}
function getRandomSubarray(arr, size) {
var shuffled = arr.slice(0), i = arr.length, temp, index;
while (i--) {
index = Math.floor((i + 1) * Math.random());
temp = shuffled[index];
shuffled[index] = shuffled[i];
shuffled[i] = temp;
}
return shuffled.slice(0, size);
}
function sentence(string) {
string = safe_tags_replace(string)
string = string.trim()
string = string.charAt(0).toUpperCase() + string.slice(1);
last_char = string.charAt(string.length-1)
if(last_char != '.' && last_char != '!' && last_char != '?'){
string += '.'
}
return string
}
$( "#github_xontribs_api" ).html( 'Loading xontribs list...' );
$.get( "https://api.github.com/search/repositories?q=topic:xontrib&sort=stars")
.done(function( data ) {
xontribs = ''
getRandomSubarray(data['items'], 8).forEach(function (repo, index) {
xontribs += '<div class="col-lg-3 col-md-6"><div class="product-single text-center"><div class="prod-details"><p><a href="' + repo['html_url'] + '" target="_blank">'+repo['name']+'</a></p><p>' + sentence(repo['description']) + '<div class="icon"><i class="icofont-star"></i>' + repo['stargazers_count'] + '</div> </p></div></div></div>';
});
$( "#github_xontribs" ).hide();
$( "#github_xontribs_api" ).html( xontribs );
})
.fail(function(data){
$( "#github_xontribs_api" ).html('');
});
</script>
<script data-goatcounter="https://xonsh.goatcounter.com/count"
async src="//gc.zgo.at/count.js"></script>
</body></html>