From 5ab28fcdd0da8ce310df3c12fa1e5e3224347260 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 1 Jun 2020 18:52:15 +0200 Subject: [PATCH] Add generated Jenkins inline help pages --- .gitignore | 2 ++ content/_layouts/documentation.html.haml | 2 ++ content/_layouts/inlinehelp.html.haml | 23 ++++++++++++ content/doc/help/index.html.haml | 33 +++++++++++++++++ scripts/fetch-external-resources | 45 +++++++++++++++++++----- 5 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 content/_layouts/inlinehelp.html.haml create mode 100644 content/doc/help/index.html.haml diff --git a/.gitignore b/.gitignore index 05bf75430cbf..e938d2845fb5 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,8 @@ content/doc/pipeline/steps/*.adoc # generated extension points documentation content/doc/developer/extensions/*.adoc +# Jenkins built-in HTML help extracted from there +content/doc/help/jenkins-core/ # unknown /.sass-cache/ diff --git a/content/_layouts/documentation.html.haml b/content/_layouts/documentation.html.haml index cef1d913ac22..98a24e65352c 100644 --- a/content/_layouts/documentation.html.haml +++ b/content/_layouts/documentation.html.haml @@ -69,6 +69,8 @@ section: doc = active_href('doc/pipeline/steps', 'Pipeline Steps reference') %li = active_href('doc/upgrade-guide', 'LTS Upgrade guides', :fuzzy => true) + %li + = active_href('doc/help', 'Jenkins help pages', :fuzzy => true) .col-lg-9 - unless page.notitle diff --git a/content/_layouts/inlinehelp.html.haml b/content/_layouts/inlinehelp.html.haml new file mode 100644 index 000000000000..0df3e2ca1d47 --- /dev/null +++ b/content/_layouts/inlinehelp.html.haml @@ -0,0 +1,23 @@ +--- +layout: documentation +section: doc +title: Jenkins Help +uneditable: true +--- + +%a{:href => '/doc/help'} + Back to index + +%div.admonitionblock.note + %table + %tr + %td.icon + %div.title + Note + %td.content + This page is generated from Jenkins inline help intended to be rendered within the Jenkins UI. + Some minor content glitches are expected. + +%hr/ + += page.content diff --git a/content/doc/help/index.html.haml b/content/doc/help/index.html.haml new file mode 100644 index 000000000000..395aa471aa02 --- /dev/null +++ b/content/doc/help/index.html.haml @@ -0,0 +1,33 @@ +--- +layout: documentation +section: doc +title: Jenkins Help +--- + +%div.admonitionblock.note + %table + %tr + %td.icon + %div.title + Note + %td.content + These are inline help pages extracted from Jenkins and made available here for easy linking. + Some minor content glitches are expected. + +%hr/ + + + +:ruby + html_pages = [] + site.pages.each do |page| + next if page.layout.nil? + next unless page.layout == 'inlinehelp' + html_pages << page + end + +%ul + - html_pages.sort { |x, y| File.basename(File.dirname(x.url)) <=> File.basename(File.dirname(y.url)) }.each do |page| + %li + %a{ :href => page.url } + = "#{File.basename(File.dirname(page.url))} ยป #{File.basename(page.url)}" diff --git a/scripts/fetch-external-resources b/scripts/fetch-external-resources index 52cfac87fa1d..3abcc1190568 100755 --- a/scripts/fetch-external-resources +++ b/scripts/fetch-external-resources @@ -18,43 +18,57 @@ RESOURCES = [ 'https://updates.jenkins.io/latestCore.txt', 'content/_tmp/latestCore.txt', nil, + nil, nil ], [ 'https://updates.jenkins.io/stable/latestCore.txt', 'content/_tmp/latestLTSCore.txt', nil, + nil, nil ], [ 'https://github.com/jenkinsci/pipeline-examples/archive/master.zip', 'content/_tmp/pipeline-examples-master.zip', nil, - 'content/_tmp/examples' + 'content/_tmp/examples', + nil ], [ 'https://ci.jenkins.io/job/Infra/job/pipeline-steps-doc-generator/job/master/lastSuccessfulBuild/artifact/allAscii.zip', 'content/_tmp/allAscii.zip', nil, - 'content/doc/pipeline/steps' + 'content/doc/pipeline/steps', + nil ], [ 'https://repo.jenkins-ci.org/api/search/versions?g=org.jenkins-ci.main&a=jenkins-core&repos=releases&v=?.*.1', 'content/_data/_generated/lts_baselines.yml', nil, + nil, nil ], [ 'https://updates.jenkins.io/update-center.actual.json', 'content/_data/_generated/update_center.yml', nil, + nil, nil ], [ 'https://ci.jenkins.io/job/Infra/job/backend-extension-indexer/job/master/lastSuccessfulBuild/artifact/*.adoc/*zip*/extension-indexer.zip', 'content/_tmp/extension-indexer.zip', nil, - 'content/doc/developer/extensions' + 'content/doc/developer/extensions', + nil + ], + [ + 'https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-core/2.222.4/jenkins-core-2.222.4.jar', # TODO figure out how to identify the latest release and download that + 'content/_tmp/jenkins-core.zip', + { "layout": "inlinehelp" }, + 'content/doc/help/jenkins-core', + /.+(?