├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── filter-shim.js ├── package.json ├── src └── filter.ts ├── test ├── data │ ├── caption.md │ ├── caption_ref.md │ ├── default.md │ ├── elk.md │ ├── filename.md │ ├── filename_without_folder.md │ ├── folder.md │ ├── folder_with_caption.md │ ├── height.md │ ├── inline_png.md │ ├── invalid_codeblock.md │ ├── invalid_theme_name.md │ ├── invalid_theme_number.md │ ├── pad.md │ ├── pdf.md │ ├── sketch.md │ ├── theme_name.md │ ├── theme_number.md │ └── width.md └── filter.test.ts ├── tsconfig.json └── vitest.config.ts /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/.gitignore -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | !lib/ 2 | !package.json 3 | !filter-shim.js 4 | !LICENSE 5 | !README.md 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/README.md -------------------------------------------------------------------------------- /filter-shim.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/filter-shim.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/package.json -------------------------------------------------------------------------------- /src/filter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/src/filter.ts -------------------------------------------------------------------------------- /test/data/caption.md: -------------------------------------------------------------------------------- 1 | ```{.d2 caption="test"} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/caption_ref.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/test/data/caption_ref.md -------------------------------------------------------------------------------- /test/data/default.md: -------------------------------------------------------------------------------- 1 | ```d2 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/elk.md: -------------------------------------------------------------------------------- 1 | ```{.d2 layout=elk} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/filename.md: -------------------------------------------------------------------------------- 1 | ```{.d2 filename="test" folder="."} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/filename_without_folder.md: -------------------------------------------------------------------------------- 1 | ```{.d2 filename="test"} 2 | x -> y 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/folder.md: -------------------------------------------------------------------------------- 1 | ```{.d2 folder="tmp"} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/folder_with_caption.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/test/data/folder_with_caption.md -------------------------------------------------------------------------------- /test/data/height.md: -------------------------------------------------------------------------------- 1 | ```{.d2 height=30} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/inline_png.md: -------------------------------------------------------------------------------- 1 | ```{.d2 format=png} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/invalid_codeblock.md: -------------------------------------------------------------------------------- 1 | ```d3 2 | x -> y 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/invalid_theme_name.md: -------------------------------------------------------------------------------- 1 | ```{.d2 theme="Invalid"} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/invalid_theme_number.md: -------------------------------------------------------------------------------- 1 | ```{.d2 theme=-1} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/pad.md: -------------------------------------------------------------------------------- 1 | ```{.d2 pad=0} 2 | x -> y 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/pdf.md: -------------------------------------------------------------------------------- 1 | ```{.d2 format=pdf} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/sketch.md: -------------------------------------------------------------------------------- 1 | ```{.d2 sketch=true} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/theme_name.md: -------------------------------------------------------------------------------- 1 | ```{.d2 theme="Grape soda"} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/theme_number.md: -------------------------------------------------------------------------------- 1 | ```{.d2 theme=1} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/data/width.md: -------------------------------------------------------------------------------- 1 | ```{.d2 width=50%} 2 | a -> b 3 | ``` 4 | -------------------------------------------------------------------------------- /test/filter.test.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/test/filter.test.ts -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/tsconfig.json -------------------------------------------------------------------------------- /vitest.config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ram02z/d2-filter/HEAD/vitest.config.ts --------------------------------------------------------------------------------