Skip to content

Commit bdcf209

Browse files
committed
add: download button before notebook - wip
1 parent c8b2f15 commit bdcf209

2 files changed

Lines changed: 18 additions & 111 deletions

File tree

doc/source/community_detection_guide.rst

Lines changed: 1 addition & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,14 @@ This documentation provides an overview of the notebooks available in the commun
2929
:shadow: sm
3030

3131
.. **Overview:** This notebook is a quick start guide to community detection in igraph. It covers the initial workflow for detecting communities in networks. (If you look for a more practical learning experience, we recommend starting with this notebook.)
32-
33-
.. raw:: html
34-
35-
<div class="download-container">
36-
<a href="community_detection_guide/notebooks/initial_workflow.ipynb" download>
37-
<button type="button" class="download-button">
38-
<i class="fa-solid fa-download"></i> Download Notebook
39-
</button>
40-
</a>
41-
</div>
4232
4333
.. grid-item-card:: Community Detection Algorithms
4434
:link: community_detection_guide/notebooks/community_detection_algorithms
4535
:link-type: doc
4636
:class-card: sd-card-hover card-deep-orange
4737
:shadow: sm
4838

49-
.. **Overview:** This notebook covers various community detection algorithms available in igraph. It provides a detailed explanation of these algorithms and when to use them.
50-
51-
.. raw:: html
52-
53-
<div class="download-container">
54-
<a href="community_detection_guide/notebooks/community_detection_algorithms.ipynb" download>
55-
<button type="button" class="download-button">
56-
<i class="fa-solid fa-download"></i> Download Notebook
57-
</button>
58-
</a>
59-
</div>
39+
.. **Overview:** This notebook covers various community detection algorithms available in igraph. It provides a detailed explanation of these algorithms and when to use the
6040
6141
.. grid-item-card:: Significance of Community Structure
6242
:link: community_detection_guide/notebooks/test_significance_of_community
@@ -65,16 +45,6 @@ This documentation provides an overview of the notebooks available in the commun
6545
:shadow: sm
6646

6747
.. **Overview:** This notebook provides methods to test the significance of detected communities.
68-
69-
.. raw:: html
70-
71-
<div class="download-container">
72-
<a href="community_detection_guide/notebooks/test_significance_of_community.ipynb" download>
73-
<button type="button" class="download-button">
74-
<i class="fa-solid fa-download"></i> Download Notebook
75-
</button>
76-
</a>
77-
</div>
7848
7949
.. grid-item-card:: Generating and Visualizing Clusters
8050
:link: community_detection_guide/notebooks/generating_and_visualizing_clusters
@@ -83,16 +53,6 @@ This documentation provides an overview of the notebooks available in the commun
8353
:shadow: sm
8454

8555
.. **Overview:** This notebook provides various methods for generating and visualizing clusters in networks. It includes techniques for visualizing community structures.
86-
87-
.. raw:: html
88-
89-
<div class="download-container">
90-
<a href="community_detection_guide/notebooks/generating_and_visualizing_clusters.ipynb" download>
91-
<button type="button" class="download-button">
92-
<i class="fa-solid fa-download"></i> Download Notebook
93-
</button>
94-
</a>
95-
</div>
9656
9757
.. grid-item-card:: Hierarchical Clustering
9858
:link: community_detection_guide/notebooks/hierarchical_clustering
@@ -101,16 +61,6 @@ This documentation provides an overview of the notebooks available in the commun
10161
:shadow: sm
10262

10363
.. **Overview:** This notebook describes hierarchical clustering. It explains how to perform hierarchical clustering on networks and visualize the results.
104-
105-
.. raw:: html
106-
107-
<div class="download-container">
108-
<a href="community_detection_guide/notebooks/hierarchical_clustering.ipynb" download>
109-
<button type="button" class="download-button">
110-
<i class="fa-solid fa-download"></i> Download Notebook
111-
</button>
112-
</a>
113-
</div>
11464
11565
.. grid-item-card:: Modularity
11666
:link: community_detection_guide/notebooks/modularity
@@ -119,16 +69,6 @@ This documentation provides an overview of the notebooks available in the commun
11969
:shadow: sm
12070

