Skip to content

Commit

Permalink
Update Documentation (The-OpenROAD-Project#1917)
Browse files Browse the repository at this point in the history
+ Added `make docs` target to primary Makefile to generate documentation
~ Update documentation dependencies
~ Updated `tcl.py` to handle JSON lists of elements including whitespace by joining them with a comma (unless one of the elements already contains a comma), resolving odd JSON syntax
~ Re-organized and re-order configuration variables and edited descriptions for general consistency as well as adding anchors
~ Update all documentation dependencies
~ Fixed a number of broken links
- Remove dependency on `docutils` and `sphinx-autobuild` (both unused)
- Remove two of the custom documentation extensions
  • Loading branch information
donn authored Jul 25, 2023
1 parent f6e50ab commit 157a650
Show file tree
Hide file tree
Showing 18 changed files with 500 additions and 661 deletions.
31 changes: 17 additions & 14 deletions .github/scripts/variables_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,15 @@
subprocess.check_output(
[
"rg",
"\\| *`([A-Z]\\S+) *` *‡* *\\|",
r"^\s*\|\s*`([A-Z_]+)`",
"-r",
"$1",
"-o",
"-N",
"-I",
"--no-ignore",
"docs",
"docs/source/reference/configuration.md",
"docs/source/reference/pdk_configuration.md",
]
)
.decode("utf-8")
Expand All @@ -174,32 +175,31 @@
docs_variables = [var for var in docs_variables if var.isupper()]
docs_variables_set = set(docs_variables)

deprecated_docs_variables = (
used_variables = (
subprocess.check_output(
[
"rg",
"\\| *`([A-Z]\\S+) *` *‡* *\\|.*(Deprecated|Removed)",
r"\$::env\(\s*([A-Z_]+?)\s*\)",
"-r",
"$1",
"-o",
"-N",
"-I",
"--no-ignore",
"docs",
"scripts",
"flow.tcl",
]
)
.decode("utf-8")
.split()
)
depreacted_docs_variables = [var for var in deprecated_docs_variables if var.isupper()]
deprecated_docs_variables_set = set(deprecated_docs_variables)

used_variables_set = set(used_variables)

used_variables = (
translated_deprecated_variables = (
subprocess.check_output(
[
"rg",
"\\$::env\\(([A-Z]\\S+?)\\)",
r"handle_deprecated_config\s+([A-Z_]+)",
"-r",
"$1",
"-o",
Expand All @@ -213,15 +213,18 @@
.decode("utf-8")
.split()
)
used_variables_set = set(used_variables)
translated_deprecated_variables_set = set(translated_deprecated_variables)

undocumented = sorted(
used_variables_set - docs_variables_set - deprecated_docs_variables_set - white_list
)
undocumented = sorted(used_variables_set - docs_variables_set - white_list)
if undocumented:
print("[ERROR]: found the following undocumented variables.")
for var in undocumented:
print(var)
exit(1)
else:
print("Pass")

# unused = sorted(
# docs_variables_set - used_variables_set - translated_deprecated_variables_set
# )
# print(unused)
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ lint: venv/created
./venv/bin/black --check .
./venv/bin/flake8 .

.PHONY: docs
docs: venv/created
$(MAKE) -C docs install
$(MAKE) -C docs html

.PHONY: start-build-env
start-build-env: venv/created
bash -c "bash --rcfile <(cat ~/.bashrc ./venv/bin/activate)"
Expand Down
3 changes: 0 additions & 3 deletions configuration/general.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ set ::env(USE_ARC_ANTENNA_CHECK) 1
set ::env(RUN_SPEF_EXTRACTION) 1
set ::env(RUN_IRDROP_REPORT) 1


## Signoff
set ::env(RUN_CVC) 1
set ::env(PRIMARY_SIGNOFF_TOOL) magic
Expand Down Expand Up @@ -72,8 +71,6 @@ set ::env(MAGIC_GDS_POLYGON_SUBCELLS) 0
### Klayout-Specific
set ::env(RUN_KLAYOUT) 1
set ::env(RUN_KLAYOUT_DRC) 0
set ::env(KLAYOUT_XOR_GDS) 1
set ::env(KLAYOUT_XOR_XML) 1
set ::env(KLAYOUT_XOR_THREADS) 1
set ::env(KLAYOUT_XOR_IGNORE_LAYERS) ""
set ::env(TAKE_LAYOUT_SCROT) 0
Expand Down
109 changes: 0 additions & 109 deletions docs/_ext/markdown_code_links.py

This file was deleted.

52 changes: 0 additions & 52 deletions docs/_ext/markdown_cross_doc_section_links.py

This file was deleted.

8 changes: 3 additions & 5 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
furo==2022.6.21
docutils==0.17
sphinx==4.5.0
sphinx-autobuild==2021.3.14
myst-parser==0.18.0
furo==2023.5.20
sphinx>=7,<8
myst-parser>=2,<3
18 changes: 1 addition & 17 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
# ones.
extensions = [
"sphinx.ext.todo",
"markdown_code_links", # CUSTOM
"markdown_cross_doc_section_links", # CUSTOM
"sphinx.ext.autosectionlabel",
"image_links", # CUSTOM
"myst_parser",
Expand Down Expand Up @@ -107,29 +105,15 @@

todo_include_todos = True
numfig = True

markdown_code_links_githubrepo = repo
markdown_code_links_githubbranch = f"blob/{branch}"
markdown_code_links_codefileextensions = [
".tcl",
".sh",
".cfg",
".gds",
".sdc",
"/",
".json",
"Makefile",
]
autosectionlabel_prefix_document = True

suppress_warnings = ["misc.highlighting_failure"] # supress json highlight warnings

myst_heading_anchors = 3


myst_enable_extensions = [
"colon_fence",
"attrs_block",
]


root_doc = "index"
2 changes: 1 addition & 1 deletion docs/source/getting_started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This guide covers running the flow on existing desings, adding new designs and q
## Starting the OpenLane Environment

:::{note}
If you installed OpenLane following [local installation](installation_local.md) steps, these instructions will not entirely apply. We no longer actively support local installation.
If you installed OpenLane following [local installation](installation/installation_local.md) steps, these instructions will not entirely apply. We no longer actively support local installation.
:::

OpenLane uses Docker to create a reproducible environment for your projects. You don't need any extra steps to run the Docker image, as the Makefile already takes care of it. Just run the following commands to enter the OpenLane environment:
Expand Down
Loading

0 comments on commit 157a650

Please sign in to comment.