For the current setup where people have to fork or at least clone quartz
this changes nothing - but it allows you to install quartz as a
devDependency via npm and have it actually work.
One real change is switch from `.quartz-cache` to
`node_modules/.cache/quartz` for transpilation results, this is an
artifact from my previous attempts, I guess with this one I can change
it back - but `node_modules/.cache` feels more better imo idk.
edit: OTOH if you want to have quartz be a _completely_ separate binary
(which this also enables I think), having it create a node_modules
folder is weird, so I made a quick hack for that for now.
Example:
```bash
$ mkdir my-repo && cd my-repo
$ npm i quartz@necauqua/quartz#untangled # quartz@ prefix is important
$ cp node_modules/quartz/quartz.*.ts . # copy the default configs
$ mkdir content && echo "# Hello World!" > content/index.md
$ npx quartz build --serve # this just works!
$ echo 'body { background: red !important; }' > styles.scss
```
Notice how I used my branch in the `npm i` line, ideally it'd be
`npm i quartz@jackyzho0/quartz`, or maybe we can somehow get the quartz
package on npm and it'll just be `npm i quartz`.
In the latter case `npx quartz build` will literally just work without
a local npm package at all?.
Having some support for components and plugins being in separate npm
packages instead of people copying code around is not out of the picture
with this too btw.
Closes#502
MOVE ME
* feat: add basic explorer structure„
* feat: integrate new component/plugin
* feat: add basic explorer structure
* feat: add sort to FileNodes
* style: improve style for explorer
* refactor: remove unused explorer plugin
* refactor: clean explorer structure, fix base (toc)
* refactor: clean css, respect displayClass
* style: add styling to chevron
* refactor: clean up debug statements
* refactor: remove unused import
* fix: clicking folder icon sometimes turns invisible
* refactor: clean css
* feat(explorer): add config for title
* feat: add config for folder click behavior
* fix: `no-pointer` not being set for all elements
new approach, have one `no-pointer` class, that removes pointer events and one `clickable` class on the svg and button (everything that can normally be clicked). then, find all children with `clickable` and toggle `no-pointer`
* fix: bug where nested folders got incorrect height
this fixes the bug where nested folders weren't calculating their total height correctly. done by adding class to main container of all children and calculating total
* feat: introduce `folderDefaultState` config
* feat: store depth for explorer nodes
* feat: implement option for collapsed state + bug fixes
folderBehavior: "link" still has bad styling, but major bugs with pointers fixed (not clean yet, but working)
* fix: default folder icon rotation
* fix: hitbox problem with folder links, fix style
* fix: redirect url for nested folders
* fix: inconsistent behavior with 'collapseFolders' opt
* chore: add comments to `ExplorerNode`
* feat: save explorer state to local storage (not clean)
* feat: rework `getFolders()`, fix localstorage read + write
* feat: set folder state from localStorage
needs serious refactoring but functional (except folder icon orientation)
* fix: folder icon orientation after local storage
* feat: add config for `useSavedState`
* refactor: clean `explorer.inline.ts`
remove unused functions, comments, unused code, add types to EventHandler
* refactor: clean explorer
merge `isSvg` paths, remove console logs
* refactor: add documentation, remove unused funcs
* feat: rework folder collapse logic
use grids instead of jank scuffed solution with calculating total heights
* refactor: remove depth arg from insert
* feat: restore collapse functionality to clicks
allow folder icon + folder label to collapse folders again
* refactor: remove `pointer-event` jank
* feat: improve svg viewbox + remove unused props
* feat: use css selector to toggle icon
rework folder icon to work purely with css instead of JS manipulation
* refactor: remove unused cfg
* feat: move TOC to right sidebar
* refactor: clean css
* style: fix overflow + overflow margin
* fix: use `resolveRelative` to resolve file paths
* fix: `defaultFolderState` config option
* refactor: rename import, rename `folderLi` + ul
* fix: use `QuartzPluginData` type
* docs: add explorer documentation