Skip to content

Commit

Permalink
refactor: migrate Tasklist API Explorer into versioned docs (#3569)
Browse files Browse the repository at this point in the history
* refactor: generalize the strategy for generating api docs, and implement zeebe as an example.

* docs: docs on docs for the new model of generating API explorers

* refactor: rewrite tasklist API Explorer generation to take advantage of new pipeline

* refactor: migrate tasklist REST API Explorer into v8.4 docs

* refactor: migrate alpha tasklist REST API Explorer into vNext docs

* cleanup: remove unused tasklist api docs

* cleanup: revert 'show correct version for Tasklist API Exlporer in navbar'

* refactor: remove API Explorer references from tasklist rest overview

* fix: broken links from moving the Tasklist API Explorer

* chore: redirect rules for moving the tasklist api explorer

* I changed my mind: put back the api explorer intro paragraph, send it to the new location

* feedback: move specs above migration in left nav
  • Loading branch information
pepopowitz authored Apr 4, 2024
1 parent a643c81 commit 73e6724
Show file tree
Hide file tree
Showing 36 changed files with 1,043 additions and 244 deletions.
2 changes: 2 additions & 0 deletions api/generate-api-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ const { execSync } = require("child_process");
// More strategies to come, for other APIs.
const operate = require("./operate/generation-strategy");
const zeebe = require("./zeebe/generation-strategy");
const tasklist = require("./tasklist/generation-strategy");
const apiStrategies = {
operate,
zeebe,
tasklist,
};

// Execute a command as if we were in the terminal
Expand Down
32 changes: 32 additions & 0 deletions api/tasklist/generation-strategy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const replace = require("replace-in-file");
const removeDuplicateVersionBadge = require("../remove-duplicate-version-badge");
const { makeServerDynamic } = require("../make-server-dynamic");

const outputDir = "docs/apis-tools/tasklist-api-rest/specifications";
const specFile = "api/tasklist/tasklist-openapi.yaml";

function preGenerateDocs() {
fixImproperlyFormattedBreaks();
makeServerDynamic(specFile);
}

function postGenerateDocs() {
removeDuplicateVersionBadge(`${outputDir}/tasklist-rest-api.info.mdx`);
}

module.exports = {
outputDir,
preGenerateDocs,
postGenerateDocs,
};

function fixImproperlyFormattedBreaks() {
// The source spec has many `<br>` tags in it, which is valid HTML,
// but docusaurus does not like it. Make them `<br/>` instead.
console.log("fixing break tags...");
replace.sync({
files: specFile,
from: /<br>/g,
to: "<br/>",
});
}
Loading

0 comments on commit 73e6724

Please sign in to comment.