Replies: 6 comments 10 replies
-
Is there a script to easily rename all our .md files to .mdx since this is required in the upgrade? This will also need to rename all links since docusaurus has recommended we use filenames for links |
Beta Was this translation helpful? Give feedback.
-
Anyone get
normalization.mdtitle: Entity and Data Normalization
|
Beta Was this translation helpful? Give feedback.
-
Just linking in this issue here: #9081 (comment) I'd love to see a guide on how to migrate remark / rehype plugins to Docusaurus v3 / MDX v2 |
Beta Was this translation helpful? Give feedback.
-
Error: MDX compilation failed for file "/home/ntucker/src/rest-hooks/docs/graphql/api/validateRequired.md"
Cause: Expected a closing tag for `</summary>` (57:1-57:20) before the end of `paragraph`
Details:
{
"name": "57:1-57:55",
"message": "Expected a closing tag for `</summary>` (57:1-57:20) before the end of `paragraph`",
"reason": "Expected a closing tag for `</summary>` (57:1-57:20) before the end of `paragraph`",
"line": 57,
"column": 1,
"position": {
"start": {
"line": 57,
"column": 1,
"offset": 1389,
"_index": 0,
"_bufferIndex": 0
},
"end": {
"line": 57,
"column": 55,
"offset": 1443,
"_index": 1,
"_bufferIndex": -1
}
},
"source": "mdast-util-mdx-jsx",
"ruleId": "end-tag-mismatch"
} However the only 'summary' shows up as Also this is on line 61...so the line numbers are off? Site: https://github.com/data-client/rest-hooks in /website (using 'canary' to replace existing version of docusaurus) Full file below validateRequired.mdtitle: validateRequiredfunction validateRequired(processedEntity: any, requiredDefaults: Record<string, unknown>): string | undefined; Returns a string message if any keys of class CustomBaseEntity extends Entity {
static validate(processedEntity) {
return validateRequired(processedEntity, this.defaults) || super.validate(processedEntity);
}
} Partial/full resultsThis can be useful to automatically validate for partial results class SummaryAnalysis extends Entity {
readonly id: string = '';
readonly createdAt: Date = new Date(0);
readonly meanValue: number = 0;
readonly title: string = '';
pk() {
return this.id;
}
}
class FullAnalysis extends SummaryAnalysis {
readonly graph: number[] = [];
} Optional fieldsIn case we have a field that won't always be present (like class FullAnalysis extends SummaryAnalysis {
readonly graph: number[] = [];
readonly lastRun?: Date = new Date(0);
static schema = {
lastRun: Date,
}
static validate(processedEntity) {
return validateRequired(processedEntity, exclude(this.defaults, ['lastRun']));
}
} exclude()function exclude<O extends Record<string, unknown>>(
obj: O,
keys: string[],
): Partial<O> {
const r: any = {};
Object.keys(obj).forEach(k => {
if (!keys.includes(k)) r[k] = obj[k];
});
return r;
} Full results only have optional fieldsIn case every field of the 'full' resource was optional: class FullAnalysis extends SummaryAnalysis {
readonly graph?: number[] = [];
readonly lastRun?: Date = new Date(0);
static schema = {
lastRun: Date,
}
static validate(processedEntity) {
return validateRequired(processedEntity, exclude(this.defaults, ['graph', 'lastRun']));
}
} This code would not successfully know to fetch the 'full' resource if the summary is already provided. class FullAnalysis extends SummaryAnalysis {
readonly graph: number[] = null;
readonly lastRun?: Date = new Date(0);
static schema = {
lastRun: Date,
}
static validate(processedEntity) {
return validateRequired(processedEntity, exclude(this.defaults, ['lastRun']));
}
} This enables the client to understand whether the 'full' resource has been fetched at all. |
Beta Was this translation helpful? Give feedback.
-
Is a code block metastring not parsed anymore? For ```typescript title="api/Feed.ts" I get props of: {
className:"language-typescript"
metastring: "title=\"api/Feed.ts\""
} |
Beta Was this translation helpful? Give feedback.
-
I have problem
line How to change the line? |
Beta Was this translation helpful? Give feedback.
-
Docusaurus v3 will use MDX v3.
This is a breaking change that might require you to adjust your docs.
This GitHub discussion is a place to ask for help in case our migration notes are not enough, and you can't find a solution.
Other useful support links
Before asking for support
Before asking for support, make sure you:
To ask for support, please:
It's not scalable to provide done-for-you support for all Docusaurus users looking to upgrade. Any support request not respecting those constraints will possibly be ignored.
If you want help, you need to invest your own time so that helping you is easy.
Alternatively, you can look for a paid Docusaurus Service Provider to help you.
Beta Was this translation helpful? Give feedback.
All reactions