27 Commits

Author SHA1 Message Date
Manuel Rüger
664a99cd00 test: restore global log level after each SetLogLevel subtest
SetLogLevel mutates a process-global logger, leaking state into
subsequent tests and causing order-dependent failures. Save the
current level before each subtest and restore it via t.Cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-13 01:05:32 +01:00
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
1fc553f102 style: fix indentation in Test_setLogLevel
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
875723da90 fix: trim whitespace when parsing 'content-appearance' flag 2026-03-11 12:47:35 +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
2173fbcfcd Make flag mutually exclusive 2025-09-15 11:07:30 +02: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
Paul.Glesmann
32490b2c90 feat: add Support for converting Material for MkDocs Admonitions to Confluence Info Panels
chore: add test files

fix: add tests for stripnewline and droph1

chore: rename Admontion to MkDocsAdmonition, remove annoying comments

fix: import parser instead of copying the file

chore: rename mkDocs renderer function

fix: fix bug and pipeline

feat: add Support for converting Material for MkDocs Admonitions to Confluence Info Panels

fix: add tests for stripnewline and droph1

chore: rename Admontion to MkDocsAdmonition, remove annoying comments

fix: import parser instead of copying the file

chore: rename mkDocs renderer function

fix: fix bug and pipeline

chore: remove test for droph1 and stripNewLines

fix: add admonitions to StripNewLines and dropH1 tests

feat: add Support for converting Material for MkDocs Admonitions to Confluence Info Panels

fix: add tests for stripnewline and droph1

chore: rename Admontion to MkDocsAdmonition, remove annoying comments

fix: import parser instead of copying the file

chore: rename mkDocs renderer function

fix: fix bug and pipeline

feat: add Support for converting Material for MkDocs Admonitions to Confluence Info Panels

chore: rename Admontion to MkDocsAdmonition, remove annoying comments

fix: import parser instead of copying the file

chore: rename mkDocs renderer function

fix: fix bug and pipeline

chore: remove test for droph1 and stripNewLines

fix: add admonitions to StripNewLines and dropH1 tests

feat: add mkdocsadmonition as opt-in renderer and parser

fix: fix unit tests
2025-06-18 11:14:52 +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
Jinming Wu, Patrick
f32dbbc04d fix: when using confluence cloud (with prefix) the /wiki keeps getting removed 2025-06-10 12:01:29 +02:00
Manuel Rüger
bf542ab684 fix: Config loading from file 2025-06-06 13:54:34 +02:00
Manuel Rüger
c57256cb7b Only use hyphenated versions of config keys 2025-06-06 02:31:17 +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
b630876c22 More code fixes for unit-testing '--continue-on-error'
Signed-off-by: Rich Scott <richscott@sent.com>
2025-04-02 14:37:48 +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