git clone
cd svenchcd packages/svench
pnpm install
pnpm dev # watch & rebuild
# watch & rebuild only some parts
#
# targets: app, theme, rollup (rollup plugin), util-esm, prism
#
pnpm dev -- --configTarget app,themeRun (the few) tests:
pnpm test
pnpm test -- --watch
pnpm test -- --help # see all of Zoar's (the test runner) optionsSvench is composed from multiple parts what have to work together...
-
lib/rollup-plugin.jsThe plugin for Rollup -
lib/svenchify.jsThe Svenchify util -- that injects the Rollup plugin into an existing config from "the outside", without needing to edit the project's config (and risk breaking it for some users) -
lib/preprocessor.jsSvench does some static analysis of Svench components to extract View names, sources, etc. when possible (i.e. when views are not dynamic). This needs to be a preprocessor, because we need to see the Svelte code (i.e. not the compiled JS). Also, it needs to be the last preprocessor in the chain (so that it doesn't see the input Markdown of Mdsvex, for example).
-
src/index.jsThe Svench lib itself (theSvenchcomponent, thestartutil, etc.) -
src/appThe components composing (the default) Svench's UI: top bar, menu, view boxes, etc. This part is packaged separately because Svench's UI is intended to be "pluggable" -- it is conceived so that some of its components or its whole could be replaced by the user for customization. -
themesCSS of the default theme, and the default markdown theme (used in Mdsvex pages, copied from Github). There published both in.css(e.g.themes/default.css), and.css.js"self contained" form. -
src/app/prism.jsA prebuilt version of Prism (syntax highlighter) that works well with Svench, including a selection of plugin (like Svelte highlighting) and embedded CSS.
cd docs
pnpm install
pnpx svenchcd examples/vite-default-svelte-template
pnpm install
# with cli:
pnpx svenchcd examples/snowpack-csa
pnpm install
# "manual" setup:
pnpm svench:plugin
# start with cli:
pnpm svench:cli
# or run cli directly:
pnpx svenchcd examples/svelte-template
pnpm install
# "manual" setup with Nollup (default):
pnpm svench:plugin
# "manual" setup with Rollup:
pnpm svench:plugin:rollup
# start with cli:
pnpm svench:cli
# or run cli directly:
pnpx svenchcd examples/rollup
pnpm install
pnpm svench # Rollup + rollup-plugin-hot
# or
pnpm svench:nollup # Nollup