Initial editor tabs implementation with CAD package guides #519
@@ -1,10 +1,10 @@
|
||||
import { extractMetaData } from 'src/helpers/markdown'
|
||||
import { useMarkdownMetaData } from 'src/helpers/markdown'
|
||||
import Editor from 'rich-markdown-editor'
|
||||
import { useRef } from 'react'
|
||||
import KeyValue from 'src/components/KeyValue/KeyValue'
|
||||
|
||||
export default function EditorGuide({ content }) {
|
||||
const [rawMetadata, metadata] = extractMetaData(content)
|
||||
const [rawMetadata, metadata] = useMarkdownMetaData(content)
|
||||
|
||||
const processedContent = rawMetadata
|
||||
? content.replace(rawMetadata[0], '')
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
|
||||
title: OpenSCAD
|
||||
Written with: Custom language
|
||||
Kernal type: BREP
|
||||
Maintained by: [Marius Kintel + 15 members](https://github.com/openscad)
|
||||
|
I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project. I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project.
I should add a `.md` file in `src/helpers/cadPackages` thats an explanation of how the integrations work, as there are more parts to it now as well.
Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still. Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.
|
||||
Maintained by: [Marius Kintel and contributors](https://github.com/openscad/openscad/graphs/contributors)
|
||||
|
I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project. I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project.
I should add a `.md` file in `src/helpers/cadPackages` thats an explanation of how the integrations work, as there are more parts to it now as well.
Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still. Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.
|
||||
Documentation: [openscad.org](https://openscad.org/)
|
||||
---
|
||||
OpenSCAD is a solid 3D modeler that enables the creation of parametric models using its scripting language. Models are created by utilizing a technique called constructive solid geometry. According to this technique, simple objects can be transformed and combined in order to create almost any complex model.
|
||||
@@ -1,29 +1,25 @@
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
// Extracts YAML frontmatter from Markdown files
|
||||
// Gotten from this helpful comment on a react-markdown GitHub Issue: https://github.com/remarkjs/react-markdown/issues/164#issuecomment-890497653
|
||||
export function useMarkdownMetaData(text: string): Array<any> {
|
||||
const metaData = {} as any
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
return React.useMemo(() => {
|
||||
const metaData = {} as any
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
/* ... */
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
const metaRegExp = RegExp(/^---[\r\n](((?!---).|[\r\n])*)[\r\n]---$/m) as any
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
// get metadata
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
const rawMetaData = metaRegExp.exec(text)
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
let keyValues
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
if (rawMetaData !== null) {
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
// rawMeta[1] are the stuff between "---"
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
keyValues = rawMetaData[1].split('\n')
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
// which returns a list of key values: ["key1: value", "key2: value"]
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
keyValues.forEach((keyValue) => {
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
// split each keyValue to keys and values
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
const [, key, value] = keyValue.split(/(.+): (.+)/)
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
metaData[key] = value.trim()
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
})
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
}
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
return [rawMetaData, metaData]
|
||||
}, [text])
|
||||
}
|
||||
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
const metaRegExp = RegExp(/^---[\r\n](((?!---).|[\r\n])*)[\r\n]---$/m)
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
// get metadata
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
const rawMetaData = metaRegExp.exec(text)
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
let keyValues
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
if (rawMetaData!) {
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
// rawMeta[1] are the stuff between "---"
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
keyValues = rawMetaData[1].split('\n')
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
// which returns a list of key values: ["key1: value", "key2: value"]
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
keyValues.forEach((keyValue) => {
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
// split each keyValue to keys and values
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
const [, key, value] = keyValue.split(/(.+): (.+)/)
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
metaData[key] = value.trim()
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
})
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
}
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
return [rawMetaData, metaData]
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
}
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
|
||||
|
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe Maybe this falls into the bucket of preemptive optimisations but I think it's okay since its not adding much more complexity or new patterns. Basically I'm not sure how expensive regular expressions can be to run over and over so might be best to play it safe
```suggestion
export function useMarkdownMetaData(text: string): Array<any> {
return React.useMemo(() => {
const metaData = {} as any
/* ... */
return [rawMetaData, metaData]
}, [text])
}
```
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful. Ah of course I hadn't thought of this rerendering a bunch of times! Thank you seems very helpful.
|
||||
I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project.
I should add a
.mdfile insrc/helpers/cadPackagesthats an explanation of how the integrations work, as there are more parts to it now as well.I think Torsten is the current maintainer, but am not sure. Probably a good starting point I guess ideally these files would be maintain by a person from each project.
I should add a
.mdfile insrc/helpers/cadPackagesthats an explanation of how the integrations work, as there are more parts to it now as well.Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.
Sweet I can ask him in Discord about the maintainer things, Marius was justed on the main site still.