From 051ad6469cd174a1c8e9180372cd9397c0ecddd6 Mon Sep 17 00:00:00 2001 From: HlisTilen Date: Wed, 10 Apr 2024 16:48:50 +0200 Subject: [PATCH] fix: documenter --- Project.toml | 3 ++ docs/src/index.md | 100 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 101 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index e0b305c..15f5b45 100644 --- a/Project.toml +++ b/Project.toml @@ -8,3 +8,6 @@ CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" + +[extras] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" diff --git a/docs/src/index.md b/docs/src/index.md index 69eb9c5..5218600 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,3 +1,99 @@ -# TCXreader.jl -Documentation for TCXreader.jl +# TCXreader.jl Documentation + +## Introduction + +TCXreader is a Julia package designed for parsing and analyzing Training Center XML (TCX) files. These files are commonly used by sports and fitness devices (like Garmin) to store workout data, including tracks, laps, and physiological metrics. + +## Installation + +```julia +using Pkg +Pkg.add("TCXreader") +``` + +## Usage + +To use TCXreader, you first need to load the package and then call the `loadTCXFile` function with the path to your TCX file. + +```julia +using TCXreader + +author, activities = loadTCXFile("path/to/your/file.tcx") +``` + +## API Reference + +### `TCXTrackPoint` + +- **Description**: Represents a single track point in a TCX file, encapsulating geographical, temporal, and physiological data. +- **Fields**: + - `time`: The timestamp of the track point. + - `latitude`: Latitude coordinate (optional). + - `longitude`: Longitude coordinate (optional). + - `altitude_meters`: Altitude in meters (optional). + - `distance_meters`: Cumulative distance in meters (optional). + - `heart_rate_bpm`: Heart rate in BPM (optional). + - `speed`: Speed in m/s (optional). + +### `TCXLap` + +- **Description**: Represents a single lap within a TCX file, encapsulating temporal, physiological, and spatial metrics. +- **Fields**: + - `startTime`: Lap's start time. + - `totalTimeSeconds`: Total time in seconds. + - `distanceMeters`: Distance in meters. + - `maximumSpeed`: Maximum speed (optional). + - `calories`: Calories burned. + - `averageHeartRateBpm`: Average heart rate (optional). + - `maximumHeartRateBpm`: Maximum heart rate (optional). + - `intensity`: Lap intensity. + - `cadence`: Cadence (optional). + - `trackPoints`: Vector of `TCXTrackPoint`. + - `triggerMethod`: Trigger method for the lap. + - `avgSpeed`: Average speed (optional). + +### `TCXActivity` + +- **Description**: Represents a single activity within a TCX file, including the sport type, activity ID, laps, and device information. +- **Fields**: + - `sport`: Sport type. + - `id`: Activity identifier, typically a timestamp. + - `laps`: Vector of `TCXLap`. + - `device`: Device information (`DeviceInfo`). + +### `DeviceInfo` + +- **Description**: Represents the device that recorded the TCX activity, including details such as the name, unit ID, product ID, and version. +- **Fields**: + - `name`: Device name. + - `unitId`: Unit ID. + - `productId`: Product ID. + - `version`: Device software version. + +### `TCXAuthor` + +- **Description**: Represents the author of the TCX file, including the name, software build version, language ID, and part number. +- **Fields**: + - `name`: Author name. + - `build`: Software build version (`BuildVersion`). + - `langID`: Language ID. + - `partNumber`: Part number. + +### Exporting Data + +You can also export the loaded TCX data into a CSV file using the `exportCSV` function. + +```julia +exportCSV(author, activities, "output_path.csv") +``` + +For more detailed examples and additional functionality, please refer to the [GitHub repository](https://github.com/firefly-cpp/TCXreader.jl). + +## Contributing + +Contributions are welcome! Please open an issue or pull request on GitHub if you have suggestions or improvements. + +## License + +This package is distributed under the MIT License. This license can be found online at .