Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
realazthat committed Aug 25, 2024
2 parents e76646c + afb64b6 commit fe877d8
Show file tree
Hide file tree
Showing 28 changed files with 1,318 additions and 742 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* text=auto eol=lf
*.* linguist-detectable=false
/src/* linguist-detectable=true
* linguist-detectable=false
/src/** linguist-detectable=true
336 changes: 0 additions & 336 deletions .github/README.example.terminal.svg

This file was deleted.

592 changes: 296 additions & 296 deletions .github/README.help.generated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 47 additions & 26 deletions .github/README.md.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@
<a href="#-features">🎇Features</a> &nbsp;&bull;&nbsp;
<a href="#-installation">🏠Installation</a> &nbsp;&bull;&nbsp;
<a href="#-usage">🚜Usage</a> &nbsp;&bull;&nbsp;
<a href="#-command-line-options">💻CLI</a> &nbsp;&bull;&nbsp;
<a href="#-requirements">✅Requirements</a> &nbsp;&bull;&nbsp;
<a href="#-command-line-options">💻CLI</a>
</strong>
</p>
<p align="center">
<strong>
<a href="#-requirements">✅Requirements</a>
&nbsp;&bull;&nbsp;
<a href="#-docker-image">🐳Docker</a>
&nbsp;&bull;&nbsp;
<a href="#-gotchas-and-limitations">🚸Gotchas</a>
</strong>
</p>
Expand Down Expand Up @@ -119,33 +126,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 "./README.example.output.svg"
' | trim %}

```bash
# Use this command:
{{ example_cmd | safe }}
```

<!--{{ shell('bash -c \'%s\'' | format(example_cmd),
rich='README.example.terminal.svg',
rich_alt='Example output',
rich_bg_color='black',
rich_cols=120,
decomentify=True,
include_args=False) }}-->
<!--{{snippet('./examples/simple_example.sh',
start='# SNIPPET_START',
end='\n# SNIPPET_END',
backtickify='bash',
decomentify='nl')|trim}}-->

<!--{{ shell('cat ./.github/simple_example.log',
start=': ECHO_SNIPPET_START',
end='^.*: ECHO_SNIPPET_END',
regex='MULTILINE',
rich='README.simple_example.log.svg',
rich_alt='Output of `bash ./examples/simple_example.sh`',
rich_bg_color='black',
rich_term='xterm-256color',
rich_cols=160,
include_args=False,
decomentify='nl') }}-->

And the resulting image (svg):

<img src="./README.example.output.svg" alt="Simple Excalidraw Diagram as a SVG" width="400" />
<img src="./examples/simple_example_output.svg" alt="Simple Excalidraw Diagram as a SVG" width="400" />

## 💻 Command Line Options

Expand Down Expand Up @@ -223,6 +224,26 @@ npx excalidraw-brute-export-cli \
- WSL2 Ubuntu 20.04, Node `{{rawsnippet('./.nvmrc')|trim}}` using Excalidraw at
tag `{{rawsnippet('./.github/.excalidraw-tag')|trim}}`.

## 🐳 Docker Image

Docker images are published to [ghcr.io/realazthat/{{project_name}}][49] at each
tag.

<!--{{snippet('./examples/simple-remote-docker_example-noautorun.sh',
start='# SNIPPET_START',
end='\n# SNIPPET_END',
backtickify='bash',
decomentify='nl')|trim}}-->

If you want to build the image yourself, you can use the Dockerfile in the
repository.

<!--{{snippet('./examples/simple-local-docker_example.sh',
start='# SNIPPET_START',
end='\n# SNIPPET_END',
backtickify='bash',
decomentify='nl')|trim}}-->

## 🚸 Gotchas and Limitations

- Sometimes playwright times out.
Expand Down
123 changes: 94 additions & 29 deletions .github/README.remotified.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ SOURCE: `.github/README.md.jinja2`.
<a href="#-features">🎇Features</a> &nbsp;&bull;&nbsp;
<a href="#-installation">🏠Installation</a> &nbsp;&bull;&nbsp;
<a href="#-usage">🚜Usage</a> &nbsp;&bull;&nbsp;
<a href="#-command-line-options">💻CLI</a> &nbsp;&bull;&nbsp;
<a href="#-requirements">✅Requirements</a> &nbsp;&bull;&nbsp;
<a href="#-command-line-options">💻CLI</a>
</strong>
</p>
<p align="center">
<strong>
<a href="#-requirements">✅Requirements</a>
&nbsp;&bull;&nbsp;
<a href="#-docker-image">🐳Docker</a>
&nbsp;&bull;&nbsp;
<a href="#-gotchas-and-limitations">🚸Gotchas</a>
</strong>
</p>
Expand All @@ -57,7 +64,7 @@ exact same export process as Excalidraw itself**

</div>

<img alt="Demo" src="https://raw.githubusercontent.com/realazthat/excalidraw-brute-export-cli/v0.3.2/.github/demo.gif" width="100%"/>
<img alt="Demo" src="https://raw.githubusercontent.com/realazthat/excalidraw-brute-export-cli/v0.4.0/.github/demo.gif" width="100%"/>

- ❔ What: Uses [🎭 playwright][2] to run a headless firefox browser to export
[Excalidraw][3] diagrams to svg/png files. Using a browser bypasses certain
Expand Down Expand Up @@ -111,7 +118,7 @@ exact same export process as Excalidraw itself**
npm install -g excalidraw-brute-export-cli

# Or install globally, direct from GitHub:
npm install -g https://github.com/realazthat/excalidraw-brute-export-cli.git#v0.3.2
npm install -g https://github.com/realazthat/excalidraw-brute-export-cli.git#v0.4.0

# Might prompt for root.
npx playwright install-deps
Expand All @@ -122,29 +129,34 @@ npx playwright install firefox

Example:



<!---->
```bash
# Use this command:

npx excalidraw-brute-export-cli \
-i ./examples/simple.excalidraw \
--background 1 \
--embed-scene 0 \
--dark-mode 0 \
--scale 1 \
--format svg \
-o "./README.example.output.svg"
-o "./examples/simple_example_output.svg"

ls "./examples/simple_example_output.svg"

```
<!---->

<!-- --><img alt="Example output" src="https://raw.githubusercontent.com/realazthat/excalidraw-brute-export-cli/v0.3.2/.github/README.example.terminal.svg"/><!-- -->
<!---->
<img alt="Output of `bash ./examples/simple_example.sh`" src="https://raw.githubusercontent.com/realazthat/excalidraw-brute-export-cli/v0.4.0/.github/README.simple_example.log.svg"/>
<!-- -->

And the resulting image (svg):

<img alt="Simple Excalidraw Diagram as a SVG" src="https://raw.githubusercontent.com/realazthat/excalidraw-brute-export-cli/v0.3.2/README.example.output.svg" width="400"/>
<img alt="Simple Excalidraw Diagram as a SVG" src="https://raw.githubusercontent.com/realazthat/excalidraw-brute-export-cli/v0.4.0/examples/simple_example_output.svg" width="400"/>

## 💻 Command Line Options

<!-- --><img alt="Output of `npx excalidraw-brute-export-cli --help`" src="https://raw.githubusercontent.com/realazthat/excalidraw-brute-export-cli/v0.3.2/.github/README.help.generated.svg"/><!-- -->
<!-- --><img alt="Output of `npx excalidraw-brute-export-cli --help`" src="https://raw.githubusercontent.com/realazthat/excalidraw-brute-export-cli/v0.4.0/.github/README.help.generated.svg"/><!-- -->

## 🐳 Running Excalidraw locally

Expand Down Expand Up @@ -203,7 +215,7 @@ npx excalidraw-brute-export-cli \
Excalidraw tag `v0.15.0` for more
consistent output, and testing.
- Supported Node versions: `>=18.0.0 <19.0.0 || >=20.0.0 <21.0.0 || >=21.0.0 <22.0.0 || >=22.0.0 <23.0.0` (See
[./package.json](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/package.json)). These versions were chosen from
[./package.json](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/package.json)). These versions were chosen from
current supported and upcoming versions of node, from
[Node.js: Previous Releases](https://nodejs.org/en/about/previous-releases).
- Tested Node versions on GitHub Actions: `["18.20.2","20.12.1","21.7.3","22.0.0"]`.
Expand All @@ -213,6 +225,59 @@ npx excalidraw-brute-export-cli \
- WSL2 Ubuntu 20.04, Node `v20.12.1` using Excalidraw at
tag `v0.15.0`.

## 🐳 Docker Image

Docker images are published to [ghcr.io/realazthat/excalidraw-brute-export-cli][49] at each
tag.

<!---->
```bash

# Use the published images at ghcr.io/realazthat/snipinator.
# /data in the docker image is the working directory, so paths are simpler.
docker run --rm --tty \
-u "$(id -u):$(id -g)" \
-v "${PWD}:/data" \
ghcr.io/realazthat/excalidraw-brute-export-cli:v0.4.0 \
-i ./examples/simple.excalidraw \
--background 1 \
--embed-scene 0 \
--dark-mode 0 \
--scale 1 \
--format svg \
-o "./examples/simple_example_output.svg"

ls "./examples/simple_example_output.svg"

```
<!---->

If you want to build the image yourself, you can use the Dockerfile in the
repository.

<!---->
```bash

docker build -t my-excalidraw-brute-export-cli-image .

# /data in the docker image is the working directory, so paths are simpler.
docker run --rm --tty \
-u "$(id -u):$(id -g)" \
-v "${PWD}:/data" \
my-excalidraw-brute-export-cli-image \
-i ./examples/simple.excalidraw \
--background 1 \
--embed-scene 0 \
--dark-mode 0 \
--scale 1 \
--format svg \
-o "./examples/simple_example_output.svg"

ls "./examples/simple_example_output.svg"

```
<!---->

## 🚸 Gotchas and Limitations

- Sometimes playwright times out.
Expand All @@ -231,15 +296,15 @@ repository.
## 🔑 License

This project is licensed under the MIT License - see the
[./LICENSE.md](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/LICENSE.md) file for details.
[./LICENSE.md](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/LICENSE.md) file for details.

## 🫡 Contributions

### Development environment: Linux-like

- For running `pre.sh` (Linux-like environment).

- From [./.github/dependencies.yml](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/.github/dependencies.yml), which is used for
- From [./.github/dependencies.yml](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/.github/dependencies.yml), which is used for
the GH Action to do a fresh install of everything:

```yaml
Expand All @@ -258,13 +323,13 @@ This project is licensed under the MIT License - see the
```

- Requires `pyenv`, or an exact matching version of python as in
[scripts/.python-version](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/scripts/.python-version) (which is currently
[scripts/.python-version](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/scripts/.python-version) (which is currently
`3.8.18 `).
- `jq`, ([installation](https://jqlang.github.io/jq/)) required for
[yq](https://github.com/kislyuk/yq), which is itself required for our
[./README.md](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/README.md) generation, which uses `tomlq` (from the
[./README.md](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/README.md) generation, which uses `tomlq` (from the
[yq](https://github.com/kislyuk/yq) package) to include version strings from
[./scripts/pyproject.toml](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/scripts/pyproject.toml).
[./scripts/pyproject.toml](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/scripts/pyproject.toml).
- act (to run the GH Action locally):
- Requires nodejs.
- Requires Go.
Expand All @@ -277,16 +342,16 @@ This project is licensed under the MIT License - see the
### Commit Process

1. (Optionally) Fork the `develop` branch.
2. If the [.github/demo.gif](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/.github/demo.gif) will change, run
2. If the [.github/demo.gif](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/.github/demo.gif) will change, run
`bash ./scripts/generate-animation.sh`, this will generate a new
[.github/demo.gif](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/.github/demo.gif).
[.github/demo.gif](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/.github/demo.gif).
- Sanity-check the animation visually!
- Unfortunately, every run will make a unique gif, please don't stage this
file unless it changes due to some feature change or somesuch.
3. Stage your files: e.g `git add path/to/file.py`.
4. `bash ./scripts/pre.sh`, this will format, lint, and test the code.
5. `git status` check if anything changed (generated
[README.md](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/README.md) for example), if so, `git add` the changes,
[README.md](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/README.md) for example), if so, `git add` the changes,
and go back to the previous step.
6. `git commit -m "..."`.
7. Make a PR to `develop` (or push to develop if you have the rights).
Expand All @@ -298,7 +363,7 @@ These instructions are for maintainers of the project.
1. In the `develop` branch, run `bash ./scripts/pre.sh` to ensure
everything is in order.
2. In the `develop` branch, bump the version in
[package.json](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/package.json), following semantic versioning
[package.json](https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/package.json), following semantic versioning
principles. Run `bash ./scripts/pre.sh` to ensure everything is in order.
- If anything got generated (e.g README or terminal output images), you will
have to stage those.
Expand All @@ -318,7 +383,7 @@ These instructions are for maintainers of the project.
`git checkout develop && git merge master`.
9. Push the develop branch to GitHub: `git push origin develop`.

[1]: https://raw.githubusercontent.com/realazthat/excalidraw-brute-export-cli/v0.3.2/.github/logo-exported.svg
[1]: https://raw.githubusercontent.com/realazthat/excalidraw-brute-export-cli/v0.4.0/.github/logo-exported.svg
[2]: https://playwright.dev/
[3]: https://excalidraw.com/

Expand All @@ -331,20 +396,20 @@ These instructions are for maintainers of the project.
[5]: https://img.shields.io/badge/Platform-Node-0A1E1E?style=plastic&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWxhcHRvcC1taW5pbWFsIj48cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTIiIHg9IjMiIHk9IjQiIHJ4PSIyIiByeT0iMiIvPjxsaW5lIHgxPSIyIiB4Mj0iMjIiIHkxPSIyMCIgeTI9IjIwIi8+PC9zdmc+
[6]: https://img.shields.io/github/languages/top/realazthat/excalidraw-brute-export-cli.svg?&cacheSeconds=28800&style=plastic&color=0A1E1E
[7]: https://img.shields.io/github/license/realazthat/excalidraw-brute-export-cli?style=plastic&color=0A1E1E
[8]: https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.3.2/LICENSE.md
[8]: https://github.com/realazthat/excalidraw-brute-export-cli/blob/v0.4.0/LICENSE.md
[9]: https://img.shields.io/npm/v/excalidraw-brute-export-cli?style=plastic&color=0A1E1E
[10]: https://www.npmjs.com/package/excalidraw-brute-export-cli
[11]: https://github.com/realazthat/excalidraw-brute-export-cli/tree/master
[12]: https://github.com/realazthat/excalidraw-brute-export-cli/tree/develop
[13]: https://img.shields.io/github/actions/workflow/status/realazthat/excalidraw-brute-export-cli/build-and-test.yml?branch=master&style=plastic
[14]: https://img.shields.io/github/actions/workflow/status/realazthat/excalidraw-brute-export-cli/build-and-test.yml?branch=develop&style=plastic
[15]: https://github.com/realazthat/excalidraw-brute-export-cli/actions/workflows/build-and-test.yml
[16]: https://img.shields.io/github/commits-since/realazthat/excalidraw-brute-export-cli/v0.3.2/master?style=plastic
[17]: https://img.shields.io/github/commits-since/realazthat/excalidraw-brute-export-cli/v0.3.2/develop?style=plastic
[18]: https://github.com/realazthat/excalidraw-brute-export-cli/compare/v0.3.2...master
[19]: https://github.com/realazthat/excalidraw-brute-export-cli/compare/v0.3.2...develop
[20]: https://img.shields.io/github/commits-since/realazthat/excalidraw-brute-export-cli/v0.3.2/develop?style=plastic
[21]: https://github.com/realazthat/excalidraw-brute-export-cli/compare/v0.3.2...develop
[16]: https://img.shields.io/github/commits-since/realazthat/excalidraw-brute-export-cli/v0.4.0/master?style=plastic
[17]: https://img.shields.io/github/commits-since/realazthat/excalidraw-brute-export-cli/v0.4.0/develop?style=plastic
[18]: https://github.com/realazthat/excalidraw-brute-export-cli/compare/v0.4.0...master
[19]: https://github.com/realazthat/excalidraw-brute-export-cli/compare/v0.4.0...develop
[20]: https://img.shields.io/github/commits-since/realazthat/excalidraw-brute-export-cli/v0.4.0/develop?style=plastic
[21]: https://github.com/realazthat/excalidraw-brute-export-cli/compare/v0.4.0...develop
[22]: https://img.shields.io/github/last-commit/realazthat/excalidraw-brute-export-cli/master?style=plastic
[23]: https://img.shields.io/github/last-commit/realazthat/excalidraw-brute-export-cli/develop?style=plastic
[24]: https://img.shields.io/node/v/excalidraw-brute-export-cli?style=plastic&color=0A1E1E
Expand Down
Loading

0 comments on commit fe877d8

Please sign in to comment.