Repository navigation
docs(sdks): Generate DOCX / PPTX example pages for JavaScript, TypeScript, Python, PHP and Ruby - #264
Draft
nicolasiscoding wants to merge 3 commits into
Draft
nicolasiscoding wants to merge 3 commits into
nicolasiscoding wants to merge 3 commits into
Conversation
…peScript, Python, PHP and Ruby One copy-paste example per language that fills a Word or PowerPoint template from a JSON file and saves the editable file and a PDF. Linked from the SDK overview and a new sidebar category.
…ipt / TypeScript tab correctly
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Developer searches such as "typescript docx integration", "javascript pptx sdk", "ruby pptx sdk" and "sdk for dynamic document generation" already show these docs on Google's first pages, but no page is built for them. This PR adds one example page per language that answers the query directly with a script you can copy and run.
New pages (sidebar: SDKs > Generate DOCX / PPTX examples, collapsed):
/docs/SDKs/generate-docx-pptx-javascript/docs/SDKs/generate-docx-pptx-typescript/docs/SDKs/generate-docx-pptx-python/docs/SDKs/generate-docx-pptx-php/docs/SDKs/generate-docx-pptx-rubyEach page uses the same flow: what you need (template, template ID from Developer Mode, credentials), install, environment variables, a
data.json, the full script, how to run it, what comes back, the fourmimeTypes, and next steps (Deliverable SDK reference on the right language tab, TurboSign hand-off by deliverable ID, REST API, the language setup page, and the matching www.turbodocx.com guide where there is one). The SDK overview (docs/SDKs/index.md) gets a short "Generate DOCX / PPTX examples" list under the Deliverable SDKs table.Query data comes from the Google Search Console mirror in our analytics warehouse (the direct Search Console API is unavailable today).
Ticket checklist
#255 (DOC-3) SDK example pages for doc-generation queries
turbodocx-sdkgem is published on RubyGems (0.9.0), so the page uses the gem rather than raw REST.Part of #255
Closes #263
Verification I ran
generateDeliverable/generate_deliverable,downloadSourceFile/download_source_file,downloadPDF/download_pdf,DeliverableConfig::fromEnvironment(),result.results.deliverable.id).tscstrict build then Node (TS), Python 3 venv, PHP 8.1 with Composer autoload, Ruby 3.0. Each one sent the expectedPOST /v1/deliverablebody (placeholders, text, mimeType), then wroteproposal.docxandproposal.pdffrom the two GET responses.npx tsc ... --strict --types nodecommand on the TypeScript page compiles the example.import { Deliverable } from "@turbodocx/sdk") works, since the JS page mentions it.index.mdwith@mdx-js/mdx(no stray{...}in prose; placeholders are in code spans). Frontmatter parsed with a YAML parser.sidebars.jsloads in Node.| TurboDocxsuffix (47 to 57). Meta descriptions are 143 to 154 characters. Each title starts with its target query. I did not force number-led titles, since these are developer reference pages.<title>s match the table above. With curl on the preview:<title>and the{ClientName}placeholders rendered as text..mdtwin returns 200text/markdownwith no em-dashes, andllms.txtlists all five./docs/SDKslinks to all five pages.#variable-types,#3-turbodocx-deliverable-idand#1-get-your-credentialsanchors exist on their target pages.Not verified
onBrokenLinks: 'ignore', and external links aren't checked anyway).Overlap with open PRs
docs/SDKs/index.md, in a different section. Expect at most a trivial rebase.sidebars.js. This PR adds a new category block after "Install & configure", so a conflict, if any, is a small one.docs/SDKs/agent-skills.mdamong SDK pages, plusdocusaurus.config.jsand the workflow. It does not touch these files.Owner questions
/docs/SDKs/deliverable-javascriptand/docs/SDKs/deliverable-rubyURLs still get impressions for "javascript pptx sdk" and "ruby pptx sdk". They currently 301 to the tabbed Deliverable page. Should they point at the new example pages instead? I left them alone.javascript.md,python.md, etc.) also link to their example page? I skipped this to avoid conflicts with Improve SDK documentation titles and discoverability #48, which edits those files.Independent review (follow-up commit 0f424aa)
Checked against primary sources:
origin/master. New free orgs gethasFileDownload: falseandhasPptx: false.GET /deliverable/file/:idis gated byhasFileDownload, andGET /deliverable/file/pdf/:idhas no feature gate.variableStackis on for free orgs, so no plan caveat is needed for it.node >=18; PyPIrequires_python >=3.9; Packagistphp ^8.1plusext-jsonandext-fileinfo; the gem needsruby >= 2.7.0, has no runtime dependencies and usesnet/http. PHPDeliverableConfig::fromEnvironment()readsgetenv('TURBODOCX_API_KEY')andgetenv('TURBODOCX_ORG_ID'). The gem'sgenerate_deliverableposts the request hash to/v1/deliverableas is.variableStack"table rows" wording and theimageURL/base64 wording all matchdocs/SDKs/developer-mode.mdanddocs/SDKs/deliverable.mdon develop.app/guides/generate-docx-from-json-with-{javascript,typescript,python,ruby}).Fixes:
@types/nodethe documented command failed (the SDK types themselves compile on 4.7 with--skipLibCheck). The page now says the install step adds TypeScript and the Node.js types.?language=jsopens the tab labelled "JavaScript / TypeScript". The wording now says that.Re-verified on preview https://90fad900.turbodocx-docs.pages.dev (run 40126104001, green, head 0f424aa): all five pages return 200. Each has one H1, a self-canonical to docs.turbodocx.com, no robots noindex and a single " | TurboDocx" suffix. All five are in
sitemap.xml, every/docs/...link on the five pages returns 200, and there are no em-dashes.Cannibalization: in the Search Console mirror (PostHog, 90 days to 2026-10-21) the target queries get very few impressions (about 10 to 21 each), spread across
/docs/SDKsand the olddeliverable-javascript/deliverable-rubyURLs. I see no meaningful overlap risk. Owner question 1 on those old redirects still stands.