diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/processOrg.tsx | 9 | ||||
-rw-r--r-- | util/uniorg.tsx | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/util/processOrg.tsx b/util/processOrg.tsx index ef75acf..189e980 100644 --- a/util/processOrg.tsx +++ b/util/processOrg.tsx @@ -44,6 +44,7 @@ export interface ProcessedOrgProps { outline: boolean collapse: boolean linksByNodeId: LinksByNodeId + macros?: { [key: string]: string } } export const ProcessedOrg = (props: ProcessedOrgProps) => { @@ -58,9 +59,8 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => { outline, collapse, linksByNodeId, + macros, } = props - console.log(linksByNodeId) - console.log(previewNode) if (!previewNode || !linksByNodeId) { return null } @@ -85,8 +85,6 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => { const linkEntries = Object.entries(nodesInNote) const wikiLinkResolver = (wikiLink: string): string[] => { const entry = linkEntries.find((idNodeArray) => { - console.log(idNodeArray) - console.log(wikiLink) return idNodeArray?.[1]?.title === wikiLink }) const id = entry?.[0] ?? '' @@ -117,6 +115,7 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => { const isMarkdown = previewNode?.file?.slice(-3) === '.md' const baseProcessor = isMarkdown ? mdProcessor : orgProcessor + console.log(macros) const processor = useMemo( () => baseProcessor @@ -126,6 +125,8 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => { '\\eqref': '\\href{###1}{(\\text{#1})}', '\\ref': '\\href{###1}{\\text{#1}}', '\\label': '\\htmlId{#1}{}', + // '\\weird': '\\textbf{#1}', + ...macros, }, }) .use(rehype2react, { diff --git a/util/uniorg.tsx b/util/uniorg.tsx index 7ffd3b8..68f0330 100644 --- a/util/uniorg.tsx +++ b/util/uniorg.tsx @@ -13,6 +13,7 @@ export interface UniOrgProps { outline: boolean collapse: boolean linksByNodeId: LinksByNodeId + macros?: { [key: string]: string } } export const UniOrg = (props: UniOrgProps) => { @@ -26,6 +27,7 @@ export const UniOrg = (props: UniOrgProps) => { outline, collapse, linksByNodeId, + macros, } = props const [previewText, setPreviewText] = useState('') @@ -67,6 +69,7 @@ export const UniOrg = (props: UniOrgProps) => { outline, collapse, linksByNodeId, + macros, }} /> )} |