Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
66 changes: 66 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Approximates Visual Studio 2022 default formatting behavior.
# Some VS settings have no clang-format equivalent and are noted below.

BasedOnStyle: LLVM

# Indentation
UseTab: Always
IndentWidth: 4
TabWidth: 4
AccessModifierOffset: -4 # cpp_indent_access_specifiers = false
IndentCaseLabels: false # cpp_indent_case_labels = false
IndentCaseBlocks: false # cpp_indent_case_contents_when_block = false
IndentPPDirectives: None # cpp_indent_preprocessor = leftmost_column
NamespaceIndentation: All # cpp_indent_namespace_contents = true
LambdaBodyIndentation: Signature # cpp_indent_lambda_braces_when_parameter = true

# Braces - VS "ignore" means leave as written, clang-format needs explicit style.
# BreakBeforeBraces: Attach is the closest to VS ignore/same-line defaults.
BreakBeforeBraces: Attach
# No equivalent for cpp_new_line_scope_braces_on_separate_lines

# Control flow new lines
# No direct equivalent for cpp_new_line_before_catch/else - Attach handles these.

# Spaces - function calls
SpaceBeforeParens: Never # cpp_space_before_function_open_parenthesis = remove
SpaceInEmptyParentheses: false # cpp_space_between_empty_parameter_list_parentheses = false
SpacesInParentheses: false # cpp_space_within_parameter_list_parentheses = false

# Spaces - control flow
SpaceAfterControlStatementKeyword: true # cpp_space_after_keywords_in_control_flow_statements = true
SpacesInConditionalStatement: false # cpp_space_within_control_flow_statement_parentheses = false

# Spaces - casts
SpacesInCStyleCastParentheses: false # cpp_space_within_cast_parentheses = false
SpaceAfterCStyleCast: false # cpp_space_after_cast_close_parenthesis = false

# Spaces - brackets
SpaceBeforeSquareBrackets: false # cpp_space_before_open_square_bracket = false
SpacesInSquareBrackets: false # cpp_space_within_square_brackets = false

# Spaces - braces
SpacesInContainerLiterals: true # cpp_space_within_initializer_list_braces = true

# Spaces - operators
SpaceBeforeAssignmentOperators: true # cpp_space_around_assignment_operator = insert
SpaceAroundPointerQualifiers: Before # cpp_space_pointer_reference_alignment = left
PointerAlignment: Left # cpp_space_pointer_reference_alignment = left

# Spaces - inheritance and constructor colons
SpaceBeforeInheritanceColon: true # cpp_space_before_inheritance_colon = true
SpaceBeforeCtorInitializerColon: true # cpp_space_before_constructor_colon = true

# Line length - VS has no wrap limit by default
ColumnLimit: 0

# One-liners
# cpp_wrap_preserve_blocks = one_liners — keep short functions/lambdas on one line
AllowShortFunctionsOnASingleLine: Inline
AllowShortLambdasOnASingleLine: Inline
AllowShortBlocksOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false

# Custom
IndentExternBlock: Indent
44 changes: 44 additions & 0 deletions .github/workflows/doc-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Generate and Deploy Docs

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout API repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Doxygen
run: sudo apt-get install -y doxygen

- name: Generate docs
run: doxygen docs/Doxyfile

- name: Checkout Pages repo
uses: actions/checkout@v4
with:
repository: MIO-Modding/MIO-Modding.github.io
token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
path: pages-repo

- name: Copy docs to Pages repo
run: |
rm -rf pages-repo/*
cp -r docs/output/html/. pages-repo/

- name: Commit and push to Pages repo
run: |
cd pages-repo
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff --staged --quiet || git commit -m "Deploy docs from ${{ github.sha }}"
git push
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ x64/
# Vcpkg
vcpkg_installed/

# Doxygen
Doxyfile.bak
html/
latex/

# Custom
.vscode/
*.code-workspace
header.txt
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/doxygen-awesome-css"]
path = docs/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Modding API

A modding API for MIO: Memories in Orbit.

## Cloning
```sh
git clone --recurse-submodules git@github.com:MIO-Modding/mio-modding-api.git
```

This command will clone the repository and any submodules (such as the theming for the documentation). If you've already pulled the repo and want to pull the submodules, run this command:

```sh
git submodule update --init
```

## Generating Documentation
```sh
# With doxygen installed:
doxygen ./docs/Doxyfile
```

This command will generate documentation from the Javadoc comments in the header file. To view the docs after running it, open `./docs/output/html/index.html`.
2 changes: 2 additions & 0 deletions docs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
header.html
doxygen-awesome-css/*
Loading
Loading