[OpenStack-docs] Adding "Log a doc bug" link to openstackdocstheme

Tom Fifield tom at openstack.org
Thu Feb 26 09:15:13 UTC 2015


Hi Bernd,

Not sure if you've found these yet:

https://github.com/stackforge/clouddocs-maven-plugin/blob/master/src/main/resources/common/jquery/main-openstack.js

https://github.com/stackforge/clouddocs-maven-plugin/blob/master/src/main/resources/common/main-openstack.js

but these files contain the javascript magic (search for "launchpad")
that make the bug URLs.

So, somewhere in the template, I'd guess there would be a place where
javascript is included. Solving this bug is probably has two hard bits:

1) Including that javascript, making a button to call the logABug method
2) Working out how to pre-populate the variables (example below) needed
to lodge the bug.

var sourceFile = "source File:
file:/home/jenkins/workspace/openstack-manuals-tox-doc-publishdocs/doc/install-guide/bk-openstack-install-guide.xml"
	  var xmlId = "xml:id: openstack-install-manual"
	  var lineFeed = "%0A";
	  var docUrl = "URL: " + window.location;
	  var bugTitle = "OpenStack Installation Guide for Red Hat Enterprise
Linux 7, CentOS 7, and Fedora 20 in OpenStack Installation Guide for Red
Hat Enterprise Linux 7, CentOS 7, and Fedora 20  - kilo";
	  var buildTime = "Built: 2015-02-19T08:19:31+00:00";
	  var gitSha = "git SHA: 46962ea4e450b5cd6250e1aaccf83311fabb21c4";
	  var fieldComment = encodeURI(buildTime) +  lineFeed +
encodeURI(gitSha) + lineFeed + encodeURI(docUrl) + lineFeed +
encodeURI(sourceFile) + lineFeed + encodeURI(xmlId);
	  logABug(bugTitle,fieldComment);


Regards,


Tom


On 26/02/15 17:06, Bernd Bausch wrote:
> First, I hope it’s OK if a newbie uses this mailing list to request help
> for bug fixing. If there are better ways, please let me know.
> 
>  
> 
> The bug in question is
> https://bugs.launchpad.net/openstack-manuals/+bug/1421799. It’s a
> request to add a “log a bug” link to the openstackdocstheme templates,
> similar to the cute red bug links at the top and bottom of each page in
> the current DocBook-based documentation.
> 
>  
> 
> I recklessly assigned this bug to myself. While I should be able to put
> the mechanism in place, I don’t have enough information to construct the
> link into launchpad and could do with some help from knowledgeable people.
> 
>  
> 
> In the current documentation, the bug link is a launchpad URL that
> contains the book title (such as “SLES 11 installation guide”) and
> information of the following form:
> 
>  
> 
> -----------------------------------
> Built: 2015-02-17T17:45:22 00:00
> git SHA: 3f5dd2abd6d6f94cfffcb26f88c830da38af5d9e
> URL:
> http://docs.openstack.org/juno/config-reference/content/section_compute-scheduler.html
> source File:
> file:/home/jenkins/workspace/openstack-manuals-tox-doc-publishdocs/doc/config-reference/compute/section_compute-scheduler.xml
> xml:id: section_compute-scheduler
> 
>  
> 
> My question is: Where would I find equivalent information in the
> Sphinx/Jinja environment?
> 
> The Sphinx documentation lists a few promising helper functions and
> variables (http://sphinx-doc.org/templating.html#helper-functions). It
> seems that some settings are derived from conf.py, and I don’t know if
> there is any conf.py standard that I can base this on.
> 
> No idea how to retrieve the SHA key, and what to use instead of the XML
> ID (or can it just be left out).
> 
>  
> 
> Rather than asking for help, I could also just implement whatever I can
> and leave a few gaps for more experienced people or reviewers. Is that
> an acceptable approach?
> 
>  
> 
> Regards,
> 
>  
> 
> Bernd
> 
> Bernd Bausch
> 
> berndbausch at gmail.com <mailto:berndbausch at gmail.com>
> 
> +81 80 8892 5564
> 
>  
> 
> 
> 
> _______________________________________________
> OpenStack-docs mailing list
> OpenStack-docs at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-docs
> 




More information about the OpenStack-docs mailing list