diff --git a/.github/README.example.terminal.svg b/.github/README.example.terminal.svg deleted file mode 100644 index 51a4ecf..0000000 --- a/.github/README.example.terminal.svg +++ /dev/null @@ -1,336 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -info -: options: - - -info -: { - - -  i:  -'./examples/simple.excalidraw' -, - - -  input:  -'./examples/simple.excalidraw' -, - - -  background:  -true -, - - -  b:  -true -, - - -  embedScene:  -false -, - - -  e:  -false -, - - -  darkMode:  -false -, - - -  d:  -false -, - - -  scale:  -1 -, - - -  s:  -1 -, - - -  format:  -'svg' -, - - -  f:  -'svg' -, - - -  o:  -'./.github/README.example.output.svg' -, - - -  output:  -'./.github/README.example.output.svg' -, - - -  url:  -'' -, - - -  excalidrawVersion:  -'' -, - - -  headless:  -true -, - - -  leaveBrowserRunning:  -false -, - - -  screenshots:  -'' -, - - -  actionSleepTime:  -200 -, - - -  timeout:  --1 - - -} - - -info -: Falling back to environment variable EXCALIDRAW_BRUTE_EXPORT_CLI_URL - - -info -: excalidrawURL: http://localhost:59876 - - -info -: Detecting Excalidraw version... - - -info -: excalidrawVersion: 0.15.0 - - -info -: Clicking: Menu Burger - - -info -: Clicking: Open Menu Item - - -info -: File is chosen! - - -info -: Clicking: Export Menu Item - - -info -: await exportBackgroundSwitch.count(): 1 - - -info -: await exportEmbedSwitch.count(): 1 - - -info -: await exportScaleDiv.count(): 1 - - -info -: await exportScaleElements.count(): 3 - - -info -: Pressing SVG button! - - -info -: File is downloaded! - - -info -: closing... - - - - - \ No newline at end of file diff --git a/.github/README.md.jinja2 b/.github/README.md.jinja2 index abc02d7..2a3d903 100644 --- a/.github/README.md.jinja2 +++ b/.github/README.md.jinja2 @@ -119,33 +119,27 @@ npx playwright install firefox Example: -{% set example_cmd=' -npx excalidraw-brute-export-cli \\ - -i ./examples/simple.excalidraw \\ - --background 1 \\ - --embed-scene 0 \\ - --dark-mode 0 \\ - --scale 1 \\ - --format svg \\ - -o "./.github/README.example.output.svg" -' | trim %} - -```bash -# Use this command: -{{ example_cmd | safe }} -``` - - + + + And the resulting image (svg): -Simple Excalidraw Diagram as a SVG +Simple Excalidraw Diagram as a SVG ## 💻 Command Line Options diff --git a/.github/README.remotified.md b/.github/README.remotified.md index c13ebf2..6ee5948 100644 --- a/.github/README.remotified.md +++ b/.github/README.remotified.md @@ -122,10 +122,9 @@ npx playwright install firefox Example: - - + ```bash -# Use this command: + npx excalidraw-brute-export-cli \ -i ./examples/simple.excalidraw \ --background 1 \ @@ -133,14 +132,20 @@ npx excalidraw-brute-export-cli \ --dark-mode 0 \ --scale 1 \ --format svg \ - -o "./.github/README.example.output.svg" + -o "./examples/simple_example_output.svg" + +ls "./examples/simple_example_output.svg" + ``` + -Example output + +Output of `bash ./examples/simple_example.sh` + And the resulting image (svg): -Simple Excalidraw Diagram as a SVG +Simple Excalidraw Diagram as a SVG ## 💻 Command Line Options diff --git a/.github/README.simple_example.log.svg b/.github/README.simple_example.log.svg new file mode 100644 index 0000000..f7c05e4 --- /dev/null +++ b/.github/README.simple_example.log.svg @@ -0,0 +1,367 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +npx excalidraw-brute-export-cli -i ./examples/simple.excalidraw --background 1 --embed-scene 0 --dark-mode 0 --scale 1 --format svg -o  + + +./examples/simple_example_output.svg + + +info +: options: + + +info +: { + + +  i:  +'./examples/simple.excalidraw' +, + + +  input:  +'./examples/simple.excalidraw' +, + + +  background:  +true +, + + +  b:  +true +, + + +  embedScene:  +false +, + + +  e:  +false +, + + +  darkMode:  +false +, + + +  d:  +false +, + + +  scale:  +1 +, + + +  s:  +1 +, + + +  format:  +'svg' +, + + +  f:  +'svg' +, + + +  o:  +'./examples/simple_example_output.svg' +, + + +  output:  +'./examples/simple_example_output.svg' +, + + +  url:  +'' +, + + +  excalidrawVersion:  +'' +, + + +  headless:  +true +, + + +  leaveBrowserRunning:  +false +, + + +  screenshots:  +'' +, + + +  actionSleepTime:  +200 +, + + +  timeout:  +-1 + + +} + + +info +: Falling back to environment variable EXCALIDRAW_BRUTE_EXPORT_CLI_URL + + +info +: excalidrawURL: http://localhost:59876 + + +info +: Detecting Excalidraw version... + + +info +: excalidrawVersion: 0.15.0 + + +info +: Clicking: Menu Burger + + +info +: Clicking: Open Menu Item + + +info +: File is chosen! + + +info +: Clicking: Export Menu Item + + +info +: await exportBackgroundSwitch.count(): 1 + + +info +: await exportEmbedSwitch.count(): 1 + + +info +: await exportScaleDiv.count(): 1 + + +info +: await exportScaleElements.count(): 3 + + +info +: Pressing SVG button! + + +info +: File is downloaded! + + +info +: closing... + + + +ls ./examples/simple_example_output.svg + + +./examples/simple_example_output.svg + + + + + \ No newline at end of file diff --git a/.github/simple_example.log b/.github/simple_example.log new file mode 100644 index 0000000..7c950e8 --- /dev/null +++ b/.github/simple_example.log @@ -0,0 +1,53 @@ +$ set -e -x -v -u -o pipefail +set +v +$ set +v +$ GREEN='\033[0;32m' +$ YELLOW='\033[1;33m' +$ NC='\033[0m' +$ PS4='\033[0;32m$ \033[0m' +$ EXCALIDRAW_BRUTE_EXPORT_CLI_URL=http://localhost:59876 +$ [[ -z http://localhost:59876 ]] +$ : ECHO_SNIPPET_START +$ npx excalidraw-brute-export-cli -i ./examples/simple.excalidraw --background 1 --embed-scene 0 --dark-mode 0 --scale 1 --format svg -o ./examples/simple_example_output.svg +info: options: +info: { + i: './examples/simple.excalidraw', + input: './examples/simple.excalidraw', + background: true, + b: true, + embedScene: false, + e: false, + darkMode: false, + d: false, + scale: 1, + s: 1, + format: 'svg', + f: 'svg', + o: './examples/simple_example_output.svg', + output: './examples/simple_example_output.svg', + url: '', + excalidrawVersion: '', + headless: true, + leaveBrowserRunning: false, + screenshots: '', + actionSleepTime: 200, + timeout: -1 +} +info: Falling back to environment variable EXCALIDRAW_BRUTE_EXPORT_CLI_URL +info: excalidrawURL: http://localhost:59876 +info: Detecting Excalidraw version... +info: excalidrawVersion: 0.15.0 +info: Clicking: Menu Burger +info: Clicking: Open Menu Item +info: File is chosen! +info: Clicking: Export Menu Item +info: await exportBackgroundSwitch.count(): 1 +info: await exportEmbedSwitch.count(): 1 +info: await exportScaleDiv.count(): 1 +info: await exportScaleElements.count(): 3 +info: Pressing SVG button! +info: File is downloaded! +info: closing... +$ ls ./examples/simple_example_output.svg +./examples/simple_example_output.svg +$ : ECHO_SNIPPET_END diff --git a/README.md b/README.md index 3ba5826..fd9901f 100644 --- a/README.md +++ b/README.md @@ -122,10 +122,9 @@ npx playwright install firefox Example: - - + ```bash -# Use this command: + npx excalidraw-brute-export-cli \ -i ./examples/simple.excalidraw \ --background 1 \ @@ -133,14 +132,20 @@ npx excalidraw-brute-export-cli \ --dark-mode 0 \ --scale 1 \ --format svg \ - -o "./.github/README.example.output.svg" + -o "./examples/simple_example_output.svg" + +ls "./examples/simple_example_output.svg" + ``` + -Example output + +Output of `bash ./examples/simple_example.sh` + And the resulting image (svg): -Simple Excalidraw Diagram as a SVG +Simple Excalidraw Diagram as a SVG ## 💻 Command Line Options diff --git a/examples/local-docker_example.sh b/examples/local-docker_example.sh index 04db153..9219fa8 100755 --- a/examples/local-docker_example.sh +++ b/examples/local-docker_example.sh @@ -37,13 +37,13 @@ docker run --rm --tty \ my-excalidraw-brute-export-cli-image \ -i ./examples/simple.excalidraw \ --background 1 \ - --embed-scene 1 \ + --embed-scene 0 \ --dark-mode 0 \ --scale 1 \ - --format png \ - -o "./examples/simple_example_output.png" + --format svg \ + -o "./examples/simple_example_output.svg" -ls "./examples/simple_example_output.png" +ls "./examples/simple_example_output.svg" # SNIPPET_END : ECHO_SNIPPET_END diff --git a/examples/remote-docker_example-noautorun.sh b/examples/remote-docker_example-noautorun.sh index b07b47f..878ad2d 100755 --- a/examples/remote-docker_example-noautorun.sh +++ b/examples/remote-docker_example-noautorun.sh @@ -36,13 +36,13 @@ docker run --rm --tty \ ghcr.io/realazthat/excalidraw-brute-export-cli:v0.3.2 \ -i ./examples/simple.excalidraw \ --background 1 \ - --embed-scene 1 \ + --embed-scene 0 \ --dark-mode 0 \ --scale 1 \ - --format png \ - -o "./examples/simple_example_output.png" + --format svg \ + -o "./examples/simple_example_output.svg" -ls "./examples/simple_example_output.png" +ls "./examples/simple_example_output.svg" # SNIPPET_END : ECHO_SNIPPET_END diff --git a/examples/simple_example.sh b/examples/simple_example.sh index acda08b..4b877ad 100755 --- a/examples/simple_example.sh +++ b/examples/simple_example.sh @@ -22,13 +22,13 @@ fi npx excalidraw-brute-export-cli \ -i ./examples/simple.excalidraw \ --background 1 \ - --embed-scene 1 \ + --embed-scene 0 \ --dark-mode 0 \ --scale 1 \ - --format png \ - -o "./examples/simple_example_output.png" + --format svg \ + -o "./examples/simple_example_output.svg" -ls "./examples/simple_example_output.png" +ls "./examples/simple_example_output.svg" # SNIPPET_END : ECHO_SNIPPET_END diff --git a/examples/simple_example.sh.jinja2 b/examples/simple_example.sh.jinja2 index 05d6560..823ed2b 100644 --- a/examples/simple_example.sh.jinja2 +++ b/examples/simple_example.sh.jinja2 @@ -60,13 +60,13 @@ docker build -t {{docker_image_name|safe}} . {{cmd|safe}} \ -i ./examples/simple.excalidraw \ --background 1 \ - --embed-scene 1 \ + --embed-scene 0 \ --dark-mode 0 \ --scale 1 \ - --format png \ - -o "./examples/simple_example_output.png" + --format svg \ + -o "./examples/simple_example_output.svg" -ls "./examples/simple_example_output.png" +ls "./examples/simple_example_output.svg" # SNIPPET_END : ECHO_SNIPPET_END diff --git a/examples/simple_example_output.png b/examples/simple_example_output.png deleted file mode 100644 index 96b5707..0000000 Binary files a/examples/simple_example_output.png and /dev/null differ diff --git a/.github/README.example.output.svg b/examples/simple_example_output.svg similarity index 100% rename from .github/README.example.output.svg rename to examples/simple_example_output.svg diff --git a/scripts/generate-readme.sh b/scripts/generate-readme.sh index 92985be..e8630f6 100755 --- a/scripts/generate-readme.sh +++ b/scripts/generate-readme.sh @@ -28,6 +28,7 @@ NODE_VERSION_PATH=${PWD}/.nvmrc \ bash scripts/format.sh +( # FORCE_COLOR and TERM are set, to produce consistent results across different # systems. # @@ -55,10 +56,19 @@ export TERM=dumb export CLI_WIDTH=120 export LINES=40 export COLUMNS=120 + + +# Try to make terminal output as consistent as possible. +TERM=xterm-256color COLUMNS=160 LINES=40 \ +PS4="${GREEN}$ ${NC}" unbuffer bash -x ./examples/simple_example.sh \ + > .github/simple_example.log 2>&1 + + python -m snipinator.cli \ -t "${PROJ_PATH}/.github/README.md.jinja2" \ -o "${PROJ_PATH}/README.md" \ --rm --force --create --chmod-ro +) ################################################################################ LAST_VERSION=$(node -p "require('./package.json').version") python -m mdremotifier.cli \