Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MkDoxy core #110

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions .github/workflows/mkdoxy-pytest-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest] # windows-latest, macos-latest requires doxygen to be installed manually
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.x'
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/mkdoxy-test-demos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest] # windows-latest, macos-latest requires doxygen to be installed manually
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.x'
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
Expand All @@ -24,9 +23,11 @@ jobs:
python -m pip install -e ".[dev]"
sudo apt-get install doxygen
- name: Clone test repo
run: git clone https://github.com/JakubAndrysek/MkDoxy-demo.git demo
run: |
git clone https://github.com/JakubAndrysek/MkDoxy-demo.git demo
- name: Build docs
run: |
cd demo
git checkout core-update
python -m pip install -r requirements.txt
mkdocs build --clean --verbose
3 changes: 1 addition & 2 deletions .github/workflows/mkdoxy-test-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest] # windows-latest, macos-latest requires doxygen to be installed manually
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.x'
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .idea/main-mkdoxy.iml

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

207 changes: 63 additions & 144 deletions .idea/workspace.xml

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
---
repos:
- repo: https://github.com/sourcery-ai/sourcery
rev: v1.19.0
hooks:
- id: sourcery
# The best way to use Sourcery in a pre-commit hook:
# * review only changed lines:
# * omit the summary
args: [--diff=git diff HEAD, --no-summary]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer

- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.292'
rev: "v0.0.292"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ clean:

# Testing
reviewCode:
sourcery review mkdoxy --in-place
sourcery review mkdoxy --fix

install-dev:
python3 -m pip install --force --editable .
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pip install mkdoxy
```
Development version with all dependencies:
```bash
python -m venv .venv
python -m pip install mkdoxy ".[dev]"
```

Expand Down
14 changes: 9 additions & 5 deletions docs/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,15 @@ If you want to use a standard `Doxygen` configuration file, you can specify the

??? example "How is it implemented?"

::: doxy.mkdoxyApi.code
file: doxyrun.py
start: 64
end: 115
indent_level: 8
[//]: # (::: doxy.mkdoxyApi.code)

[//]: # (file: doxygen_generator.py)

[//]: # (start: 64)

[//]: # (end: 115)

[//]: # (indent_level: 8)



Expand Down
46 changes: 32 additions & 14 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,23 @@ theme:
repo: fontawesome/brands/github

palette:
- scheme: slate
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: orange
accent: orange
toggle:
icon: material/brightness-4
name: Switch to light mode

# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: orange
accent: orange
toggle:
icon: material/brightness-7
name: Switch to dark mode

extra:
social:
Expand Down Expand Up @@ -61,32 +75,36 @@ plugins:
- search
- open-in-new-tab
- mkdoxy:
enabled: !ENV [ENABLE_MKDOXY, True]
enabled: !ENV [ ENABLE_MKDOXY, True ]
projects:
mkdoxyApi:
src-dirs: mkdoxy
full-doc: True
template-dir: templates-custom
doxy-cfg-file: demo-projects/animal/Doxyfile
doxy-cfg:
src_dirs: mkdoxy
full_doc: True
custom_template_dir: templates-custom
doxy_config_file: demo-projects/animal/Doxyfile
doxy_config_dict:
FILE_PATTERNS: "*.py"
EXAMPLE_PATH: ""
RECURSIVE: True
OPTIMIZE_OUTPUT_JAVA: True
JAVADOC_AUTOBRIEF: True
EXTRACT_ALL: True
DOT_IMAGE_FORMAT: svg
HAVE_DOT: YES
animal:
src-dirs: demo-projects/animal
full-doc: True
doxy-cfg:
src_dirs: demo-projects/animal
full_doc: True
doxy_cfg:
FILE_PATTERNS: "*.cpp *.h*"
EXAMPLE_PATH: examples
RECURSIVE: True
save-api: .mkdoxy
full-doc: True
DOT_IMAGE_FORMAT: svg
HAVE_DOT: YES
custom_api_folder: .mkdoxy

full_doc: True
debug: False
ignore-errors: False
emojis-enabled: True
# ignore_errors: False

markdown_extensions:
- pymdownx.highlight
Expand Down
40 changes: 40 additions & 0 deletions mkdoxy/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from pathlib import Path

import click

from mkdoxy.migration import update_new_config


@click.group()
def cli():
pass


@click.command()
@click.argument("yaml_file", type=click.Path(exists=True))
@click.option("--no-backup", is_flag=True, help="Do not backup old config to mkdocs.old.yaml")
def migrate(yaml_file, no_backup):
"""
Migrate mkdoxy config to new version
@details
@param yaml_file: Path to mkdocs.yaml file
@param no_backup: Do not backup old config to mkdocs.old.yaml
"""
backup_file_name = "mkdocs.old.yaml"
update_new_config(Path(yaml_file), not no_backup, backup_file_name)
click.echo("Migration completed successfully")
if not no_backup:
click.echo(f"Old config was not backed up as '{backup_file_name}'")


# @click.command()
# def version():
# package_version = importlib.metadata.version('mkdoxy')
# click.echo(f"Version: {package_version}")


cli.add_command(migrate)
# cli.add_command(version)

if __name__ == "__main__":
cli()
3 changes: 3 additions & 0 deletions mkdoxy/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,6 @@ class Visibility(Enum):
PACKAGE = "package"
PROTECTED = "protected"
PRIVATE = "private"


ENDING = (".jinja2", ".j2", ".jinja")
Loading
Loading