Skip to content

Commit d80bf73

Browse files
Reorganization of the documentation folder (#304)
* chnage name of folder documentation * change doc_conf in scrips * move the documentation file in src * move other file for the documentation in src * change path for documentation * move side file to _utils * add a init file for python file * change place of elements for the documentation * fix path * fix results * add missing a file in ignore * fix make file * Update docs/src/api.rst Co-authored-by: bthirion <[email protected]> * fix path of contributing * fix path contributing [skip tests] [doc quick] * test skip tests [skip tests] * fix path for tests reports * fix path of log of building doc --------- Co-authored-by: bthirion <[email protected]>
1 parent a7945ab commit d80bf73

File tree

17 files changed

+57
-56
lines changed

17 files changed

+57
-56
lines changed

.circleci/config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ jobs:
5050
no_output_timeout: 40m
5151
# store the documentation for see it in a PR
5252
- store_artifacts:
53-
path: doc_conf/_build/html
53+
path: docs/_build/html
5454
destination: documentation
5555
- store_artifacts:
5656
path: ~/output_sphinx.log
5757
destination: log.txt
5858
# Persists generated documentation so that it can be attached and deployed
5959
# in the 'deploy-documentation' step.
6060
- persist_to_workspace:
61-
root: doc_conf/_build/html
61+
root: docs/_build/html
6262
paths: .
6363
- save_cache:
6464
# cache some library
@@ -80,15 +80,15 @@ jobs:
8080
set -x -e
8181
wget $GITHUB_ARTIFACT_URL
8282
unzip pytest-results-all.zip -d test_reports
83-
mkdir -p doc_conf/_build/html
84-
mv test_reports doc_conf/_build/html
83+
mkdir -p docs/_build/html
84+
mv test_reports docs/_build/html
8585
# store the reports to display for a PR
8686
- store_artifacts:
87-
path: doc_conf/_build/html/test_reports
88-
destination: doc_conf/test_reports
87+
path: docs/_build/html/test_reports
88+
destination: documentation/test_reports
8989
# store the reports for adding them to the documentation
9090
- persist_to_workspace:
91-
root: doc_conf/_build/html/
91+
root: docs/_build/html/
9292
paths: .
9393

9494
deploy-documentation:
@@ -108,19 +108,19 @@ jobs:
108108
# Attach documentation generated in the 'build-documentation' step so that it can be
109109
# deployed.
110110
- attach_workspace:
111-
at: doc_conf/_build/html
111+
at: docs/_build/html
112112
- run:
113113
name:
114114
"Add the ssh key and list the file in the documentation"
115115
command: |
116116
mkdir -p ~/.ssh
117117
ssh-keyscan github.com >> ~/.ssh/known_hosts
118-
ls -ltrh doc_conf/_build/html
118+
ls -ltrh docs/_build/html
119119
- run:
120120
name: "Deploy documentation"
121121
command: |
122122
if [[ "${CIRCLE_BRANCH}" =~ ^main$|^[0-9]+\.[0-9]+\.X$ ]]; then
123-
bash ./tools/documentation/circleci/push_doc.sh doc_conf/_build/html
123+
bash ./tools/documentation/circleci/push_doc.sh docs/_build/html
124124
fi
125125
126126
# this action is only to avoid any error

.github/workflows/circleci-artifact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
repo-token: ${{ secrets.GITHUB_TOKEN }}
3636
api-token: ${{ secrets.CIRCLE_CI }}
37-
artifact-path: 0/doc_conf/test_reports/index.html
37+
artifact-path: 0/docs/test_reports/index.html
3838
circleci-jobs: get-tests-reports
3939
job-title: Check the reports of the tests here!
4040

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ __pycache__
1111
*.egg-info
1212
.coverage*
1313

14-
# documenation
15-
doc
16-
doc_conf/auto_examples/
17-
doc_conf/generated/
14+
# documentation
15+
docs/_build/
16+
docs/src/generated/
17+
docs/src/ssg_execution_times.rst
1818

1919
# file generated by hatch
2020
src/hidimstat/_version.py

doc_conf/dev

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc_conf/Makefile renamed to docs/Makefile

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22
#
33

44
# You can set these variables from the command line.
5-
SPHINXOPTS = -j auto -W --keep-going -n
5+
SPHINXOPTS = -j auto -W --keep-going -n
66
# -j/--jobs: N processes in parallel (auto=number of CPUs)
77
# -W/--fail-on-warning: Turn warnings into errors.
88
# --keep-going: Runs sphinx-build to completion and exits
99
# with exit status 1 if errors are encountered.
1010
# -n/--nitpicky: This generates warnings for all missing references.
1111
SPHINXBUILD = sphinx-build
1212
PAPER =
13-
BUILDDIR = _build
13+
BUILDDIR = ./_build
1414

1515
GITHUB_PAGES_BRANCH = gh-pages
16-
OUTPUTDIR = _build/html
16+
SOURCEDIR = ./src
17+
OUTPUTDIR = ./_build/html
18+
19+
# move to source dir before any operation
1720

1821
# add an option for selecting the example to run
1922
ifneq ($(EXAMPLES_PATTERN),)
@@ -28,7 +31,7 @@ endif
2831
# Internal variables.
2932
PAPEROPT_a4 = -D latex_paper_size=a4
3033
PAPEROPT_letter = -D latex_paper_size=letter
31-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(EXAMPLES_PATTERN_OPTS) .
34+
ALLSPHINXOPTS = -c tools -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(EXAMPLES_PATTERN_OPTS)
3235
# the i18n builder cannot share the environment and doctrees with the others
3336
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
3437

@@ -55,50 +58,49 @@ help:
5558
.PHONY: clean
5659

5760
clean:
58-
rm -rf $(BUILDDIR)/*
59-
rm -rf auto_examples/
60-
rm -rf generated/*
61-
rm -rf modules/*
61+
rm -rfv $(BUILDDIR)/*
62+
rm -rfv $(SOURCEDIR)/generated/*
63+
rm -rfv $(SOURCEDIR)/sg_execution_times.rst
6264

6365
html-noplot:
64-
$(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
66+
$(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html
6567
@echo
6668
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
6769

6870
.PHONY: html
6971
html:
70-
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
72+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html
7173
@echo
7274
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
7375

7476
.PHONY: dirhtml
7577
dirhtml:
76-
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
78+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/dirhtml
7779
@echo
7880
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
7981

8082
.PHONY: singlehtml
8183
singlehtml:
82-
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
84+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/singlehtml
8385
@echo
8486
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
8587

8688
.PHONY: pickle
8789
pickle:
88-
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
90+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/pickle
8991
@echo
9092
@echo "Build finished; now you can process the pickle files."
9193

9294
.PHONY: htmlhelp
9395
htmlhelp:
94-
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
96+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/htmlhelp
9597
@echo
9698
@echo "Build finished; now you can run HTML Help Workshop with the" \
9799
".hhp project file in $(BUILDDIR)/htmlhelp."
98100

99101
.PHONY: qthelp
100102
qthelp:
101-
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
103+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/qthelp
102104
@echo
103105
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
104106
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@@ -108,41 +110,41 @@ qthelp:
108110

109111
.PHONY: latex
110112
latex:
111-
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
113+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/latex
112114
@echo
113115
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
114116
@echo "Run \`make' in that directory to run these through (pdf)latex" \
115117
"(use \`make latexpdf' here to do that automatically)."
116118

117119
.PHONY: latexpdf
118120
latexpdf:
119-
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/latex
120122
@echo "Running LaTeX files through pdflatex..."
121123
$(MAKE) -C $(BUILDDIR)/latex all-pdf
122124
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
123125

124126
.PHONY: changes
125127
changes:
126-
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
128+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/changes
127129
@echo
128130
@echo "The overview file is in $(BUILDDIR)/changes."
129131

130132
.PHONY: linkcheck
131133
linkcheck:
132-
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
134+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/linkcheck
133135
@echo
134136
@echo "Link check complete; look for any errors in the above output " \
135137
"or in $(BUILDDIR)/linkcheck/output.txt."
136138

137139
.PHONY: doctest
138140
doctest:
139-
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
141+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/doctest
140142
@echo "Testing of doctests in the sources finished, look at the " \
141143
"results in $(BUILDDIR)/doctest/output.txt."
142144

143145
.PHONY: coverage
144146
coverage:
145-
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
147+
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/coverage
146148
@echo "Testing of coverage in the sources finished, look at the " \
147149
"results in $(BUILDDIR)/coverage/python.txt."
148150

doc_conf/api.rst renamed to docs/src/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Functions
1313
=========
1414

1515
.. autosummary::
16-
:toctree: generated/
16+
:toctree: ./generated/api/function/
1717
:template: function.rst
1818

1919
quantile_aggregation
@@ -33,7 +33,7 @@ Classes
3333
=======
3434

3535
.. autosummary::
36-
:toctree: generated/
36+
:toctree: ./generated/api/class/
3737
:template: class.rst
3838

3939
BasePerturbation

docs/src/dev

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../tools/documentation_developer/

doc_conf/index.rst renamed to docs/src/index.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ To build the documentation you will need to run:
7272
.. code-block::
7373
7474
pip install -U .[doc]
75-
cd doc_conf
75+
cd docs
7676
make html
7777
7878
@@ -173,14 +173,13 @@ For Knockoffs Inference:
173173

174174
References
175175
----------
176-
.. bibliography:: references.bib
176+
.. bibliography:: ../tools/references.bib
177177

178178

179179
.. toctree::
180180
:hidden:
181181
:maxdepth: 1
182182

183183
api
184-
dev/CONTRIBUTING
185-
auto_examples/index
184+
generated/gallery/examples/index
186185
dev/index
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)