Compare commits
No commits in common. "main" and "0.4.2" have entirely different histories.
@ -1,8 +0,0 @@
|
|||||||
target/
|
|
||||||
.git/
|
|
||||||
.gitignore
|
|
||||||
Dockerfile
|
|
||||||
.dockerignore
|
|
||||||
README.md
|
|
||||||
.env
|
|
||||||
*.md
|
|
||||||
40
CHANGELOG.md
40
CHANGELOG.md
@ -5,31 +5,7 @@ The format is based on [Keep a
|
|||||||
Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
||||||
[Semantic Versioning](https://semver.org/lang/en/).
|
[Semantic Versioning](https://semver.org/lang/en/).
|
||||||
|
|
||||||
|
## [0.4.1] - 2026-03-26
|
||||||
## v0.4.4 - 2026-03-29
|
|
||||||
### Fixed
|
|
||||||
- Fixed removing newlines.
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## v0.4.3 - 2026-03-28
|
|
||||||
### Changed
|
|
||||||
- Change footer.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## v0.4.2 - 2026-03-27
|
|
||||||
### Added
|
|
||||||
- Added version and project name in footer.
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## v0.4.1 - 2026-03-26
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Added support for rendering individual files, not just directories (e.g.,
|
- Added support for rendering individual files, not just directories (e.g.,
|
||||||
`mdpreview dir/file.md`).
|
`mdpreview dir/file.md`).
|
||||||
@ -39,7 +15,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## v0.4.0 - 2026-03-25
|
## [0.4.0] - 2026-03-25
|
||||||
### Added
|
### Added
|
||||||
- Added a button to copy the edit command (`note edit current_note.md`).
|
- Added a button to copy the edit command (`note edit current_note.md`).
|
||||||
|
|
||||||
@ -47,7 +23,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## v0.3.0 - 2026-03-24
|
## [0.3.0] - 2026-03-24
|
||||||
### Added
|
### Added
|
||||||
- Added the `--random` flag to open the browser on a random page when used with
|
- Added the `--random` flag to open the browser on a random page when used with
|
||||||
`--browser` (`--browser --random`).
|
`--browser` (`--browser --random`).
|
||||||
@ -56,7 +32,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## v0.2.1 - 2026-03-23
|
## [0.2.1] - 2026-03-23
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fixed an issue where listening on port 0 (`--port 0`) caused the browser to
|
- Fixed an issue where listening on port 0 (`--port 0`) caused the browser to
|
||||||
open the wrong port.
|
open the wrong port.
|
||||||
@ -65,7 +41,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## v0.2.0 - 2026-03-23
|
## [0.2.0] - 2026-03-23
|
||||||
### Added
|
### Added
|
||||||
- Added the `--browser` flag to automatically open the page in the browser.
|
- Added the `--browser` flag to automatically open the page in the browser.
|
||||||
|
|
||||||
@ -73,7 +49,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## v0.1.3 - 2026-03-23
|
## [0.1.3] - 2026-03-23
|
||||||
### Added
|
### Added
|
||||||
- Added a "Random File" button to the header.
|
- Added a "Random File" button to the header.
|
||||||
|
|
||||||
@ -89,7 +65,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## v0.1.2 - 2026-03-22
|
## [0.1.2] - 2026-03-22
|
||||||
### Added
|
### Added
|
||||||
- Added a "Random File" button.
|
- Added a "Random File" button.
|
||||||
- Added an "On Main" button.
|
- Added an "On Main" button.
|
||||||
@ -102,6 +78,6 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## v0.1.1 - 2026-03-21
|
## [0.1.1] - 2026-03-21
|
||||||
### Added
|
### Added
|
||||||
- Added page titles.
|
- Added page titles.
|
||||||
|
|||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -982,7 +982,7 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mdpreview"
|
name = "mdpreview"
|
||||||
version = "0.4.4"
|
version = "0.4.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"askama",
|
"askama",
|
||||||
"askama_axum",
|
"askama_axum",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "mdpreview"
|
name = "mdpreview"
|
||||||
version = "0.4.4"
|
version = "0.4.2"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
authors = ["Vladislav Kan <thek4n@yandex.ru>"]
|
authors = ["Vladislav Kan <thek4n@yandex.ru>"]
|
||||||
|
|
||||||
|
|||||||
43
Dockerfile
43
Dockerfile
@ -1,43 +0,0 @@
|
|||||||
FROM rust:1.94 AS chef
|
|
||||||
|
|
||||||
RUN cargo install --locked cargo-chef
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY Cargo.toml Cargo.lock .
|
|
||||||
RUN mkdir src && touch src/main.rs
|
|
||||||
|
|
||||||
RUN cargo chef prepare --recipe-path recipe.json
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FROM chef AS builder
|
|
||||||
|
|
||||||
COPY --from=chef /app/recipe.json recipe.json
|
|
||||||
|
|
||||||
RUN cargo chef cook --release --recipe-path recipe.json
|
|
||||||
|
|
||||||
|
|
||||||
COPY rust-toolchain.toml rust-toolchain.toml
|
|
||||||
|
|
||||||
RUN cargo fetch
|
|
||||||
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN cargo build --release
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FROM debian:bookworm-slim AS runtime
|
|
||||||
|
|
||||||
RUN useradd -m -s /bin/bash appuser
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY --from=builder /app/target/release/mdpreview /usr/local/bin/mdpreview
|
|
||||||
|
|
||||||
USER appuser
|
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
CMD ["mdpreview"]
|
|
||||||
@ -1,3 +1,3 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "stable"
|
channel = "stable"
|
||||||
components = ["clippy", "rustfmt"]
|
components = ["clippy", "rustfmt", "chef"]
|
||||||
|
|||||||
@ -154,7 +154,7 @@ async fn main() {
|
|||||||
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
|
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
|
||||||
|
|
||||||
let actual_addr = listener.local_addr().expect("Failed to get local address");
|
let actual_addr = listener.local_addr().expect("Failed to get local address");
|
||||||
println!("mdpreview v{VERSION} server started on http://{actual_addr}");
|
println!("Server started on http://{actual_addr}");
|
||||||
|
|
||||||
if args.browser {
|
if args.browser {
|
||||||
let mut url = format!("http://{actual_addr}");
|
let mut url = format!("http://{actual_addr}");
|
||||||
|
|||||||
@ -127,13 +127,10 @@ pub fn markdown_to_html(markdown: &str, ss: &SyntaxSet, ts: &ThemeSet, _file_pat
|
|||||||
IncludeBackground::No,
|
IncludeBackground::No,
|
||||||
)
|
)
|
||||||
.unwrap_or_else(|_| escape_html(&line));
|
.unwrap_or_else(|_| escape_html(&line));
|
||||||
|
|
||||||
result_html.push_str(&html_line);
|
result_html.push_str(&html_line);
|
||||||
result_html.push('\n');
|
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
result_html.push_str(&escape_html(&line));
|
result_html.push_str(&escape_html(&line));
|
||||||
result_html.push('\n');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -166,7 +166,7 @@
|
|||||||
<a href="/">← Main</a>
|
<a href="/">← Main</a>
|
||||||
<a href="/random">🎲 Random note</a>
|
<a href="/random">🎲 Random note</a>
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
<p>{{ package_name }} v{{ version }}</p>
|
<p>{{ package_name }} - {{ authors }} - v{{ version }}</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user