Skip to content

Commit

Permalink
attempt to add language graph
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 15, 2024
1 parent 85300a7 commit 94463a2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
with:
node-version: 22

- name: Install Linguist
run: gem install github-linguist

- name: Build sphinx docs
run: make html

Expand Down
10 changes: 10 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from sys import path as sys_path

from sphinxcontrib.domaintools import custom_domain
from gh import linguist
import matplotlib.pyplot as plt

basedir = path.abspath(path.join(path.dirname(__file__), '..'))
sys_path.insert(0, basedir)
Expand Down Expand Up @@ -73,6 +75,13 @@
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}

def setup(app):
langs = ghl.linguist(basedir)
labels = [lang[0] for lang in langs]
sizes = [lang[1] for lang in langs]
fig, ax = plt.subplots()
ax.pie(sizes, labels=labels, autopct='%1.1f%%')
plt.savefig("languages.svg")

app.add_domain(custom_domain(
"RustDomain",
"rust",
Expand All @@ -86,3 +95,4 @@ def setup(app):
},
}
))

2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ This project is divided into several Makefiles, connected by a root Makefile whi
If the recipe you call isn't covered by any others, it will get distributed to all languages. So for instance,
``make test`` would be translated to ``make cs_test c_test js_test py_test rs_test``

.. image:: ./languages.svg

.. |C| replace:: **C**
.. |C#| replace:: **C#**
.. |Js| replace:: **JavaScript**
Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ sphinx-js
sphinx-csharp
sphinxcontrib-makedomain
sphinxcontrib-domaintools
ghlinguist
matplotlib

0 comments on commit 94463a2

Please sign in to comment.