Skip to content

Commit 803ab5c

Browse files
committed
Improve documentation information architecture
Restructure the Read the Docs sidebar navigation from 3 imbalanced sections (API/Guide/Tutorials) into 6 balanced sections: - Getting Started: quickstart, choosing estimator, troubleshooting - Tutorials: Fundamentals: core DiD methods (basic, staggered, synthetic, etc.) - Tutorials: Advanced Methods: specialized estimators (TROP, imputation, etc.) - Tutorials: Study Design: diagnostics & power analysis - Comparisons & Benchmarks: R/Python comparisons and validation - API Reference: grouped into Estimators, Diagnostics, Results, Data Also adds GitHub notebook links to all tutorial pages via nbsphinx_prolog, updates llms.txt documentation structure to match new IA, and bumps llms-full.txt version to 2.7.2. https://claude.ai/code/session_01NNfgCrHLXcg8Pd9cZM3SNC
1 parent 7be76df commit 803ab5c

5 files changed

Lines changed: 90 additions & 29 deletions

File tree

docs/api/index.rst

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ Built-in datasets for examples and testing:
214214
Module Documentation
215215
--------------------
216216

217-
Detailed documentation by module:
217+
Estimators
218+
~~~~~~~~~~
218219

219220
.. toctree::
220221
:maxdepth: 2
@@ -229,12 +230,33 @@ Detailed documentation by module:
229230
efficient_did
230231
two_stage
231232
bacon
232-
results
233-
visualization
233+
234+
Diagnostics & Inference
235+
~~~~~~~~~~~~~~~~~~~~~~~
236+
237+
.. toctree::
238+
:maxdepth: 2
239+
234240
diagnostics
235241
honest_did
236242
power
237243
pretrends
244+
245+
Results & Visualization
246+
~~~~~~~~~~~~~~~~~~~~~~~
247+
248+
.. toctree::
249+
:maxdepth: 2
250+
251+
results
252+
visualization
253+
254+
Data & Utilities
255+
~~~~~~~~~~~~~~~~
256+
257+
.. toctree::
258+
:maxdepth: 2
259+
238260
utils
239261
prep
240262
datasets

docs/conf.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
},
9292
],
9393
"navbar_end": ["theme-switcher", "navbar-icon-links"],
94-
"navigation_depth": 4,
94+
"navigation_depth": 3,
9595
"show_toc_level": 2,
9696
}
9797

@@ -107,6 +107,20 @@
107107

108108
# -- Options for nbsphinx ---------------------------------------------------
109109
nbsphinx_execute = "never"
110+
nbsphinx_prolog = r"""
111+
{% set docname = env.doc2path(env.docname, base=None) %}
112+
113+
.. raw:: html
114+
115+
<div class="admonition note">
116+
<p class="admonition-title">Interactive notebook</p>
117+
<p>
118+
This tutorial is a Jupyter notebook. You can
119+
<a href="https://github.com/igerber/diff-diff/blob/main/docs/{{ docname }}">view it on GitHub</a>
120+
or download it to run locally.
121+
</p>
122+
</div>
123+
"""
110124

