Skip to content

Commit 005834f

Browse files
authored
Merge pull request #1 from mgmerino/feat/dustrown-rename-packaging
feat/rebrand as dustrown and add local desktop install assets
2 parents ba5cf60 + 5c85399 commit 005834f

6 files changed

Lines changed: 126 additions & 16 deletions

File tree

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "markdown-viewer"
2+
name = "dustrown"
33
version = "0.1.0"
44
edition = "2024"
55

Makefile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
APP_NAME := dustrown
2+
PREFIX ?= $(HOME)/.local
3+
BINDIR ?= $(PREFIX)/bin
4+
DATADIR ?= $(PREFIX)/share
5+
ICONDIR ?= $(DATADIR)/icons/hicolor/scalable/apps
6+
APPDIR ?= $(DATADIR)/applications
7+
DESTDIR ?=
8+
ICON_SOURCE ?= docs/icon-notebook-glasses.svg
9+
10+
.PHONY: build release install install-bin install-icon install-desktop uninstall run clean
11+
12+
build:
13+
cargo build
14+
15+
release:
16+
cargo build --release
17+
18+
install: release install-bin install-icon install-desktop
19+
20+
install-bin:
21+
install -d "$(DESTDIR)$(BINDIR)"
22+
install -m 0755 "target/release/$(APP_NAME)" "$(DESTDIR)$(BINDIR)/$(APP_NAME)"
23+
24+
install-icon:
25+
install -d "$(DESTDIR)$(ICONDIR)"
26+
install -m 0644 "$(ICON_SOURCE)" "$(DESTDIR)$(ICONDIR)/$(APP_NAME).svg"
27+
28+
install-desktop:
29+
install -d "$(DESTDIR)$(APPDIR)"
30+
printf '%s\n' \
31+
'[Desktop Entry]' \
32+
'Type=Application' \
33+
'Name=Dustrown' \
34+
'Comment=Dead simple Markdown viewer' \
35+
'Exec=$(BINDIR)/$(APP_NAME) %f' \
36+
'Icon=$(APP_NAME)' \
37+
'Terminal=false' \
38+
'Categories=Utility;Viewer;TextEditor;' \
39+
'MimeType=text/markdown;text/plain;' \
40+
> "$(DESTDIR)$(APPDIR)/$(APP_NAME).desktop"
41+
42+
uninstall:
43+
rm -f "$(DESTDIR)$(BINDIR)/$(APP_NAME)"
44+
rm -f "$(DESTDIR)$(ICONDIR)/$(APP_NAME).svg"
45+
rm -f "$(DESTDIR)$(APPDIR)/$(APP_NAME).desktop"
46+
47+
run:
48+
cargo run --
49+
50+
clean:
51+
cargo clean

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Release binary:
2828

2929
```bash
3030
cargo build --release
31-
./target/release/markdown-viewer
31+
./target/release/dustrown
3232
```
3333

3434
Shortcuts:

docs/icon-notebook-glasses.svg

Lines changed: 59 additions & 0 deletions
Loading

docs/malicious-markdown-demo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If scripts are not blocked/sanitized, this can execute:
2525
This demonstrates that the rendered page can make outbound requests:
2626

2727
<script>
28-
fetch("https://example.com/markdown-viewer-demo-beacon?ts=" + Date.now())
28+
fetch("https://example.com/dustrown-demo-beacon?ts=" + Date.now())
2929
.then(() => console.log("[demo] outbound request attempted"))
3030
.catch(() => console.log("[demo] outbound request blocked/failed"));
3131
</script>

0 commit comments

Comments
 (0)