File tree Expand file tree Collapse file tree 10 files changed +740
-4
lines changed Expand file tree Collapse file tree 10 files changed +740
-4
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ tests/test_orca/images/linux/failed/
1313
1414doc /python /raw.githubusercontent.com /
1515
16+ docs /
17+
1618# Don't ignore dataset files
1719! * .csv.gz
1820! * .geojson.gz
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ then explains the technical aspects of preparing your contribution.
88
99## Code of Conduct
1010
11- Please note that all contributos are required to abide by our [ Code of Conduct] ( CODE_OF_CONDUCT.md ) .
11+ Please note that all contributos are required to abide by our Code of Conduct.
1212
1313## Different Ways to Contribute
1414
@@ -38,7 +38,7 @@ it is important to understand the structure of the code and the repository.
3838 These are organized in subdirectories according to what they test:
3939 see the "Setup" section below for more details.
4040
41- - Documentation is found in ` doc/ ` , and its structure is described in [ its README file] ( doc/README.md ) .
41+ - Documentation is found in ` doc/ ` , and its structure is described in its README file.
4242 The documentation is a great place to start contributing,
4343 since you can add or modify examples without setting up a full environment.
4444
Original file line number Diff line number Diff line change 1+ site_name : " Plotly.py Docs"
2+ docs_dir : pages
3+ site_dir : docs
4+
5+ plugins :
6+ - search
7+ - gen-files :
8+ scripts :
9+ - scripts/gen_ref_pages.py
10+ - literate-nav :
11+ nav_file : SUMMARY.md
12+ - mkdocstrings :
13+ handlers :
14+ python :
15+ options :
16+ docstring_style : google
17+ show_source : false
18+ show_root_heading : true
19+ show_root_toc_entry : true
20+ merge_init_into_class : true
21+
22+ nav :
23+ - Home : index.md
24+ - API Reference : reference/
25+ - Project :
26+ - license.md
27+ - conduct.md
28+ - contributing.md
29+
30+ theme :
31+ name : " material"
32+
33+ markdown_extensions :
34+ - def_list
35+ - markdown_include.include :
36+ base_path : docs
37+ - footnotes
38+
39+ exclude_docs : >
40+ *~
Original file line number Diff line number Diff line change 1+ {!../CODE_OF_CONDUCT.md!}
Original file line number Diff line number Diff line change 1+ {!../CONTRIBUTING.md!}
Original file line number Diff line number Diff line change 1+ {!../README.md!}
Original file line number Diff line number Diff line change 1+ {!../LICENSE.txt!}
Original file line number Diff line number Diff line change @@ -50,7 +50,13 @@ dev_core = [
5050dev_build = [
5151 " plotly[dev_core]" ,
5252 " build" ,
53- " jupyter"
53+ " jupyter" ,
54+ " markdown-include" ,
55+ " mkdocs" ,
56+ " mkdocs-material" ,
57+ " mkdocstrings[python]" ,
58+ " mkdocs-gen-files" ,
59+ " mkdocs-literate-nav"
5460]
5561dev_optional = [
5662 " plotly[dev_build]" ,
Original file line number Diff line number Diff line change 1+ """Generate the code reference pages and navigation."""
2+
3+ from pathlib import Path
4+ import mkdocs_gen_files
5+
6+ nav = mkdocs_gen_files .Nav ()
7+
8+ for path in sorted (Path ("plotly" ).rglob ("*.py" )):
9+ module_path = path .relative_to ("." ).with_suffix ("" )
10+ doc_path = path .relative_to ("." ).with_suffix (".md" )
11+ full_doc_path = Path ("reference" , doc_path )
12+
13+ parts = tuple (module_path .parts )
14+
15+ if parts [- 1 ] == "__init__" :
16+ parts = parts [:- 1 ]
17+ doc_path = doc_path .with_name ("index.md" )
18+ full_doc_path = full_doc_path .with_name ("index.md" )
19+ elif parts [- 1 ] == "__main__" :
20+ continue
21+
22+ nav [parts ] = doc_path .as_posix ()
23+
24+ with mkdocs_gen_files .open (full_doc_path , "w" ) as fd :
25+ ident = "." .join (parts )
26+ fd .write (f"# { ident } \n \n " )
27+ fd .write (f"::: { ident } " )
28+
29+ mkdocs_gen_files .set_edit_path (full_doc_path , path )
30+
31+ with mkdocs_gen_files .open ("reference/SUMMARY.md" , "w" ) as nav_file :
32+ nav_file .writelines (nav .build_literate_nav ())
You can’t perform that action at this time.
0 commit comments