From 99d8b62c97eba2bb1c757f48cd2a91c066409f18 Mon Sep 17 00:00:00 2001 From: Khai Do Date: Sun, 19 Jan 2014 08:59:00 -0800 Subject: [PATCH] Fix references to examples in api documentation The documentation displayed references to examples in the main docs but not in the corresponding api reference docs. The build had these warnings.. : WARNING: Include file u'/Users/khaido/workspace/jenkins-job-builder/doc/source/api/ ../../tests/properties/fixtures/batch-task.yaml' not found or reading it failed As pointed out by Darragh[1] the problem was that literalinclude needs a leading '/' to correctly reference both docs. [1] https://review.openstack.org/#/c/48783/15/jenkins_jobs/local_yaml.py Change-Id: Ib1f8ccca40af1ee54c2bd00b2b42ba39e3c0c8e5 --- jenkins_jobs/modules/builders.py | 2 +- jenkins_jobs/modules/properties.py | 2 +- jenkins_jobs/modules/publishers.py | 17 +++++++++-------- jenkins_jobs/modules/triggers.py | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/jenkins_jobs/modules/builders.py b/jenkins_jobs/modules/builders.py index 1474098ae..03e8f9ff6 100644 --- a/jenkins_jobs/modules/builders.py +++ b/jenkins_jobs/modules/builders.py @@ -740,7 +740,7 @@ def maven_target(parser, xml_parent, data): Example: - .. literalinclude:: ../../tests/builders/fixtures/maven-target-doc.yaml + .. literalinclude:: /../../tests/builders/fixtures/maven-target-doc.yaml """ maven = XML.SubElement(xml_parent, 'hudson.tasks.Maven') XML.SubElement(maven, 'targets').text = data['goals'] diff --git a/jenkins_jobs/modules/properties.py b/jenkins_jobs/modules/properties.py index 0bcb47710..eb485521b 100644 --- a/jenkins_jobs/modules/properties.py +++ b/jenkins_jobs/modules/properties.py @@ -451,7 +451,7 @@ def batch_tasks(parser, xml_parent, data): Example: - .. literalinclude:: ../../tests/properties/fixtures/batch-task.yaml + .. literalinclude:: /../../tests/properties/fixtures/batch-task.yaml """ pdef = XML.SubElement(xml_parent, diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 2ca3cd7a5..f9f0b7684 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -99,7 +99,7 @@ def emotional_jenkins(parser, xml_parent, data): Example: - .. literalinclude:: ../../tests/publishers/fixtures/emotional-jenkins.yaml + .. literalinclude:: /../../tests/publishers/fixtures/emotional-jenkins.yaml """ XML.SubElement(xml_parent, 'org.jenkinsci.plugins.emotional__jenkins.' @@ -288,11 +288,11 @@ def cloverphp(parser, xml_parent, data): Minimal example: - .. literalinclude:: ../../tests/publishers/fixtures/cloverphp001.yaml + .. literalinclude:: /../../tests/publishers/fixtures/cloverphp001.yaml Full example: - .. literalinclude:: ../../tests/publishers/fixtures/cloverphp002.yaml + .. literalinclude:: /../../tests/publishers/fixtures/cloverphp002.yaml """ cloverphp = XML.SubElement( @@ -1079,7 +1079,7 @@ def scp(parser, xml_parent, data): Example: - .. literalinclude:: ../../tests/publishers/fixtures/scp001.yaml + .. literalinclude:: /../../tests/publishers/fixtures/scp001.yaml """ site = data['site'] scp = XML.SubElement(xml_parent, @@ -1168,7 +1168,7 @@ def pipeline(parser, xml_parent, data): Example: - .. literalinclude:: ../../tests/publishers/fixtures/pipeline002.yaml + .. literalinclude:: /../../tests/publishers/fixtures/pipeline002.yaml You can build pipeline jobs that are re-usable in different pipelines by @@ -2977,7 +2977,7 @@ def github_notifier(parser, xml_parent, data): Example: - .. literalinclude:: ../../tests/publishers/fixtures/github-notifier.yaml + .. literalinclude:: /../../tests/publishers/fixtures/github-notifier.yaml """ XML.SubElement(xml_parent, 'com.cloudbees.jenkins.GitHubCommitNotifier') @@ -3047,7 +3047,7 @@ def stash(parser, xml_parent, data): Example: - .. literalinclude:: ../../tests/publishers/fixtures/stash001.yaml + .. literalinclude:: /../../tests/publishers/fixtures/stash001.yaml """ top = XML.SubElement(xml_parent, @@ -3082,7 +3082,8 @@ def description_setter(parser, xml_parent, data): Example: - .. literalinclude:: ../../tests/publishers/fixtures/description-setter.yaml + .. literalinclude:: + /../../tests/publishers/fixtures/description-setter.yaml """ diff --git a/jenkins_jobs/modules/triggers.py b/jenkins_jobs/modules/triggers.py index 1b887759e..bffcd08b3 100644 --- a/jenkins_jobs/modules/triggers.py +++ b/jenkins_jobs/modules/triggers.py @@ -363,7 +363,7 @@ def github_pull_request(parser, xml_parent, data): Example: - .. literalinclude:: ../../tests/triggers/fixtures/github-pull-request.yaml + .. literalinclude:: /../../tests/triggers/fixtures/github-pull-request.yaml """ ghprb = XML.SubElement(xml_parent, 'org.jenkinsci.plugins.ghprb.' 'GhprbTrigger')