* Add icons as masks
To handle a simple way to add custom icons, i made it pure css. Icon are now a mask for the callout-icon div, so they always follow the --color form the current callout.
Now to add a custom icon, you simply add
```css
.callout {
&[data-callout="custom"] {
--color: #customcolor;
--border: #custombordercolor;
--bg: #custombg;
--callout-icon: url('data:image/svg+xml; utf8, <custom formatted svg>');
}
```
to custom.scss
* remove now unused code
* Make callouts an enum
* docs: update instructions for custom callouts
* Prettier & run format
* dynamic matching
For maintainability, make dynamic mathching. If we or Obsidian want to support more callouts, we simply add it to the enum
* callout mapping const
Getting ride of the enum entierly as it's not worth here?
* fix callout icon styling
* Add forgotten icons
* Rebase
* harmonize callout icon and fold icon
* fix docs + prettier
* Update docs/features/callouts.md
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
* Update quartz/plugins/transformers/ofm.ts
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
* Suggestions fix
* remove unecessary rules
* comment is always nice
* Update docs/features/callouts.md
---------
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
* Add option to allow embedding YouTube videos with Obsidian Markdown syntax
* Update Obsidian compatability doc page
* Switch to converting YT links as an html plugin
* Added doc example to explorer sortFn
* Prettier fixed formatting
* Let Prettier fix the formatting of the entire markdown file
* Updated example
* Added extra commentary and fixed example
* Update docs/features/explorer.md
* doc fixes
* docs: remove leftover TODO
* docs: move example to `advanced`
---------
Co-authored-by: Sidney <85735034+Epicrex@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
Co-authored-by: Ben Schlegel <ben5.schlegel@gmail.com>
* Add note about fast-glob
* Add warning about non-markdown files
Also added a glob pattern to filter out all non-markdown files outside of a specified folder.
* run npm format
---------
Co-authored-by: wych <wychwitchcraft@gmail.com>
ox-hugo currently supports the following syntax for latex equations:
- https://orgmode.org/manual/LaTeX-fragments.html
- https://ox-hugo.scripter.co/doc/equations
This syntax is supported by mathjax as is mentioned in the ox-hugo documentation.
But quartz uses remark-math which has some issues with the \( \) syntax.
See https://github.com/remarkjs/remark-math/issues/39
This change adds few more transformations to the OxHugoFlavouredMarkdown
plugin, which makes a best effort conversion of this syntax into what
the Quartz Latex transformer plugin supports.
With these changes, the generated files show latex formatting with
default quartz configuration.
Sidenote on `\_` escape by ox-hugo:
ox-hugo escapes, _ using \_, we match against it after we transform
equations into what quartz supports($$ and $).
This could be achieved using lookaround like regex as follows
```js
(?<=(\$|\$\$)[\s\S]*) -> Positive lookbehind for $ or $$
\\_ -> Matches \_
(?=[\s\S]*(?:\1)) Positive lookahead for $ or $$ if matched
const escapedUnderscoreRegex = new RegExp(/(?<=(\$|\$\$)[\s\S]*)\\_(?=[\s\S]*(?:\1))/, "g")
````
But since lookahead/behind can slow things down on large files, we just
look up all equations with $ and $$ delimiters and then try replacing \_
* 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
* feat(plugins): add OxHugoFlavouredMarkdown
ox-hugo is an org exporter backend that exports org files to
hugo-compatible markdown in an opinionated way. This plugin adds some
tweaks to the generated markdown to make it compatible with quartz but
the list of changes applied it is not extensive.
In the future however, we could leapfrog ox-hugo altogether and
create a quartz site directly out of org-roam files. That way we won't
have to do all the ritual dancing that this plugin has to perform.
See https://github.com/k2052/org-to-markdown
* fix: add toml to remarkFrontmatter configuration
* docs: add docs for OxHugoFlavouredMarkdown
* fixup! docs: add docs for OxHugoFlavouredMarkdown