From 112198d4cf175ef734190cbe26e4b5f9e790fdef Mon Sep 17 00:00:00 2001 From: Aron T Date: Thu, 24 Jul 2025 15:25:12 +0300 Subject: [PATCH 1/3] Update plotting documentation and function comments - Enhanced documentation for plot_param_line and calculate_param_line functions - Updated module documentation in Linear_Algebra.jl - Improved function docstrings for clarity and consistency - Updated docs/src/index.md with plotting-related documentation --- docs/src/index.md | 18 ++++++++++++++---- src/Linear_Algebra.jl | 5 +++-- src/linear_algebra_basic.jl | 1 - 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 6c69064..b24dd45 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -2,12 +2,22 @@ This package provides a collection of functions for linear algebra operations and transformations. -## Linear Algebra Functions +## Basic Linear Algebra Functions -This section provides the documentation for all the linear algebra functions. +This section provides the documentation for the basic linear algebra functions. ```@autodocs Modules = [Linear_Algebra] Order = [:function, :type] -Pages = ["linear_algebra_basic.jl", "linear_algebra_transform.jl"] -``` \ No newline at end of file +Pages = ["linear_algebra_basic.jl"] +``` + +## Linear Transformations + +This section provides the documentation for linear transformations and related operations. + +```@autodocs +Modules = [Linear_Algebra] +Order = [:function, :type] +Pages = [""linear_algebra_transform.jl"] +``` diff --git a/src/Linear_Algebra.jl b/src/Linear_Algebra.jl index 943b584..1c276cf 100644 --- a/src/Linear_Algebra.jl +++ b/src/Linear_Algebra.jl @@ -15,8 +15,7 @@ end # Exports... # Pure computational functions (no plotting dependencies) export calculate_param_line -# Integrated plotting functions (computation + visualization) -export distance_2_points, center_of_gravity, barycentric_coord, plot_param_line +export distance_2_points, center_of_gravity, barycentric_coord export vector_angle_cos, is_orthogonal, polar_unit, orthproj, reflection, rotation export point_in_implicit_line, parametric_to_implicit_line, implicit_to_parametric_line, explicit_line export distance_to_implicit_line, implicit_line_point_normal_form, distance_to_pnf_implicit_line @@ -26,6 +25,8 @@ export projection_matrix_symbolic, projection_matrix_symbolic_polar, projection_ export projection_matrix_transpose, rotation_matrix_symbolic, rotation_matrix, rotation_matrix_ns export stretch_matrix_symbolic, stretch_matrix export reflection_matrix_symbolic, reflection_matrix, reflection_matrix_rational +# Integrated plotting functions (computation + visualization) +export plot_param_line # Re-export the @variables macro eval(:(export @variables)) diff --git a/src/linear_algebra_basic.jl b/src/linear_algebra_basic.jl index 78b7f01..47390a2 100644 --- a/src/linear_algebra_basic.jl +++ b/src/linear_algebra_basic.jl @@ -45,7 +45,6 @@ end plot_param_line(p::Point, q::Point, n::Int64) → [Point] Creates `n` points on a line defined by `p` and `q`, using the parametric equation of a line, then plot """ - function plot_param_line(p::Point, q::Point, n::Int64) # Use computational function for calculations Ps = calculate_param_line(p, q, n) From 6c3b61abd4000ae5496fc159795f43fb67fb5353 Mon Sep 17 00:00:00 2001 From: Aron T Date: Thu, 24 Jul 2025 16:24:30 +0300 Subject: [PATCH 2/3] fix: correct @autodocs Pages syntax error in documentation - Fixed malformed quotes in @autodocs Pages parameter - Changed Pages = [""linear_algebra_transform.jl"] to Pages = ["linear_algebra_transform.jl"] - Documentation now builds successfully without parse errors --- docs/src/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/index.md b/docs/src/index.md index b24dd45..be4f6d7 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -19,5 +19,5 @@ This section provides the documentation for linear transformations and related o ```@autodocs Modules = [Linear_Algebra] Order = [:function, :type] -Pages = [""linear_algebra_transform.jl"] +Pages = ["linear_algebra_transform.jl"] ``` From 8a275bfa1ded75a86c7b7029851434deda05ade2 Mon Sep 17 00:00:00 2001 From: Aron T Date: Thu, 24 Jul 2025 16:55:46 +0300 Subject: [PATCH 3/3] ci: build docs on PR only if src/ or docs/ change - Adds docs-build job for PRs - Uses shell check to detect changes in src/ or docs/ and skips build otherwise - Prevents docs build for unrelated file changes (e.g., copilot-instructions.md) --- .github/workflows/CI.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index db7fe29..eb717d7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -40,6 +40,41 @@ jobs: run: > julia --project=. --color=yes test/runtests.jl + docs-build: + name: Build Documentation + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check for docs/src changes + id: docs-changes + run: | + git fetch origin ${{ github.base_ref }} + CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD) + echo "Changed files: $CHANGED_FILES" + if echo "$CHANGED_FILES" | grep -qE '^(src/|docs/)'; then + echo "docs_changed=true" >> $GITHUB_OUTPUT + else + echo "docs_changed=false" >> $GITHUB_OUTPUT + fi + - uses: julia-actions/setup-julia@v1 + if: steps.docs-changes.outputs.docs_changed == 'true' + with: + version: '1' + arch: x64 + - uses: julia-actions/cache@v1 + if: steps.docs-changes.outputs.docs_changed == 'true' + - uses: julia-actions/julia-buildpkg@v1 + if: steps.docs-changes.outputs.docs_changed == 'true' + - name: Build documentation + if: steps.docs-changes.outputs.docs_changed == 'true' + run: julia --project=. --color=yes docs/make.jl + - name: Skip docs build (no relevant changes) + if: steps.docs-changes.outputs.docs_changed == 'false' + run: echo "No docs or src changes detected, skipping docs build." + deploy-docs: name: Deploy Documentation # Only run deployment on pushes to main (after merge) or manual trigger