Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
41fa115
quick start
BattleCh1cken Aug 8, 2024
7213718
set up config for readthedocs
BattleCh1cken Aug 8, 2024
3841748
oh and theres a flake now have fun getting this out of git history
BattleCh1cken Aug 8, 2024
07c842b
just saving this for later in case this goes south
BattleCh1cken Aug 8, 2024
3ff1c76
we can write doxygen docs with macros. god fears our power
BattleCh1cken Aug 9, 2024
cbd0d8e
Set to not build library in makefile
jmakif Aug 9, 2024
062f2ae
Begin actual units.hpp documentation
jmakif Aug 9, 2024
a6731c9
Document Isomorphic, Multiplied, Divided
jmakif Aug 9, 2024
16fef5e
Document Exponentiated and Rooted
jmakif Aug 9, 2024
a52421d
Update clang-format workflow
jmakif Aug 9, 2024
1e12757
Numerical operators half documented
jmakif Aug 9, 2024
58ac692
run clang-format
jmakif Aug 9, 2024
22e7878
operator*/ and various comment fixes
jmakif Aug 9, 2024
a088385
document most math operations
Exortions Aug 10, 2024
6192b10
Finish comparison operator documentation
jmakif Aug 10, 2024
d34d706
Merge remote-tracking branch 'refs/remotes/felix/feature/documentatio…
jmakif Aug 10, 2024
5b0bb8d
Revise descriptions for operators + and -
jmakif Aug 10, 2024
7bf11d5
Document constructors in NEW_UNIT macro
jmakif Aug 10, 2024
457f86f
Fix some doxygen weirdness
jmakif Aug 10, 2024
fe43204
Shorten std::ratio & change macro arg names
jmakif Aug 10, 2024
aa05659
made sure std::ratio inclusions actually work
jmakif Aug 10, 2024
270666e
More documentation for NEW_UNIT
jmakif Aug 10, 2024
06b1b14
sorry jamie this is your problem now
BattleCh1cken Aug 11, 2024
eb78fda
Merge remote-tracking branch 'origin/main' into feature/documentation
jmakif Oct 15, 2024
d1833d6
Fix to compile post-merge
jmakif Oct 15, 2024
863907e
Post-merge cleanup
jmakif Oct 16, 2024
876964a
Change std::ratio -> ratio in all headers
jmakif Oct 16, 2024
cbe1994
Merge branch 'main' of https://github.com/lemlib/units into feature/d…
jmakif Oct 16, 2024
5ae7b99
Document most literals
jmakif Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ temp.errors
.d/

# Template Zips
*.zip
*.zip

# Flake stuff
.direnv

# Built docs
docs/_build
docs/xml
13 changes: 13 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"

sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ USE_PACKAGE:=1
EXCLUDE_COLD_LIBRARIES:=

# Set this to 1 to add additional rules to compile your project as a PROS library template
IS_LIBRARY:=1
IS_LIBRARY:=0
# TODO: CHANGE THIS!
# Be sure that your header files are in the include directory inside of a folder with the
# same name as what you set LIBNAME to below.
Expand Down
2,854 changes: 2,854 additions & 0 deletions docs/Doxyfile

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
61 changes: 61 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# API Reference

## Abstract Quantities

```{doxygenclass} Quantity
:members:
```

## Generic Operations

```{doxygengroup} operations
:members:
:inner:
```


## Quantities

### Number

```{doxygengroup} Number
:content-only:
:members:
```

### Mass

```{doxygengroup} Mass
:content-only:
:members:
```

<!--### Time-->
<!--### Length-->
<!--### Area-->
<!--### Linear Velocity-->
<!--### Linear Acceleration-->
<!--### Linear Jerk-->
<!--### Curvature-->
<!--### Inertia-->
<!--### Force-->
<!--### Torque-->
<!--### Power-->
<!--### Current-->
<!--### Charge-->
<!--### Voltage-->
<!--### Resistance-->
<!--### Conductance-->
<!--### Luminosity-->
<!--### Moles-->
<!--### Angle-->
<!--### Pose-->
<!--### Temperature-->
<!--### Vector 2D-->
<!--### Vector 3D-->

## units.hpp

```{doxygenfile} units.hpp

```
73 changes: 73 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
project = "Units"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"breathe",
"myst_parser",
"sphinx_copybutton",
"sphinx.ext.autosectionlabel",
"sphinx.ext.todo",
]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "furo"

html_theme_options = {
"source_repository": "https://github.com/lemlib/lemlib/",
"source_branch": "master",
"source_directory": "docs/",
"light_css_variables": {
"color-brand-primary": "#00C852",
"color-brand-content": "#00C852",
},
"dark_css_variables": {
"color-brand-primary": "#00C852",
"color-brand-content": "#00C852",
},
}

html_static_path = ["_static"]


breathe_projects = {"Units": "xml/"}

breathe_projects_source = {
"Units": ("../", ["include/units"])
}

breathe_default_project = "Units"

myst_enable_extensions = [
"amsmath",
"attrs_inline",
"colon_fence",
"deflist",
"dollarmath",
"fieldlist",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"strikethrough",
"substitution",
"tasklist",
]


# Run doxygen for the readthedocs build

import subprocess, os

read_the_docs_build = os.environ.get("READTHEDOCS", None) == "True"

if read_the_docs_build:
subprocess.call("cd ../doxygen; doxygen", shell=True)
15 changes: 15 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Home

We love documentation.

bob

```{toctree}
:hidden:
:maxdepth: 2
:caption: Index

self
<!--./tutorials/index-->
./api.md
```
5 changes: 5 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
breathe
myst-parser
furo
sphinx-copybutton
linkify-it-py
Empty file added docs/tutorials/index.md
Empty file.
126 changes: 126 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
#pros-cli-nix.url = "/home/battlechicken/Projects/pros-cli-nix";
pros-cli-nix.url = "github:BattleCh1cken/pros-cli-nix";
};

outputs =
{ self
, nixpkgs
, utils
, pros-cli-nix
}:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShell = pkgs.mkShell {
packages = with pkgs; [
pros-cli-nix.packages.${system}.default
clang-tools
gcc-arm-embedded-10

doxygen

python312
python312Packages.pip
python312Packages.breathe
python312Packages.furo
python312Packages.myst-parser
python312Packages.sphinx-copybutton
python312Packages.linkify-it-py

sphinx-autobuild
sphinx
];
};
});
}
Loading
Loading