From d80d0abc46332915a40e6ffbe49cd4c7bea54e9f Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 20 Aug 2024 14:53:10 -0700 Subject: [PATCH 01/14] feat: add doctum shared workflow for reference docs generation --- .github/workflows/docs.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..5556c35e71 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,21 @@ +name: Generate Documentation +on: + push: + tags: + - "*" + workflow_dispatch: + inputs: + tag: + description: 'Tag to release' + required: true + +permissions: + contents: write + +jobs: + docs: + name: "Generate and Deploy Documentation" + uses: GoogleCloudPlatform/php-tools/.github/workflows/doctum.yml@doctum + with: + title: "Google Cloud PHP Client Services" + tag: ${{ inputs.tag }} From 9f70a61d8be1aa9fc54a576f9cff9a3eabf6c8a5 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 20 Aug 2024 15:10:28 -0700 Subject: [PATCH 02/14] run in pull requests --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5556c35e71..41ac11c50b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,6 +3,7 @@ on: push: tags: - "*" + pull_request: workflow_dispatch: inputs: tag: From 87c78b62549957156b402e489c56f918eb6ced7a Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 20 Aug 2024 15:12:17 -0700 Subject: [PATCH 03/14] remove pull_request trigger --- .github/workflows/docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 41ac11c50b..5556c35e71 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,6 @@ on: push: tags: - "*" - pull_request: workflow_dispatch: inputs: tag: From fc53257312e9406a9cffe9419c1c922dd4b67fca Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 20 Aug 2024 15:52:23 -0700 Subject: [PATCH 04/14] update doctum inputs --- .github/workflows/docs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5556c35e71..5ca0e216bf 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,8 +6,7 @@ on: workflow_dispatch: inputs: tag: - description: 'Tag to release' - required: true + description: 'default tag for documentation' permissions: contents: write @@ -18,4 +17,5 @@ jobs: uses: GoogleCloudPlatform/php-tools/.github/workflows/doctum.yml@doctum with: title: "Google Cloud PHP Client Services" - tag: ${{ inputs.tag }} + default_tag: ${{ inputs.tag }} + tag_pattern: false From f413347268475098c04bc9d2d1e89a030c974c3c Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 20 Aug 2024 15:55:14 -0700 Subject: [PATCH 05/14] fix tag pattern --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5ca0e216bf..17be49d22f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,4 +18,4 @@ jobs: with: title: "Google Cloud PHP Client Services" default_tag: ${{ inputs.tag }} - tag_pattern: false + tag_pattern: '' From 8f1f927eb514de71b1d8dc42e1bf48b9653576c5 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 21 Aug 2024 11:29:27 -0700 Subject: [PATCH 06/14] add custom theme --- .../doctum/apiclient-services/doctum.js.twig | 353 ++++++++++++++++++ .github/doctum/apiclient-services/macros.twig | 17 + .../doctum/apiclient-services/manifest.yml | 5 + .github/workflows/docs.yml | 2 + 4 files changed, 377 insertions(+) create mode 100644 .github/doctum/apiclient-services/doctum.js.twig create mode 100644 .github/doctum/apiclient-services/macros.twig create mode 100644 .github/doctum/apiclient-services/manifest.yml diff --git a/.github/doctum/apiclient-services/doctum.js.twig b/.github/doctum/apiclient-services/doctum.js.twig new file mode 100644 index 0000000000..d4a0f24383 --- /dev/null +++ b/.github/doctum/apiclient-services/doctum.js.twig @@ -0,0 +1,353 @@ +var Doctum = { + treeJson: {{ tree|raw }}, + {% verbatim -%} + /** @var boolean */ + treeLoaded: false, + /** @var boolean */ + listenersRegistered: false, + autoCompleteData: null, + /** @var boolean */ + autoCompleteLoading: false, + /** @var boolean */ + autoCompleteLoaded: false, + /** @var string|null */ + rootPath: null, + /** @var string|null */ + autoCompleteDataUrl: null, + /** @var HTMLElement|null */ + doctumSearchAutoComplete: null, + /** @var HTMLElement|null */ + doctumSearchAutoCompleteProgressBarContainer: null, + /** @var HTMLElement|null */ + doctumSearchAutoCompleteProgressBar: null, + /** @var number */ + doctumSearchAutoCompleteProgressBarPercent: 0, + /** @var autoComplete|null */ + autoCompleteJS: null, + querySearchSecurityRegex: /([^0-9a-zA-Z:\\\\_\s])/gi, + buildTreeNode: function (treeNode, htmlNode, treeOpenLevel) { + var ulNode = document.createElement('ul'); + for (var childKey in treeNode.c) { + var child = treeNode.c[childKey]; + var liClass = document.createElement('li'); + var hasChildren = child.hasOwnProperty('c'); + var nodeSpecialName = (hasChildren ? 'namespace:' : 'class:') + child.p.replace(/\//g, '_'); + liClass.setAttribute('data-name', nodeSpecialName); + + // Create the node that will have the text + var divHd = document.createElement('div'); + var levelCss = child.l - 1; + divHd.className = hasChildren ? 'hd' : 'hd leaf'; + divHd.style.paddingLeft = (hasChildren ? (levelCss * 18) : (8 + (levelCss * 18))) + 'px'; + if (hasChildren) { + if (child.l <= treeOpenLevel) { + liClass.className = 'opened'; + } + var spanIcon = document.createElement('span'); + spanIcon.className = 'icon icon-play'; + divHd.appendChild(spanIcon); + } + var aLink = document.createElement('a'); + + // Edit the HTML link to work correctly based on the current depth + aLink.href = Doctum.rootPath + child.p + (hasChildren ? '.ns.html' : '.html'); + aLink.innerText = child.n; + divHd.appendChild(aLink); + liClass.appendChild(divHd); + + // It has children + if (hasChildren) { + var divBd = document.createElement('div'); + divBd.className = 'bd'; + Doctum.buildTreeNode(child, divBd, treeOpenLevel); + liClass.appendChild(divBd); + } + ulNode.appendChild(liClass); + } + htmlNode.appendChild(ulNode); + }, + initListeners: function () { + if (Doctum.listenersRegistered) { + // Quick exit, already registered + return; + } + {% endverbatim -%} + {% if project.versions|length > 1 %} + {# Enable the version switcher #} + var versionSwitcher = document.getElementById('version-switcher'); + if (versionSwitcher !== null) { + var currentVersion = versionSwitcher.options[versionSwitcher.selectedIndex].dataset.version; + versionSwitcher.addEventListener('change', function (event) { + var targetVersion = event.target.options[event.target.selectedIndex].dataset.version; + var candidateUrl = window.location.pathname.replace(currentVersion, targetVersion); + // Check if the page exists before redirecting to it + var testRequest = new XMLHttpRequest(); + testRequest.open('HEAD', candidateUrl, false); + testRequest.send(); + if (testRequest.status < 200 || testRequest.status > 399) { + window.location = candidateUrl; + } else { + // otherwise reroute to the home page of the new version + window.location = this.value; + } + }); + } + {% endif %} + {% verbatim -%} + Doctum.listenersRegistered = true; + }, + loadTree: function () { + if (Doctum.treeLoaded) { + // Quick exit, already registered + return; + } + Doctum.rootPath = document.body.getAttribute('data-root-path'); + Doctum.buildTreeNode(Doctum.treeJson.tree, document.getElementById('api-tree'), Doctum.treeJson.treeOpenLevel); + + // Toggle left-nav divs on click + $('#api-tree .hd span').on('click', function () { + $(this).parent().parent().toggleClass('opened'); + }); + + // Expand the parent namespaces of the current page. + var expected = $('body').attr('data-name'); + + if (expected) { + // Open the currently selected node and its parents. + var container = $('#api-tree'); + var node = $('#api-tree li[data-name="' + expected + '"]'); + // Node might not be found when simulating namespaces + if (node.length > 0) { + node.addClass('active').addClass('opened'); + node.parents('li').addClass('opened'); + var scrollPos = node.offset().top - container.offset().top + container.scrollTop(); + // Position the item nearer to the top of the screen. + scrollPos -= 200; + container.scrollTop(scrollPos); + } + } + Doctum.treeLoaded = true; + }, + pagePartiallyLoaded: function (event) { + Doctum.initListeners(); + Doctum.loadTree(); + Doctum.loadAutoComplete(); + }, + pageFullyLoaded: function (event) { + // it may not have received DOMContentLoaded event + Doctum.initListeners(); + Doctum.loadTree(); + Doctum.loadAutoComplete(); + // Fire the event in the search page too + if (typeof DoctumSearch === 'object') { + DoctumSearch.pageFullyLoaded(); + } + }, + loadAutoComplete: function () { + if (Doctum.autoCompleteLoaded) { + // Quick exit, already loaded + return; + } + Doctum.autoCompleteDataUrl = document.body.getAttribute('data-search-index-url'); + Doctum.doctumSearchAutoComplete = document.getElementById('doctum-search-auto-complete'); + Doctum.doctumSearchAutoCompleteProgressBarContainer = document.getElementById('search-progress-bar-container'); + Doctum.doctumSearchAutoCompleteProgressBar = document.getElementById('search-progress-bar'); + if (Doctum.doctumSearchAutoComplete !== null) { + // Wait for it to be loaded + Doctum.doctumSearchAutoComplete.addEventListener('init', function (_) { + Doctum.autoCompleteLoaded = true; + Doctum.doctumSearchAutoComplete.addEventListener('selection', function (event) { + // Go to selection page + window.location = Doctum.rootPath + event.detail.selection.value.p; + }); + Doctum.doctumSearchAutoComplete.addEventListener('navigate', function (event) { + // Set selection in text box + if (typeof event.detail.selection.value === 'object') { + Doctum.doctumSearchAutoComplete.value = event.detail.selection.value.n; + } + }); + Doctum.doctumSearchAutoComplete.addEventListener('results', function (event) { + Doctum.markProgressFinished(); + }); + }); + } + // Check if the lib is loaded + if (typeof autoComplete === 'function') { + Doctum.bootAutoComplete(); + } + }, + markInProgress: function () { + Doctum.doctumSearchAutoCompleteProgressBarContainer.className = 'search-bar'; + Doctum.doctumSearchAutoCompleteProgressBar.className = 'progress-bar indeterminate'; + if (typeof DoctumSearch === 'object' && DoctumSearch.pageFullyLoaded) { + DoctumSearch.doctumSearchPageAutoCompleteProgressBarContainer.className = 'search-bar'; + DoctumSearch.doctumSearchPageAutoCompleteProgressBar.className = 'progress-bar indeterminate'; + } + }, + markProgressFinished: function () { + Doctum.doctumSearchAutoCompleteProgressBarContainer.className = 'search-bar hidden'; + Doctum.doctumSearchAutoCompleteProgressBar.className = 'progress-bar'; + if (typeof DoctumSearch === 'object' && DoctumSearch.pageFullyLoaded) { + DoctumSearch.doctumSearchPageAutoCompleteProgressBarContainer.className = 'search-bar hidden'; + DoctumSearch.doctumSearchPageAutoCompleteProgressBar.className = 'progress-bar'; + } + }, + makeProgess: function () { + Doctum.makeProgressOnProgressBar( + Doctum.doctumSearchAutoCompleteProgressBarPercent, + Doctum.doctumSearchAutoCompleteProgressBar + ); + if (typeof DoctumSearch === 'object' && DoctumSearch.pageFullyLoaded) { + Doctum.makeProgressOnProgressBar( + Doctum.doctumSearchAutoCompleteProgressBarPercent, + DoctumSearch.doctumSearchPageAutoCompleteProgressBar + ); + } + }, + loadAutoCompleteData: function (query) { + return new Promise(function (resolve, reject) { + if (Doctum.autoCompleteData !== null) { + resolve(Doctum.autoCompleteData); + return; + } + Doctum.markInProgress(); + function reqListener() { + Doctum.autoCompleteLoading = false; + Doctum.autoCompleteData = JSON.parse(this.responseText).items; + Doctum.markProgressFinished(); + + setTimeout(function () { + resolve(Doctum.autoCompleteData); + }, 50);// Let the UI render once before sending the results for processing. This gives time to the progress bar to hide + } + function reqError(err) { + Doctum.autoCompleteLoading = false; + Doctum.autoCompleteData = null; + console.error(err); + reject(err); + } + + var oReq = new XMLHttpRequest(); + oReq.onload = reqListener; + oReq.onerror = reqError; + oReq.onprogress = function (pe) { + if (pe.lengthComputable) { + Doctum.doctumSearchAutoCompleteProgressBarPercent = parseInt(pe.loaded / pe.total * 100, 10); + Doctum.makeProgess(); + } + }; + oReq.onloadend = function (_) { + Doctum.markProgressFinished(); + }; + oReq.open('get', Doctum.autoCompleteDataUrl, true); + oReq.send(); + }); + }, + /** + * Make some progress on a progress bar + * + * @param number percentage + * @param HTMLElement progressBar + * @return void + */ + makeProgressOnProgressBar: function(percentage, progressBar) { + progressBar.className = 'progress-bar'; + progressBar.style.width = percentage + '%'; + progressBar.setAttribute( + 'aria-valuenow', percentage + ); + }, + searchEngine: function (query, record) { + if (typeof query !== 'string') { + return ''; + } + // replace all (mode = g) spaces and non breaking spaces (\s) by pipes + // g = global mode to mark also the second word searched + // i = case insensitive + // how this function works: + // First: search if the query has the keywords in sequence + // Second: replace the keywords by a mark and leave all the text in between non marked + {% endverbatim -%} + {# + Case 1: search for "net sample" + Data: net_sample + Result net_sample + Case 1: search for "n t sa" + Data: net_sample, ample, glamples, notDateSa + Result net_sample, notDateSa + #} + {%- verbatim %} + if (record.match(new RegExp('(' + query.replace(/\s/g, ').*(') + ')', 'gi')) === null) { + return '';// Does not match + } + + var replacedRecord = record.replace(new RegExp('(' + query.replace(/\s/g, '|') + ')', 'gi'), function (group) { + return '' + group + ''; + }); + + if (replacedRecord !== record) { + return replacedRecord;// This should not happen but just in case there was no match done + } + + return ''; + }, + /** + * Clean the search query + * + * @param string|null query + * @return string + */ + cleanSearchQuery: function (query) { + if (typeof query !== 'string') { + return ''; + } + // replace any chars that could lead to injecting code in our regex + // remove start or end spaces + // replace backslashes by an escaped version, use case in search: \myRootFunction + return query.replace(Doctum.querySearchSecurityRegex, '').trim().replace(/\\/g, '\\\\'); + }, + bootAutoComplete: function () { + Doctum.autoCompleteJS = new autoComplete( + { + selector: '#doctum-search-auto-complete', + searchEngine: function (query, record) { + return Doctum.searchEngine(query, record); + }, + submit: true, + data: { + src: function (q) { + Doctum.markInProgress(); + return Doctum.loadAutoCompleteData(q); + }, + keys: ['n'],// Data 'Object' key to be searched + cache: false, // Is not compatible with async fetch of data + }, + query: (input) => { + return Doctum.cleanSearchQuery(input); + }, + trigger: (query) => { + return Doctum.cleanSearchQuery(query).length > 0; + }, + resultsList: { + tag: 'ul', + class: 'auto-complete-dropdown-menu', + destination: '#auto-complete-results', + position: 'afterbegin', + maxResults: 500, + noResults: false, + }, + resultItem: { + tag: 'li', + class: 'auto-complete-result', + highlight: 'auto-complete-highlight', + selected: 'auto-complete-selected' + }, + } + ); + } +}; + + +document.addEventListener('DOMContentLoaded', Doctum.pagePartiallyLoaded, false); +window.addEventListener('load', Doctum.pageFullyLoaded, false); +{% endverbatim -%} diff --git a/.github/doctum/apiclient-services/macros.twig b/.github/doctum/apiclient-services/macros.twig new file mode 100644 index 0000000000..65d200f311 --- /dev/null +++ b/.github/doctum/apiclient-services/macros.twig @@ -0,0 +1,17 @@ +{% extends "default/macros.twig" %} + +{% macro namespace_link(namespace) -%} + {{ namespace == '' ? global_namespace_name() : namespace|raw }} +{%- endmacro %} + +{% macro breadcrumbs(namespace) %} + {% set current_ns = '' %} + {% for ns in namespace|split('\\') %} + {%- if current_ns -%} + {% set current_ns = current_ns ~ '\\' ~ ns %} + {%- else -%} + {% set current_ns = ns %} + {%- endif -%} +
  • {{ ns|raw }}
  • \
  • + {%- endfor %} +{% endmacro %} diff --git a/.github/doctum/apiclient-services/manifest.yml b/.github/doctum/apiclient-services/manifest.yml new file mode 100644 index 0000000000..fc2b508e04 --- /dev/null +++ b/.github/doctum/apiclient-services/manifest.yml @@ -0,0 +1,5 @@ +name: apiclient-services +parent: default + +namespace: + 'namespace.twig': '%s.ns.html' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 17be49d22f..cff75be380 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,5 +17,7 @@ jobs: uses: GoogleCloudPlatform/php-tools/.github/workflows/doctum.yml@doctum with: title: "Google Cloud PHP Client Services" + theme: 'apiclient-services' default_tag: ${{ inputs.tag }} tag_pattern: '' + From 7efd966a536347753cfa4aeb10d91cfe523ce7e1 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 21 Aug 2024 13:01:44 -0700 Subject: [PATCH 07/14] add tag pattern --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cff75be380..a78cdedd23 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,5 +19,5 @@ jobs: title: "Google Cloud PHP Client Services" theme: 'apiclient-services' default_tag: ${{ inputs.tag }} - tag_pattern: '' + tag_pattern: 'doctum' From 27b6f48d12744d5c30525328b60d83415b720591 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 21 Aug 2024 14:00:58 -0700 Subject: [PATCH 08/14] remove tag pattern --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a78cdedd23..cff75be380 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,5 +19,5 @@ jobs: title: "Google Cloud PHP Client Services" theme: 'apiclient-services' default_tag: ${{ inputs.tag }} - tag_pattern: 'doctum' + tag_pattern: '' From 84b755b6810d246bd0e93550e4129d0b2fedb353 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 21 Aug 2024 14:04:04 -0700 Subject: [PATCH 09/14] set default version --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cff75be380..31843aff06 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,6 +18,6 @@ jobs: with: title: "Google Cloud PHP Client Services" theme: 'apiclient-services' - default_tag: ${{ inputs.tag }} + default_version: ${{ inputs.tag || 'master'}} tag_pattern: '' From 5e599ae0589b97110915f0ee4281dcd02c84452d Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Wed, 21 Aug 2024 15:31:07 -0700 Subject: [PATCH 10/14] add README / comments --- .github/workflows/docs.yml | 5 ++++- README.md | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 31843aff06..f7de4057bb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,7 +17,10 @@ jobs: uses: GoogleCloudPlatform/php-tools/.github/workflows/doctum.yml@doctum with: title: "Google Cloud PHP Client Services" + # use a custom theme so that namespaces that share the same name as classes + # are not overwritten (we use ".ns.html" for namspaces to avoid this conflict + # in our theme) + # @see .github/doctum/apiclient-services theme: 'apiclient-services' default_version: ${{ inputs.tag || 'master'}} tag_pattern: '' - diff --git a/README.md b/README.md index b0bb0df274..8dcf29603b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Google PHP API Client Services ============================== +[Reference Documentation](https://googleapis.github.io/google-api-php-client-services) + **NOTE**: please check to see if the package you'd like to install is available in our list of [Google cloud packages](https://cloud.google.com/php/docs/reference) first, as these are the recommended libraries. @@ -12,6 +14,6 @@ these are the recommended libraries. ## Usage This library is automatically updated daily with new API changes, and tagged weekly. -It is installed as part of the +It is installed as part of the [Google API PHP Client](https://github.com/googleapis/google-api-php-client/releases) library via Composer, which will pull down the most recent tag. From 74e791911f5ed7861bf34ec3d793b29baa481543 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Mon, 26 Aug 2024 10:53:39 -0700 Subject: [PATCH 11/14] Update .github/workflows/docs.yml --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f7de4057bb..81c01dcc5a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,7 +14,7 @@ permissions: jobs: docs: name: "Generate and Deploy Documentation" - uses: GoogleCloudPlatform/php-tools/.github/workflows/doctum.yml@doctum + uses: GoogleCloudPlatform/php-tools/.github/workflows/doctum.yml@main with: title: "Google Cloud PHP Client Services" # use a custom theme so that namespaces that share the same name as classes From 3ee362639e188897485260324741dd3ca8c46efb Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Mon, 26 Aug 2024 11:32:11 -0700 Subject: [PATCH 12/14] Update .github/doctum/apiclient-services/doctum.js.twig --- .github/doctum/apiclient-services/doctum.js.twig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/doctum/apiclient-services/doctum.js.twig b/.github/doctum/apiclient-services/doctum.js.twig index d4a0f24383..3adf621a31 100644 --- a/.github/doctum/apiclient-services/doctum.js.twig +++ b/.github/doctum/apiclient-services/doctum.js.twig @@ -1,3 +1,6 @@ +{# This template was copied from the main Doctum repo and extended to add #} +{# a custom path for namespace files (e.g. `[NAMESPACE].ns.twig` #} +{# @see https://github.com/code-lts/doctum/blob/main/src/Resources/themes/default/doctum.js.twig #} var Doctum = { treeJson: {{ tree|raw }}, {% verbatim -%} From 5075efd7707938dc6cb97bb70f9fd9d75eed29e6 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Mon, 26 Aug 2024 11:33:03 -0700 Subject: [PATCH 13/14] Update .github/doctum/apiclient-services/doctum.js.twig --- .github/doctum/apiclient-services/doctum.js.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/doctum/apiclient-services/doctum.js.twig b/.github/doctum/apiclient-services/doctum.js.twig index 3adf621a31..06a4177952 100644 --- a/.github/doctum/apiclient-services/doctum.js.twig +++ b/.github/doctum/apiclient-services/doctum.js.twig @@ -1,5 +1,5 @@ -{# This template was copied from the main Doctum repo and extended to add #} -{# a custom path for namespace files (e.g. `[NAMESPACE].ns.twig` #} +{# This template was copied from the main Doctum repo and extended to #} +{# add a custom path for namespace files (e.g. `[NAMESPACE].ns.twig`) #} {# @see https://github.com/code-lts/doctum/blob/main/src/Resources/themes/default/doctum.js.twig #} var Doctum = { treeJson: {{ tree|raw }}, From 94c7a473158c2290e7e075dde6e4cfda43e4f9f0 Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Mon, 26 Aug 2024 14:07:28 -0700 Subject: [PATCH 14/14] Update .github/doctum/apiclient-services/doctum.js.twig --- .github/doctum/apiclient-services/doctum.js.twig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/doctum/apiclient-services/doctum.js.twig b/.github/doctum/apiclient-services/doctum.js.twig index 06a4177952..e5352d322f 100644 --- a/.github/doctum/apiclient-services/doctum.js.twig +++ b/.github/doctum/apiclient-services/doctum.js.twig @@ -53,7 +53,9 @@ var Doctum = { var aLink = document.createElement('a'); // Edit the HTML link to work correctly based on the current depth + {# BEGIN custom code for "apiclient-services" template #} aLink.href = Doctum.rootPath + child.p + (hasChildren ? '.ns.html' : '.html'); + {# END custom code for "apiclient-services" template #} aLink.innerText = child.n; divHd.appendChild(aLink); liClass.appendChild(divHd);