summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorHuynh Tan <[email protected]>2022-06-30 15:52:03 +0700
committerHuynh Tan <[email protected]>2022-06-30 15:52:03 +0700
commit11111bb49889feb1b00e6814d9d81e3e23409d7c (patch)
tree34abd3ac10a1112baaea318cf5e38eabe33acb0a /util
parent94b543c1d28743f85bee2342609ff2019f7ec7d8 (diff)
Read useInheritance from emacs config
Diffstat (limited to 'util')
-rw-r--r--util/processOrg.tsx5
-rw-r--r--util/uniorg.tsx3
-rw-r--r--util/variablesContext.tsx1
3 files changed, 8 insertions, 1 deletions
diff --git a/util/processOrg.tsx b/util/processOrg.tsx
index 611c039..ea868ee 100644
--- a/util/processOrg.tsx
+++ b/util/processOrg.tsx
@@ -50,6 +50,7 @@ export interface ProcessedOrgProps {
linksByNodeId: LinksByNodeId
macros: { [key: string]: string } | {}
attachDir: string
+ useInheritance: boolean
}
export const ProcessedOrg = (props: ProcessedOrgProps) => {
@@ -66,6 +67,7 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => {
linksByNodeId,
macros,
attachDir,
+ useInheritance,
} = props
if (!previewNode || !linksByNodeId) {
@@ -77,7 +79,7 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => {
.use(extractKeywords)
.use(attachments, {
idDir: attachDir || undefined,
- useInheritance: true,
+ useInheritance,
})
.use(uniorgSlug)
.use(uniorg2rehype, { useSections: true })
@@ -157,6 +159,7 @@ export const ProcessedOrg = (props: ProcessedOrgProps) => {
isWiki={isMarkdown}
macros={macros}
attachDir={attachDir}
+ useInheritance={useInheritance}
>
{children}
</PreviewLink>
diff --git a/util/uniorg.tsx b/util/uniorg.tsx
index 6580b9c..4172d7a 100644
--- a/util/uniorg.tsx
+++ b/util/uniorg.tsx
@@ -15,6 +15,7 @@ export interface UniOrgProps {
linksByNodeId: LinksByNodeId
macros?: { [key: string]: string }
attachDir: string
+ useInheritance: boolean
}
export const UniOrg = (props: UniOrgProps) => {
@@ -30,6 +31,7 @@ export const UniOrg = (props: UniOrgProps) => {
linksByNodeId,
macros,
attachDir,
+ useInheritance,
} = props
const [previewText, setPreviewText] = useState('')
@@ -72,6 +74,7 @@ export const UniOrg = (props: UniOrgProps) => {
collapse,
linksByNodeId,
attachDir,
+ useInheritance,
}}
macros={macros || {}}
/>
diff --git a/util/variablesContext.tsx b/util/variablesContext.tsx
index 5fd34b8..f6d2356 100644
--- a/util/variablesContext.tsx
+++ b/util/variablesContext.tsx
@@ -6,6 +6,7 @@ type Theme = [name: string, themeObject: { [color: string]: string }]
const VariablesContext = createContext<EmacsVariables>({
subDirs: ['dailies', '.attach'],
attachDir: '.attach',
+ useInheritance: false,
roamDir: '~/org',
dailyDir: 'dailies',
})