File tree Expand file tree Collapse file tree 10 files changed +88
-287
lines changed Expand file tree Collapse file tree 10 files changed +88
-287
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ Developer documentation will help you get started. Peruse some common REST API &
61
61
Client API references that are directly derived from Rucio's python
62
62
libraries. We also have a contribution guide for those who wish to pitch in.
63
63
64
- - [ Client API Documentation] ( client_api/accountclient )
65
- - REST API Documentation
64
+ - [ Client API Documentation] ( pathname:///html/site/client.html )
65
+ - [ REST API Documentation] ( pathname:///html/rest_api_doc.html )
66
66
- [ Contributing guide] ( contributing )
67
67
68
68
## Contributing to the Documentation
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ rucio_client.ping()
18
18
```
19
19
20
20
The methods are separated per resource type. The API in full can be viewed
21
- [ here] ( /client_api/accountclient ) .
21
+ [ here] ( pathname:///html/site/client.html ) .
22
22
23
23
### Errors and Exceptions
24
24
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ mkdir -p "$SCRIPT_DIR"/../website/static/html/
35
35
36
36
cp -r " $AUTO_GENERATED " /rest_api_doc_spec.yaml " $SCRIPT_DIR " /../website/static/yaml/
37
37
cp -r " $AUTO_GENERATED " /rest_api_doc.html " $SCRIPT_DIR " /../website/static/html/
38
- cp -r " $AUTO_GENERATED " /client_api " $DOCS "
38
+ cp -r " $AUTO_GENERATED " /site " $SCRIPT_DIR " /../website/static/html/
39
39
cp -r " $AUTO_GENERATED " /bin " $DOCS "
40
40
41
41
Original file line number Diff line number Diff line change 4
4
5
5
echo " Generating the Client Api Docs..."
6
6
7
- pip install --upgrade " pydoc-markdown>3 " & > /dev/null
7
+ pip install --upgrade mkdocs mkdocs-gen-files mkdocstrings-python mkdocs-material
8
8
9
9
mkdir -p /auto_generated/client_api
10
- for f in rucio/lib/rucio/client/* .py; do
11
- if [[ $f =~ " __init__" ]] || [[ $f =~ " richclient" ]]; then
12
- continue
13
- fi
14
10
15
- executable_name=$( basename " $f " " .py" )
11
+ python3 generate_client_api_pages.py
12
+ mkdocs build --clean --no-directory-urls
16
13
17
- config="
18
- processors:
19
- - type: rucio_processor.RucioProcessor
20
- renderer:
21
- type: rucio_renderer.RucioRenderer"
22
- content=$( PYTHONPATH=. pydoc-markdown -I rucio/lib/rucio/client -m " $executable_name " " $config " )
23
-
24
- echo " $content " > /auto_generated/client_api/" $executable_name " .md
25
- done
14
+ cp -r site /auto_generated/
Original file line number Diff line number Diff line change
1
+ """Generate the code reference pages and navigation."""
2
+
3
+ import os
4
+ from pathlib import Path
5
+
6
+ import mkdocs_gen_files
7
+
8
+ src = Path ("rucio/lib/rucio/client/" )
9
+ root = src .parent
10
+ doc_path = "/auto_generated/client_api"
11
+ files = os .listdir (doc_path )
12
+ for file in files :
13
+ os .remove (f"{ doc_path } /{ file } " )
14
+
15
+
16
+ py_files = [f for f in list (src .rglob ("*.py" )) if "__init__.py" not in f .name ]
17
+
18
+ for path in py_files :
19
+ module_name = path .name .split (".py" )[0 ]
20
+
21
+ try :
22
+ full_doc_path = Path (f"{ doc_path } /{ module_name } .md" )
23
+ __import__ (f"rucio.client.{ module_name } " )
24
+ with mkdocs_gen_files .open (full_doc_path , "a" ) as fd :
25
+ module_path = path .relative_to (src ).with_suffix ("" )
26
+ fd .write (f"::: rucio.client.{ module_path } " )
27
+ fd .write ("\n \n " )
28
+
29
+ except ImportError :
30
+ print (f"Could not access client page for { module_name } " )
31
+ pass
Original file line number Diff line number Diff line change
1
+ site_name : " Rucio Python Client Documentation"
2
+ repo_url : https://github.com/rucio/rucio/
3
+ site_url : https://rucio.cern.ch/documentation/
4
+ copyright : " Copyright © 2024 CERN"
5
+ docs_dir : /auto_generated/client_api
6
+ use_directory_urls : true
7
+ not_in_nav :
8
+ /auto_generated
9
+
10
+ theme :
11
+ name : material
12
+ logo : ../../img/rucio_horizontaled_black_cropped.svg
13
+ extra_css : ../../../src/customTheme.css
14
+ extra :
15
+ homepage : /documentation/
16
+ features :
17
+ - content.code.copy
18
+ - toc.follow
19
+ palette :
20
+ - scheme : default
21
+ primary : white
22
+ toggle :
23
+ icon : material/brightness-7
24
+ name : Switch to dark mode
25
+ - scheme : slate
26
+ primary : white
27
+ toggle :
28
+ icon : material/brightness-4
29
+ name : Switch to light mode
30
+
31
+ markdown_extensions :
32
+ - toc :
33
+ permalink : true
34
+ plugins :
35
+ - search
36
+ - autorefs
37
+ - mkdocstrings :
38
+ default_handler : python
39
+ handlers :
40
+ python :
41
+ options :
42
+ members_order : " source"
43
+ heading_level : 2
44
+ show_source : false
45
+ allow_inspection : false
46
+ merge_init_into_class : true
47
+ docstring_style : " sphinx"
48
+ show_bases : false
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments