diff --git a/app/web/src/components/EncodedUrl/ExternalScript.tsx b/app/web/src/components/EncodedUrl/ExternalScript.tsx index 510b4ce..536b7c5 100644 --- a/app/web/src/components/EncodedUrl/ExternalScript.tsx +++ b/app/web/src/components/EncodedUrl/ExternalScript.tsx @@ -63,7 +63,7 @@ const ExternalScript = () => { CadHub url for this resource.{' '} Learn more {' '} diff --git a/docs/docs/general-cadhub/external-resource-url.mdx b/docs/docs/general-cadhub/external-resource-url.mdx new file mode 100644 index 0000000..06fdb81 --- /dev/null +++ b/docs/docs/general-cadhub/external-resource-url.mdx @@ -0,0 +1,37 @@ +--- +title: External resoure URLs +--- + +import Image from '@theme/IdealImage'; + +import spaceDonut from '../../static/img/general-cadhub/space-donut.png'; +import openscadSelect from '../../static/img/getting-started/openscad-select.jpg'; +import externalScript1 from '../../static/img/general-cadhub/external-script-1.png'; +import externalScript2 from '../../static/img/general-cadhub/external-script-2.png'; + +CadHub allows you to generate a URL that links to a script hosted on an external URL. +The typical usecase for this as a CodeCad script hosted on github, this way the repo can continue to update and the link will stay up-to-date. +Any URL that returns the script as plain text will work. + +Here's how to use it using github as an example. +Find the file you want on Github, in this case ToastedIce's [space donut](https://github.com/toastedice/random_openscad_creations_I_made/blob/main/donut/spacedonut.scad). + + + +Copy the URL. + +Open the IDE for the Cad package to match your script, in this case OpenSCAD. + + + +Click the share button in the top right, then select the "external srcipt" tab. + + + +Paste in the Github URL. + + + +From there you can copy the generated URL, or "copy and Render" to check the script is working as intended. + +Here's the [URL](http://cadhub.xyz/dev-ide/cadQuery#fetch_text_v1=https%3A%2F%2Fraw.githubusercontent.com%2Ftoastedice%2Frandom_openscad_creations_I_made%2Fmain%2Fdonut%2Fspacedonut.scad) from this example. diff --git a/docs/sidebars.js b/docs/sidebars.js index bba91e2..a3ae8f9 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -27,5 +27,6 @@ module.exports = { 'round-anything/radii-conflict', ], }, + 'general-cadhub/external-resource-url' ], } diff --git a/docs/static/img/general-cadhub/external-script-1.png b/docs/static/img/general-cadhub/external-script-1.png new file mode 100644 index 0000000..6452e71 Binary files /dev/null and b/docs/static/img/general-cadhub/external-script-1.png differ diff --git a/docs/static/img/general-cadhub/external-script-2.png b/docs/static/img/general-cadhub/external-script-2.png new file mode 100644 index 0000000..aab3abb Binary files /dev/null and b/docs/static/img/general-cadhub/external-script-2.png differ diff --git a/docs/static/img/general-cadhub/space-donut.png b/docs/static/img/general-cadhub/space-donut.png new file mode 100644 index 0000000..6d4c59d Binary files /dev/null and b/docs/static/img/general-cadhub/space-donut.png differ