Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions website/patches/@signalwire+docusaurus-plugin-llms-txt+1.2.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js b/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js
index f35c2df..4d8b9bd 100644
--- a/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js
+++ b/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js
@@ -73,7 +73,7 @@ export class PluginRegistry {
}
// Always last - converts HTML AST to Markdown AST
processor.use(rehypeRemark, {
- handlers: { br: () => ({ type: 'html', value: '<br />' }) },
+ handlers: { br: () => ({ type: 'break' }) },
});
}
/**
13 changes: 12 additions & 1 deletion website/roa-loader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ const { inspect } = require('node:util');

const { urlToRequest } = require('loader-utils');

const SIGNING_TOKEN = process.env.APIFY_SIGNING_TOKEN;
const signingUrl = new URL('https://api.apify.com/v2/tools/encode-and-sign');
signingUrl.searchParams.set('token', process.env.APIFY_SIGNING_TOKEN);
signingUrl.searchParams.set('token', SIGNING_TOKEN || '');
const queue = [];
const cache = {};
let working = false;
let warnedAboutMissingToken = false;

function hash(source) {
return createHash('sha1').update(source).digest('hex');
Expand Down Expand Up @@ -89,6 +91,15 @@ module.exports = async function (code) {
return { code, hash: 'fast' };
}

// Skip signing if token is not configured
if (!SIGNING_TOKEN) {
if (!warnedAboutMissingToken) {
console.warn('APIFY_SIGNING_TOKEN is not set, skipping code signing for runnable examples.');
warnedAboutMissingToken = true;
}
return { code, hash: 'unsigned' };
}

console.log(`Signing ${urlToRequest(this.resourcePath)}...`, { working, queue: queue.length });
const codeHash = await encodeAndSign(code);
return { code, hash: codeHash };
Expand Down
3 changes: 2 additions & 1 deletion website/src/theme/DocItem/Content/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import BrowserOnly from '@docusaurus/BrowserOnly';
import { useDoc } from '@docusaurus/plugin-content-docs/client';
import LLMButtons from '@site/src/components/LLMButtons';
import Heading from '@theme/Heading';
Expand Down Expand Up @@ -26,7 +27,7 @@ export default function DocItemContent({ children }) {
{syntheticTitle && (
<div className={styles.docItemContent}>
{syntheticTitle && <Heading as="h1">{syntheticTitle}</Heading>}
<LLMButtons />
<BrowserOnly>{() => <LLMButtons />}</BrowserOnly>
</div>
)}
<MDXContent>{children}</MDXContent>
Expand Down
Loading