commit 82face79e8af277cf5ae5f27087ba6aa24947ee1 Author: Théo LUDWIG Date: Thu Dec 7 00:12:28 2023 +0100 chore: initial commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..402bc59 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# https://editorconfig.org/ + +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{yml,yaml,md}] +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7ba65ed --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: "ci" + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: "always" + +jobs: + ci: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + - uses: "dtolnay/rust-toolchain@stable" + + - run: "rustc --version" + - run: "cargo build --verbose" + - run: "cargo test --verbose" + - run: "cargo clippy --verbose -- -D warnings" + - run: "cargo fmt -- --check" + + lint-markdown: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + - uses: "DavidAnson/markdownlint-cli2-action@v14" + with: + globs: "**/*.md" + config: ".markdownlint-cli2.jsonc" + + lint-commit: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + - uses: "wagoid/commitlint-github-action@v5" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..406c93a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +target/ +book/ +.bin/ diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc new file mode 100644 index 0000000..4f38985 --- /dev/null +++ b/.markdownlint-cli2.jsonc @@ -0,0 +1,7 @@ +{ + "config": { + "default": true, + "MD033": false + }, + "globs": ["**/*.md"] +} diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..6838368 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "fileformats" +version = "1.0.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..a56fdb0 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "fileformats" +version = "1.0.0" +edition = "2021" +rust-version = "1.74.0" + +[package.metadata.bin] +mdbook = { version = "=0.4.36" } + +[dependencies] diff --git a/README.md b/README.md new file mode 100644 index 0000000..11fcc4e --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +

FileFormats

+ +

+ Documentation and Rust Implementation to learn how most famous file formats store data. +

+ +

+ FileFormats Logo +

+ +--- + +## About + +- [Documentation](./documentation/): Explains the theory for each file format, the advantages and disadvantages compared to other file formats in the same category, why it is stored in that way, and the **User Manual** for the implementation. +- [`fileformats` Implementation](./src/): **Command-Line Interface and Rust Library** to cover most common features of each file format, and understand practically how the theory works. The features of the implementation include, but is not limited to, **read, write, convert, and compare** between file formats. + +## Getting Started + +### Prerequisites + +- [Rust](https://www.rust-lang.org/tools/install) >= v1.74.0 +- [cargo-run-bin](https://crates.io/crates/cargo-run-bin) >= v1.6.0 (`cargo install cargo-run-bin`) + +### Commands + +```sh +# Run `fileformats` CLI +cargo run --help + +# Documentation +cargo bin mdbook serve + +# Build, Lint, and Test +cargo build +cargo test +cargo clippy --verbose -- -D warnings +cargo fmt -- --check +``` diff --git a/book.toml b/book.toml new file mode 100644 index 0000000..db1fd53 --- /dev/null +++ b/book.toml @@ -0,0 +1,5 @@ +[book] +language = "en" +multilingual = false +src = "documentation" +title = "FileFormats" diff --git a/documentation/README.md b/documentation/README.md new file mode 100644 index 0000000..09c377a --- /dev/null +++ b/documentation/README.md @@ -0,0 +1,41 @@ +

FileFormats

+ +

+ Documentation and Rust Implementation to learn how most famous file formats store data. +

+ +

+ FileFormats Logo +

+ +--- + +## Concepts + +2 kinds of computer files: **text files** and **binary files**. + +- [ ] [Text files](https://en.wikipedia.org/wiki/Text_file) + - [ ] Encoding (charset: ASCII, UTF-8, etc.) + - [ ] End Of Line (EOL): `\n`, `\r\n`, `\r`, and End Of File (EOF) + - [ ] Type (common mimetypes: `text/plain`, `text/html`, `text/markdown`, etc.) + - [ ] Identations: Spaces vs Tabs +- [ ] [Binary files](https://en.wikipedia.org/wiki/Binary_file): Endianness, Type + - [ ] Images + - [ ] PPM (Portable PixMap) + - [ ] PNG + - [ ] JPG, JPEG + - [ ] GIF + - [ ] WebP + - [ ] BMP + - [ ] SVG + - [ ] Videos + - [ ] MP4 + - [ ] AVI + - [ ] Audio + - [ ] MP3 + - [ ] WAV + - [ ] Documents + - [ ] PDF + - [ ] DOCX + - [ ] XLSX + - [ ] PPTX diff --git a/documentation/Resources.md b/documentation/Resources.md new file mode 100644 index 0000000..2235a48 --- /dev/null +++ b/documentation/Resources.md @@ -0,0 +1,4 @@ +# Resources + +- [MDN - Media type and format guide: image, audio, and video content](https://developer.mozilla.org/en-US/docs/Web/Media/Formats) +- [dav1d - AV1 cross-platform decoder, open-source, and focused on speed and correctness](https://github.com/videolan/dav1d) diff --git a/documentation/SUMMARY.md b/documentation/SUMMARY.md new file mode 100644 index 0000000..0cd9591 --- /dev/null +++ b/documentation/SUMMARY.md @@ -0,0 +1,4 @@ +# Summary + +- [FileFormats](./README.md) +- [Resources](./Resources.md) diff --git a/documentation/images/logo.png b/documentation/images/logo.png new file mode 100644 index 0000000..0a4fb47 Binary files /dev/null and b/documentation/images/logo.png differ diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..f94288d --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("- FileFormats -"); +}