Commit Graph

86 Commits

Author SHA1 Message Date
Hrishikesh Barman
b38d9322b1 feat: add transformations for latex in oxhugofm (#510)
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 \_
2023-09-29 11:35:26 -07:00
Ben Schlegel
12664ae596 feat: implement breadcrumb component (#508)
* feat: implement breadcrumbs

* style: fix styling, move breadcrumbs to top

* refactor: move `capitalize to `lang.ts``

* refactor: clean breadcrumb generation

* feat: add options to breadcrumbs

* feat: implement `resolveFrontmatterTitle`

* feat: add `hideOnRoot` option

* feat(consistency): capitalize every crumb

* style: add `flex-wrap` to parent container

* refactor: clean `Breadcrumbs.tsx`

* feat(accessibility): use `nav`, add aria label

* style: improve look in popovers by adding margin

* docs: write docs for breadcrumb component

* refactor: collapse `if` condition for hideOnRoot

* chore: add todo for perf optimization

* docs: update introduction
2023-09-29 10:26:15 +02:00
Jacky Zhao
37d59b994e fix: coerce title to string 2023-09-25 18:15:55 -07:00
Jacky Zhao
2443791d33 fix: treat the 0 time as invalid too 2023-09-24 14:47:30 -07:00
Jacky Zhao
5f0a7a5d35 feat: add warning for invalid date format 2023-09-22 10:04:50 -07:00
rwutscher
ae57715822 fix: tag regex no longer includes purely numerical 'tags' (#485)
* fix: tag regex no longer includes purely numerical 'tags'

* fix: formatting

* fix: use guard in findAndReplace() instead of expanding the regex
2023-09-19 12:26:30 -07:00
Jacky Zhao
0a6e9c3f86 feat: note transclusion (#475)
* basic transclude

* feat: note transclusion
2023-09-13 11:28:53 -07:00
Jacky Zhao
bfabedc5f7 fix dont show html in search when rssFullHtml is true (closes #474) 2023-09-13 09:43:30 -07:00
Jacky Zhao
3844a911e5 feat: resolve block references in obsidian markdown 2023-09-12 22:55:50 -07:00
hcplantern
1562d2d9ad fix: callout parsing (#469) 2023-09-11 23:00:21 -07:00
Oskar Manhart
4b37976c29 feat: plugin for remark-breaks (#467)
* feat: plugin for remark-breaks

* fix: update package-lock.json

* fix: styling

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* Update linebreaks.ts

* Update index.ts

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
2023-09-10 23:11:42 -07:00
Jacky Zhao
fde8608927 fix: more lenient date parsing for templates 2023-09-08 09:29:57 -07:00
Jacky Zhao
425592d09a fix: links to index not showing in graph (closes #450) 2023-09-06 22:24:15 -07:00
Jacky Zhao
32b65cd1f7 fix: escape encoding for titles in rss 2023-09-06 21:47:59 -07:00
Jacky Zhao
7e1be1d5b2 fix: dont transform external links 2023-09-06 20:25:50 -07:00
Ben Schlegel
f06440806f fix: regex for matching highlights (closes #437) (#438)
* fix:  regex for matching highlights

* fix: regex for empty highlights
2023-08-31 11:55:04 -07:00
Jeffrey Fabian
683c40a0ac feat: support kebab-case and nested tags in Obsidian-flavored Markdown tag-in-content parsing (#425)
* enhancement: support kebab-case and nested tags in ofm transformer

* update regex/capture groups to allow for (arbitrarily) nested values and tags of only -/_

* Update quartz/plugins/transformers/ofm.ts

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
2023-08-29 10:14:54 -07:00
Jacky Zhao
d4187034c2 fix: slugify tag on page before adding (closes #411) 2023-08-27 12:27:55 -07:00
Hrishikesh Barman
1de352dc11 feat(plugins): add OxHugoFlavouredMarkdown (#419)
* 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
2023-08-25 22:52:23 -07:00
Hrishikesh Barman
da64b9be3a feat(plugins): add toml support for frontmatter (#418)
* feat(plugins): add toml support for frontmatter

Currently frontmatter is expected to be yaml, with delimiter set to
"---". This might not always be the case, for example ox-hugo(a hugo
exporter for org-mode files) exports in toml format with the delimiter
set to "+++" by default.

With this change, the users will be able use frontmatter plugin to
support this toml frontmatter format.

Example usage: `Plugin.FrontMatter({delims: "+++", language: 'toml'})`

- [0] https://ox-hugo.scripter.co/doc/org-meta-data-to-hugo-front-matter/

* fixup! feat(plugins): add toml support for frontmatter
2023-08-25 10:25:46 -07:00
Jacky Zhao
da2e87d655 fix: use proper full base for links.ts 2023-08-23 12:18:50 -07:00
Jacky Zhao
2ecc650d42 fix: percent-encoding for files with %, contentIndex for non-latin chars (closes #397, closes #399) 2023-08-22 23:34:28 -07:00
Jacky Zhao
709ad94180 fix: toc for cyrillic and other non-latin alphabets (closes #396) 2023-08-22 22:41:50 -07:00
Jacky Zhao
460879df31 fix: tag support for non-latin alphabets (fixes #398) 2023-08-22 22:14:16 -07:00
a23f127c13 fixed broken CJK links (#390) 2023-08-22 09:16:55 -07:00
Jacky Zhao
f7c2fc36f3 improve path resolution stability 2023-08-19 16:28:44 -07:00
Jacky Zhao
303a867d60 base path refactor to better support subpath hosting 2023-08-19 15:52:25 -07:00
Jacky Zhao
cdaec963ed various path fixes for links to extensions, fix relative paths in links 2023-08-17 00:55:28 -07:00
Jacky Zhao
b5ab38cb7e fix relative path resolution in router and link crawling 2023-08-16 22:04:15 -07:00
Jacky Zhao
b6a3fa4f62 fix relative path resolution logic, add more path tests 2023-08-12 21:16:43 -07:00
Jacky Zhao
cdc8a4b7fe fmt 2023-08-12 10:17:07 -07:00
Jacky Zhao
fc5c8b4a94 enable rich text in callout title 2023-08-12 10:16:55 -07:00
Jacky Zhao
b62827a782 format, make search async 2023-08-12 00:03:11 -07:00
Jacky Zhao
5e7865d7e9 fix wikilinks to anchors in the same document 2023-08-11 23:55:17 -07:00
Jacky Zhao
85bb91d998 fix scanning for tags in content 2023-08-11 23:40:06 -07:00
Jacky Zhao
41f7de75a9 more documentation 2023-08-11 00:31:44 -07:00
Jacky Zhao
cf730e31fb docs on making plugins 2023-08-10 21:16:07 -07:00
Jacky Zhao
4e97695eee various css fixes, fix new image loading bug when previewing, path docs 2023-08-07 21:41:18 -07:00
Jacky Zhao
66e8afb008 fix shortest path for non-md files, mobile fix 2023-08-06 20:52:17 -07:00
Jacky Zhao
a58458a99e mobile fixes, fix bug when linking to anchor on home, docs 2023-08-06 17:09:29 -07:00
Jacky Zhao
6d2291bbf1 non-admonition callout fix 2023-08-05 16:43:50 -07:00
Jacky Zhao
9868c09f58 more robust error handling, config hotreload 2023-08-05 11:28:09 -07:00
Jacky Zhao
c307dce3a4 fix mermaid initialization 2023-08-04 22:35:21 -07:00
Jacky Zhao
ced82d2e09 format, add upstream 2023-08-03 23:08:04 -07:00
Jacky Zhao
a01301fb70 fix callout aliases not being used properly 2023-08-03 00:08:13 -07:00
Jacky Zhao
744955bc94 use posix style paths for all path ops 2023-08-02 23:04:26 -07:00
Jacky Zhao
159bf972c3 make path and globbing more platform invariant 2023-08-02 22:10:13 -07:00
Jacky Zhao
0b46a69a53 flag to allow ofm replace in html embed 2023-08-01 22:47:16 -07:00
Jacky Zhao
dfee2f3b6e nested tag support and tag index page 2023-07-25 21:10:37 -07:00
Jacky Zhao
74089b3057 actually add processed tag to frontmatter 2023-07-24 00:07:58 -07:00