<div dir="ltr">Hi all!<br clear="all"><div>Late night for me, but as promised I've been researching how to do conditional output and at what level for the End User Guide and Admin User Guide migration to RST/Sphinx.</div><div><br></div><div>There are currently phrase-level conditionals for audience in the source. [1] On further investigation in the Sphinx toolchain, I don't think that's possible with the way Sphinx makes HTML output. </div><div><br></div><div>There are also section-level conditional indicators for audience. [2] I believe this is possible to do with a solution I've coded up at [3]. It contains a new Sphinx extension for scoping and also requires use of a meta indicator for a section file in RST.</div><div><br></div><div>I investigated the two common Sphinx ways to do conditionals: the ifconfig extension and the only directive. The ifconfig extension won't work as expected for toctree directives. [4] The only directive is meant for notes/admonitions or paragraph chunks, not for entire files. </div><div><br></div><div>So, please take a look at the review and see if you think we can use it for our use cases. I believe we can extend it further for more meta tags to get more conditional output.</div><div>Thanks,</div><div>Anne</div><div><br></div><div>1. <a href="https://github.com/openstack/openstack-manuals/blob/ea4f68a88cb56deb216949d781ef905d72c1ab31/doc/common/ch_using_openstack_overview.xml#L7">https://github.com/openstack/openstack-manuals/blob/ea4f68a88cb56deb216949d781ef905d72c1ab31/doc/common/ch_using_openstack_overview.xml#L7</a></div><div>2. <a href="https://github.com/openstack/openstack-manuals/blob/1326c18819c4a717f88f0347355753c15eb08c92/doc/common/section_cli_openrc.xml#L29">https://github.com/openstack/openstack-manuals/blob/1326c18819c4a717f88f0347355753c15eb08c92/doc/common/section_cli_openrc.xml#L29</a></div><div>3. <a href="https://review.openstack.org/156877">https://review.openstack.org/156877</a></div><div>4. <a href="https://github.com/sphinx-doc/sphinx/issues/1717">https://github.com/sphinx-doc/sphinx/issues/1717</a></div>







<div><br></div>-- <br><div class="gmail_signature">Anne Gentle<br><a href="mailto:annegentle@justwriteclick.com" target="_blank">annegentle@justwriteclick.com</a></div>
</div>