Skip to content

Commit

Permalink
[docs] revert pathPrefix prop for CodeExample
Browse files Browse the repository at this point in the history
  • Loading branch information
cmpadden committed Jan 6, 2025
1 parent 349096f commit b095366
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions docs/docs-beta/src/components/CodeExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ interface CodeExampleProps {
title?: string;
lineStart?: number;
lineEnd?: number;
pathPrefix?: string;
}

/**
Expand Down Expand Up @@ -92,17 +91,9 @@ const CodeExample: React.FC<CodeExampleProps> = ({...props}) => {
};

const CodeExampleInner: React.FC<CodeExampleProps> = (props) => {
const {
filePath,
title,
lineStart,
lineEnd,
language = 'python',
pathPrefix = 'docs_beta_snippets/docs_beta_snippets',
...extraProps
} = props;

const path = pathPrefix + '/' + filePath;
const {filePath, title, lineStart, lineEnd, language = 'python', ...extraProps} = props;

const path = 'docs_beta_snippets/docs_beta_snippets/' + filePath;
const cacheKey = JSON.stringify(props);
const {content, error} = useLoadModule(cacheKey, path, lineStart, lineEnd);

Expand Down

0 comments on commit b095366

Please sign in to comment.