111125
# -- Options for intersphinx -------------------------------------------------
112126
intersphinx_mapping = {

docs/index.rst

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,54 +44,71 @@ For development:
4444
Quick Links
4545
-----------
4646

47-
- :doc:`api/index` - Full API reference
48-
- :doc:`quickstart` - Get started with basic examples
47+
- :doc:`quickstart` - Installation and your first DiD analysis
4948
- :doc:`choosing_estimator` - Which estimator should I use?
49+
- :doc:`tutorials/01_basic_did` - Hands-on basic tutorial
5050
- :doc:`troubleshooting` - Common issues and solutions
51-
- :doc:`r_comparison` - Comparison with R packages
52-
- :doc:`python_comparison` - Comparison with Python packages
53-
- :doc:`benchmarks` - Validation benchmarks vs R
54-
55-
.. toctree::
56-
:maxdepth: 2
57-
:caption: API
58-
:hidden:
59-
60-
api/index
51+
- :doc:`r_comparison` - Coming from R?
52+
- :doc:`api/index` - Full API reference
6153

6254
.. toctree::
6355
:maxdepth: 2
64-
:caption: Guide
56+
:caption: Getting Started
6557
:hidden:
6658

6759
quickstart
6860
choosing_estimator
6961
troubleshooting
70-
r_comparison
71-
python_comparison
72-
benchmarks
7362

7463
.. toctree::
7564
:maxdepth: 1
76-
:caption: Tutorials
65+
:caption: Tutorials: Fundamentals
7766
:hidden:
7867

7968
tutorials/01_basic_did
8069
tutorials/02_staggered_did
8170
tutorials/03_synthetic_did
82-
tutorials/04_parallel_trends
83-
tutorials/05_honest_did
84-
tutorials/06_power_analysis
85-
tutorials/07_pretrends_power
8671
tutorials/08_triple_diff
8772
tutorials/09_real_world_examples
73+
74+
.. toctree::
75+
:maxdepth: 1
76+
:caption: Tutorials: Advanced Methods
77+
:hidden:
78+
8879
tutorials/10_trop
8980
tutorials/11_imputation_did
9081
tutorials/12_two_stage_did
9182
tutorials/13_stacked_did
9283
tutorials/14_continuous_did
9384
tutorials/15_efficient_did
9485

86+
.. toctree::
87+
:maxdepth: 1
88+
:caption: Tutorials: Study Design
89+
:hidden:
90+
91+
tutorials/04_parallel_trends
92+
tutorials/05_honest_did
93+
tutorials/06_power_analysis
94+
tutorials/07_pretrends_power
95+
96+
.. toctree::
97+
:maxdepth: 1
98+
:caption: Comparisons & Benchmarks
99+
:hidden:
100+
101+
r_comparison
102+
python_comparison
103+
benchmarks
104+
105+
.. toctree::
106+
:maxdepth: 2
107+
:caption: API Reference
108+
:hidden:
109+
110+
api/index
111+
95112
What is Difference-in-Differences?
96113
----------------------------------
97114

docs/llms-full.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> A Python library for Difference-in-Differences causal inference analysis. Provides sklearn-like estimators with statsmodels-style output for econometric analysis.
44

5-
- Version: 2.7.1
5+
- Version: 2.7.2
66
- Repository: https://github.com/igerber/diff-diff
77
- License: MIT
88
- Dependencies: numpy, pandas, scipy (no statsmodels dependency)

docs/llms.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@ diff-diff offers 14 estimators covering basic 2x2 DiD, modern staggered adoption
1212

1313
## Documentation
1414

15-
- [Quickstart](https://diff-diff.readthedocs.io/en/stable/quickstart.html): Get started with basic examples — column-name and formula interfaces, covariates, fixed effects, cluster-robust SEs
15+
### Getting Started
16+
17+
- [Quickstart](https://diff-diff.readthedocs.io/en/stable/quickstart.html): Installation, basic 2x2 DiD — column-name and formula interfaces, covariates, fixed effects, cluster-robust SEs
1618
- [Choosing an Estimator](https://diff-diff.readthedocs.io/en/stable/choosing_estimator.html): Decision flowchart for selecting the right estimator for your research design
17-
- [API Reference](https://diff-diff.readthedocs.io/en/stable/api/index.html): Full API documentation for all estimators, results classes, diagnostics, and utilities
19+
- [Troubleshooting](https://diff-diff.readthedocs.io/en/stable/troubleshooting.html): Common issues and solutions
20+
21+
### Comparisons & Benchmarks
22+
1823
- [R Comparison](https://diff-diff.readthedocs.io/en/stable/r_comparison.html): Side-by-side comparison with R packages (did, fixest, synthdid, didimputation, did2s, stackedev)
1924
- [Python Comparison](https://diff-diff.readthedocs.io/en/stable/python_comparison.html): Comparison with Python DiD packages
2025
- [Benchmarks](https://diff-diff.readthedocs.io/en/stable/benchmarks.html): Validation results and performance benchmarks vs R
21-
- [Troubleshooting](https://diff-diff.readthedocs.io/en/stable/troubleshooting.html): Common issues and solutions
26+
27+
### API Reference
28+
29+
- [API Reference](https://diff-diff.readthedocs.io/en/stable/api/index.html): Full API documentation for all estimators, results classes, diagnostics, and utilities
2230

2331
## Estimators
2432

0 commit comments

Comments
 (0)