Skip to content

Commit 1c1f786

Browse files
jeff-hykingreptile-apps[bot]leshy
authored
Simplify writing_docs to just one md file (#1254)
* move, no fixed links * fix renamed references * add missing assets * fix doclink tests * Update docs/usage/README.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * - --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Ivan Nikolic <lesh@sysphere.org>
1 parent 221fcfb commit 1c1f786

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+40
-622
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ DimOS comes with a number of monitoring tools:
241241
# Documentation
242242

243243
Concepts:
244-
- [Modules](/docs/concepts/modules.md): The building blocks of DimOS, modules run in parallel and are singleton python classes.
245-
- [Streams](/docs/api/sensor_streams/index.md): How modules communicate, a Pub / Sub system.
244+
- [Modules](/docs/usage/modules.md): The building blocks of DimOS, modules run in parallel and are singleton python classes.
245+
- [Streams](/docs/usage/sensor_streams/index.md): How modules communicate, a Pub / Sub system.
246246
- [Blueprints](/dimos/core/README_BLUEPRINTS.md): a way to group modules together and define their connections to each other.
247247
- [RPC](/dimos/core/README_BLUEPRINTS.md#calling-the-methods-of-other-modules): how one module can call a method on another module (arguments get serialized to JSON-like binary data).
248248
- [Skills](/dimos/core/README_BLUEPRINTS.md#defining-skills): An RPC function, except it can be called by an AI agent (a tool for an AI).

dimos/utils/docs/doclinks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ def build_doc_index(root: Path) -> dict[str, list[Path]]:
106106
"""
107107
Build an index mapping lowercase doc names to .md file paths.
108108
109-
For docs/concepts/modules.md, creates entry:
110-
- "modules" -> [Path("docs/concepts/modules.md")]
109+
For docs/usage/modules.md, creates entry:
110+
- "modules" -> [Path("docs/usage/modules.md")]
111111
112112
Also indexes directory index files:
113113
- "modules" -> [Path("docs/modules/index.md")] (if modules/index.md exists)

dimos/utils/docs/test_doclinks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def test_github_mode(self, file_index):
256256
def test_relative_mode(self, file_index):
257257
"""Should generate relative paths in relative mode."""
258258
content = "See [`service/spec.py`]()"
259-
doc_path = REPO_ROOT / "docs/concepts/test.md"
259+
doc_path = REPO_ROOT / "docs/usage/test.md"
260260

261261
new_content, _changes, _errors = process_markdown(
262262
content,
@@ -350,7 +350,7 @@ def test_doc_link_github_mode(self, file_index, doc_index):
350350
def test_doc_link_relative_mode(self, file_index, doc_index):
351351
"""Should generate relative paths for doc links."""
352352
content = "See [Blueprints](.md)"
353-
doc_path = REPO_ROOT / "docs/api/test.md"
353+
doc_path = REPO_ROOT / "docs/usage/test.md"
354354

355355
new_content, _changes, errors = process_markdown(
356356
content,
@@ -364,8 +364,8 @@ def test_doc_link_relative_mode(self, file_index, doc_index):
364364
)
365365

366366
assert len(errors) == 0
367-
# Should be relative path from docs/concepts/ to docs/
368-
assert "../" in new_content
367+
# Should be relative path from docs/usage/ to target doc
368+
assert "[Blueprints](blueprints.md)" in new_content
369369

370370
def test_doc_not_found_error(self, file_index, doc_index):
371371
"""Should error when doc doesn't exist."""

docs/api/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/concepts/README.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/development/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ You can enable a tag by selecting -m <tag_name> - these are configured in `./pyp
293293
- Open the PR against the `dev` branch (not `main`).
294294
- **No matter what, provide a few-lines that, when run, let a reviewer test the feature you added** (assuming you changed functional python code).
295295
- Less changed files = better.
296-
- If you're writing documentation, see [writing docs](/docs/development/writing_docs/README.md)
296+
- If you're writing documentation, see [writing docs](/docs/development/writing_docs.md)
297297
- If you get mypy errors, please fix them. Don't just add # type: ignore. Please first understand why mypy is complaining and try to fix it. It's only okay to ignore if the issue cannot be fixed.
298298
- If you made a change that is likely going to involve a debate, open the github UI and add a graphical comment on that code. Justify your choice and explain downsides of alternatives.
299299
- We don't require 100% test coverage, but if you're making a PR of notable python changes you should probably either have unit tests or good reason why not (ex: visualization stuff is hard to test so we don't).

docs/development/depth_camera_integration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,5 @@ Install Foxglove from:
143143
- **Skills** are callable methods (decorated with `@skill`) on any `Module`, automatically discovered by agents.
144144

145145
Reference:
146-
- Modules overview: `/docs/concepts/modules.md`
147-
- TF fundamentals: `/docs/api/transforms.md`
146+
- Modules overview: `/docs/usage/modules.md`
147+
- TF fundamentals: `/docs/usage/transforms.md`

docs/development/writing_docs.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Writing Docs
2+
3+
1. Where to put your docs:
4+
- If it only matters to people who contribute to dimos (like this doc), put them in `docs/development`
5+
- Otherwise put them in `docs/usage`
6+
2. Run `bin/gen_diagrams` to generate the svg's for your diagrams. We use [pikchr](https://pikchr.org/home/doc/trunk/doc/userman.md) as a diagram language.
7+
3. Use [md-babel-py](https://github.com/leshy/md-babel-py/) (`md-babel-py run thing.md`) to make sure your code examples work.

docs/development/writing_docs/README.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/development/writing_docs/assets/codeblocks_example.svg

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)