@@ -317,6 +317,85 @@ Build detail
317
317
318
318
Some fields primarily used for UI elements in Read the Docs are omitted.
319
319
320
+
321
+ Embed
322
+ ~~~~~
323
+
324
+ .. http :get :: /api/v2/embed/
325
+
326
+ Retrieve HTML-formatted content from documentation page or section.
327
+
328
+ **Example request **:
329
+
330
+ .. prompt :: bash $
331
+
332
+ curl https://readthedocs.org/api/v2/embed/?project=docs&version=latest&doc=features&path=features.html
333
+
334
+ or
335
+
336
+ .. prompt :: bash $
337
+
338
+ curl https://readthedocs.org/api/v2/embed/?url=https://docs.readthedocs.io/en/latest/features.html
339
+
340
+ **Example response **:
341
+
342
+ .. sourcecode :: js
343
+
344
+ {
345
+ "content": [
346
+ "<div class=\" section\" id=\" read-the-docs-features\" >\n <h1>Read the Docs..."
347
+ ],
348
+ "headers": [
349
+ {
350
+ "Read the Docs features": "#"
351
+ },
352
+ {
353
+ "Automatic Documentation Deployment": "#automatic-documentation-deployment"
354
+ },
355
+ {
356
+ "Custom Domains & White Labeling": "#custom-domains-white-labeling"
357
+ },
358
+ {
359
+ "Versioned Documentation": "#versioned-documentation"
360
+ },
361
+ {
362
+ "Downloadable Documentation": "#downloadable-documentation"
363
+ },
364
+ {
365
+ "Full-Text Search": "#full-text-search"
366
+ },
367
+ {
368
+ "Open Source and Customer Focused": "#open-source-and-customer-focused"
369
+ }
370
+ ],
371
+ "url": "https://docs.readthedocs.io/en/latest/features",
372
+ "meta": {
373
+ "project": "docs",
374
+ "version": "latest",
375
+ "doc": "features",
376
+ "section": "read the docs features"
377
+ }
378
+ }
379
+
380
+ :>json string content: HTML content of the section.
381
+ :>json object headers: section's headers in the document.
382
+ :>json string url: URL of the document.
383
+ :>json object meta: meta data of the requested section.
384
+
385
+ :query string project: Read the Docs project's slug.
386
+ :query string doc: document to fetch content from.
387
+
388
+ :query string version: *optional * Read the Docs version's slug (default: ``latest ``).
389
+ :query string section: *optional * section within the document to fetch.
390
+ :query string path: *optional * full path to the document including extension.
391
+
392
+ :query string url: full URL of the document (and section) to fetch content from.
393
+
394
+ .. note ::
395
+
396
+ You can call this endpoint by sending at least ``project `` and ``doc `` *or * ``url `` attribute.
397
+
398
+
320
399
Undocumented resources and endpoints
321
400
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
322
401
0 commit comments