Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 21, 2024
1 parent 379af39 commit afddd2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
from sys import path as sys_path

from sphinxcontrib.domaintools import custom_domain
if 'TERMUX_VERSION' not in environ:
try:
from ghlinguist import linguist
import matplotlib.pyplot as plt
except Exception:
pass

basedir = path.abspath(path.join(path.dirname(__file__), '..'))
sys_path.insert(0, basedir)
Expand Down Expand Up @@ -98,14 +100,16 @@
}

def setup(app):
if 'TERMUX_VERSION' not in environ:
try:
langs = linguist(basedir)
labels = [lang[0] for lang in langs]
sizes = [lang[1] for lang in langs]
fig, ax = plt.subplots()
pie = ax.pie(sizes, labels=labels, autopct='%1.1f%%', labeldistance=None, pctdistance=0.85)
plt.legend(title='Languages', loc='right', bbox_to_anchor=(1,0.5), bbox_transform=plt.gcf().transFigure)
plt.savefig('languages.svg', transparent=True, bbox_inches='tight')
except Exception:
pass

app.add_domain(custom_domain(
'RustDomain',
Expand All @@ -118,6 +122,8 @@ def setup(app):
},
'var': {
},
'crate': {
}
}
))

2 changes: 1 addition & 1 deletion docs/cplusplus.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Euler C++ Implementation
======================
========================

.. include:: ../cplusplus/README.rst
:start-line: 2
Expand Down

0 comments on commit afddd2f

Please sign in to comment.