19 Commits

Author SHA1 Message Date
Manuel Rüger
5e1d40d910 fix: remove no-op log.GetLevel() call in SetLogLevel
The return value was unused and had no effect on logger state,
misleading readers into thinking it was needed for initialization.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 01:05:32 +01:00
Manuel Rüger
4e3b90c03c fix: route result output through Config.Output, not os.Stdout
mark.Run and ProcessFile were writing directly to os.Stdout via
fmt.Println, which is a surprising side-effect for library callers.

Add Config.Output io.Writer for callers to provide their own sink.
When nil the helper falls back to io.Discard, so library embedders
that do not set Output receive no implicit stdout writes. The CLI
layer sets Output: os.Stdout to preserve existing behaviour.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 01:05:32 +01:00
Manuel Rüger
e68a9f64ff Refactor CLI to be a thin adapter over the library
- util/cli.go: RunMark() now maps CLI flags into mark.Config and
  delegates to mark.Run(); all core processing logic removed
- util/cli_test.go: absorb Test_setLogLevel from deleted main_test.go
- main.go, main_test.go: removed (entry point is now cmd/mark/main.go)
- Makefile: update build target to ./cmd/mark with -o mark

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 01:05:32 +01:00
Johan Fagerberg
ec6a718c76 feat: throw errors instead of passing unknown aligns through 2026-03-11 12:49:22 +01:00
Johan Fagerberg
c32cd79dc8 feat: add support for '--image-align' 2026-03-11 12:49:22 +01:00
Johan Fagerberg
9516939c7d feat: add support for --content-appearance 2026-03-11 12:47:35 +01:00
Manuel Rüger
e294a7317e Move mention macro into a goldmark-parser/renderer 2026-02-08 00:59:43 +01:00
dgudim
e82c425471 Rename insecure flag to insecure-skip-tls-verify 2025-12-08 21:53:28 +01:00
Danila Gudim
b36d7aa135 feature: Add --insecure flag for ignoring tls errors 2025-12-08 21:53:28 +01:00
Dennis Verheijden
f6b63aab86 Undo unrelated formatting changes 2025-09-15 11:07:30 +02:00
Dennis Verheijden
0f13d249f5 Add support for using the filename as the page title 2025-09-15 11:07:30 +02:00
Manuel Rüger
5e2b7b64e8 Drop cloudscript support for mermaid 2025-08-13 14:04:18 +02:00
Oddegamra
bb476d3901 fix: Initialize D2Scale configuration member
The D2Scale property of MarkConfig was never initialized, leading to a
default value of 0 being passed to the D2 renderer. This eventually led
to calling chromedp.ScreenshotScale with a scale value of 0. Chrome
doesn't like this, and never finishes the sceenshot operation.

Fixes #610
2025-06-12 11:59:40 +02:00
Manuel Rüger
bf542ab684 fix: Config loading from file 2025-06-06 13:54:34 +02:00
Manuel Rüger
3cc39ffe79 Add support for d2lang 2025-05-30 23:37:15 +02:00
Manuel Rüger
d1aee4d571 Migrate to urfave/cli/v3 2025-05-28 21:53:45 +02:00
Manuel Rüger
b7ef416472 Fix #594 2025-05-18 22:10:04 +02:00
Manuel Rüger
f24d8c8957 Fix lint issues detected by golangci v2 2025-04-02 16:42:32 +02:00
Rich Scott
ddc0ab9fbf Restructure code for more testaability
Move a number of funcs/files in the top-level `main` package into a new
`util` package, so test logic can directly invoke functions like
RunMark(), etc.  The main.go has been trimmed down to minimal sizing,
with former supporting funcs moved into `util` package, so they
can be run by unit tests.

Signed-off-by: Rich Scott <richscott@sent.com>
2025-04-02 14:37:48 +02:00