12171
.. **Overview:** This notebook introduces the concept of modularity in community detection.
122-
123-
.. raw:: html
124-
125-
<div class="download-container">
126-
<a href="community_detection_guide/notebooks/modularity.ipynb" download>
127-
<button type="button" class="download-button">
128-
<i class="fa-solid fa-download"></i> Download Notebook
129-
</button>
130-
</a>
131-
</div>
13272
13373
.. grid-item-card:: Resolution Parameter
13474
:link: community_detection_guide/notebooks/resolution
@@ -137,16 +77,6 @@ This documentation provides an overview of the notebooks available in the commun
13777
:shadow: sm
13878

13979
.. **Overview:** This notebook introduces the concept of resolution parameter on the Sierpinski triangle.
140-
141-
.. raw:: html
142-
143-
<div class="download-container">
144-
<a href="community_detection_guide/notebooks/resolution.ipynb" download>
145-
<button type="button" class="download-button">
146-
<i class="fa-solid fa-download"></i> Download Notebook
147-
</button>
148-
</a>
149-
</div>
15080
15181
.. grid-item-card:: Consensus Clustering
15282
:link: community_detection_guide/notebooks/consensus_clustering
@@ -155,16 +85,6 @@ This documentation provides an overview of the notebooks available in the commun
15585
:shadow: sm
15686

15787
.. **Overview:** This notebook introduces the method of consensus clustering by combining multiple clustering results.
158-
159-
.. raw:: html
160-
161-
<div class="download-container">
162-
<a href="community_detection_guide/notebooks/consensus_clustering.ipynb" download>
163-
<button type="button" class="download-button">
164-
<i class="fa-solid fa-download"></i> Download Notebook
165-
</button>
166-
</a>
167-
</div>
16888
16989
.. grid-item-card:: Membership Vector
17090
:link: community_detection_guide/notebooks/membership_vector
@@ -173,16 +93,6 @@ This documentation provides an overview of the notebooks available in the commun
17393
:shadow: sm
17494

17595
.. **Overview:** This notebook introduces membership vectors in igraph.
176-
177-
.. raw:: html
178-
179-
<div class="download-container">
180-
<a href="community_detection_guide/notebooks/membership_vector.ipynb" download>
181-
<button type="button" class="download-button">
182-
<i class="fa-solid fa-download"></i> Download Notebook
183-
</button>
184-
</a>
185-
</div>
18696
18797
.. grid-item-card:: Working with Clusterings
18898
:link: community_detection_guide/notebooks/working_with_clusterings
@@ -191,16 +101,6 @@ This documentation provides an overview of the notebooks available in the commun
191101
:shadow: sm
192102

193103
.. **Overview:** This notebook describes how to work with clusterings in igraph.
194-
195-
.. raw:: html
196-
197-
<div class="download-container">
198-
<a href="community_detection_guide/notebooks/working_with_clusterings.ipynb" download>
199-
<button type="button" class="download-button">
200-
<i class="fa-solid fa-download"></i> Download Notebook
201-
</button>
202-
</a>
203-
</div>
204104
205105
.. grid-item-card:: Helper Functions
206106
:link: community_detection_guide/notebooks/functions
@@ -209,16 +109,6 @@ This documentation provides an overview of the notebooks available in the commun
209109
:shadow: sm
210110

211111
.. **Overview:** This notebook introduces all the helper functions used in the community detection guide. It provides a collection of utility functions for community detection tasks.
212-
213-
.. raw:: html
214-
215-
<div class="download-container">
216-
<a href="community_detection_guide/notebooks/functions.ipynb" download>
217-
<button type="button" class="download-button">
218-
<i class="fa-solid fa-download"></i> Download Notebook
219-
</button>
220-
</a>
221-
</div>
222112
223113
Indices and tables
224114
==================

doc/source/conf.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,23 @@ def get_igraph_version():
149149
nbsphinx_execute = 'never'
150150
nbsphinx_allow_errors = True
151151

152+
nbsphinx_prolog = r"""
153+
{% set full_path = env.doc2path(env.docname, base=None) %}
154+
{% set docname = full_path | basename %}
155+
.. raw:: html
156+
157+
<div class="download-container">
158+
<p>Debug: full_path is {{ full_path }}</p>
159+
<p>Debug: docname is {{ docname }}</p>
160+
161+
<a href="{{ docname }}" download="{{ docname }}">
162+
<button type="button" class="download-button">
163+
<i class="fa-solid fa-download"></i> Download Notebook
164+
</button>
165+
</a>
166+
</div>
167+
"""
168+
152169
# The name for this set of Sphinx documents. If None, it defaults to
153170
# "<project> v<release> documentation".
154171
# html_title = None

0 commit comments

Comments
 (0)