Unable to build link to document due to missing title (in index) - python-sphinx

I am using sphinx for documentation. When I am using "make confluence", I am getting the below warnings from the index.rst file.
How can I remove these warnings? Also, Table of content is not working in confluence due to these warning but the documentation is getting created in the code.
Any suggestion/help will be highly appreciable.
[4px#learning-2 docs]$ make confluence
Running Sphinx v4.2.0
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [confluence]: targets for 0 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
/usr/lib64/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
return f(*args, **kwds)
/usr/lib64/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject
return f(*args, **kwds)
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
/home/4px/sphinx/docs/source/index.rst:: WARNING: unable to build link to document due to missing title (in index): genindex
/home/4px/sphinx/docs/source/index.rst:: WARNING: unable to build link to document due to missing title (in index): py-modindex
/home/4px/sphinx/docs/source/index.rst:: WARNING: unable to build link to document due to missing title (in index): search
publishing documents... [100%] index
Publish point: https://<........>.atlassian.net/wiki/spaces/DOCS/pages/4194009282
building intersphinx... done
build succeeded, 3 warnings.
index.rst file-
.. 4px documentation master file, created by
sphinx-quickstart on Tue Oct 26 11:19:49 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
API Documentation
**************************
CODE DOCUMENTATION
====================================
.. toctree::
:hidden:
index
featureSelection
==================
.. automodule:: featureSelection
:members:
interpolate
============
.. automodule:: interpolate
:members:
pets
============
.. automodule:: pets
:members:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
I got one github issue regarding this warning, but it was for older version.
Sphinx 2.2.2 warning · Issue #265 · sphinx-contrib/confluencebuilder

The below warnings are removed after cleaning up the index.rst file and creating individual rst file for each python script instead of adding structured format in an index.rst as above.
It yields another advantage of creating TOC page in confluence on its own.
The structure of index.rst should be below in cd docs/sources directory, where assets, plant,Site, pipeline are the name of the python script
index.rst-
.. spectRRa documentation master file, created by
sphinx-quickstart on Fri Apr 24 11:55:57 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
**API Docs**
***************
.. toctree::
assets
plants
pipelines
sites
Also create all individual rst file in cd docs/sources/ directory.
Ex-For assets.py script,the assets.rst file will be below.
assets.rst-
.. spectRRa documentation master file, created by
sphinx-quickstart on Fri Apr 24 11:55:57 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. toctree::
:maxdepth: 2
:caption: Contents:
**Assets**
=================
.. automodule:: assets
:members:
Note-Pls don't change indentation otherwise, it won't work and throw indentation warnnings.
Ref Link-Stack overflow TOC page generation in confluence using sphinx confluence builder
Sphinx Documentation

I'm not sure if this will help, but your reStructuredText has random indentation and mismatched heading underline lengths. White space matters in reStructuredText. Try cleaning it up, like so:
API Documentation
*****************
CODE DOCUMENTATION
==================
.. toctree::
:hidden:
index
featureSelection
================
.. automodule:: featureSelection
:members:
interpolate
===========
.. automodule:: interpolate
:members:
pets
====
.. automodule:: pets
:members:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

Related

Sphinx rst2pdf: Numbering figures

I have some documents on Sphinx 2.x. In addition to an HTML version (make html), I want to export it in a PDF version as well, preferably using rst2pdf:
My documents have some figure images. Here's a snippet in index.rst.
.. figure:: ./_images/img01.png
Caption for img01.
.. figure:: ./_images/img02.png
Caption for img02.
I want to add "Figure <#>" in the beginning of every caption. Does anyone have any thoughts? Please note
numfig doesn't work with rst2pdf.
Update (3/22/2020). Add the following lines in conf.py.
numfig = True
numfig_format = {
'figure': 'Figure %s.'
}
numfig_secnum_depth = 1
In the HTML output it works.
In the rst2PDF version, you don't see "Figure #".
The :counter: directive doesn't work with Sphinx; I get the following error:
.. figure:: ./_images/img01.png
Figure :counter:`figure`. Caption for img01.
$ sphinx-build -b pdf ./source/ ./build/
Running Sphinx v2.4.4
/home/sarah/sphinx_test/lib/python3.6/importlib/__init__.py:126: RemovedInSphinx30Warning: sphinx.environment.NoUri is deprecated.
Check CHANGES for Sphinx API modifications.
return _bootstrap._gcd_import(name[level:], package, level)
Initiated sphinxcontrib-images backend: `sphinxcontrib_images_lightbox2.lightbox2:LightBox2`
building [mo]: targets for 0 po files that are out of date
building [pdf]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
Exception occurred:
File "/home/sarah/sphinx_test/lib/python3.6/site-packages/docutils/nodes.py", line 439, in copy
return self.__class__(reprunicode(self), rawsource=self.rawsource)
AttributeError: 'CounterNode' object has no attribute 'rawsource'
The full traceback has been saved in /tmp/sphinx-err-1bzghsm6.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

Why are jest-based unit tests now resulting in 0% test coverage?

I'm not a front-end developer, but I need to get a sonarqube scan working with unit test coverage. All of this WAS working, but we had a big SonarQube version upgrade (6.x to 7.9.1), and it was broken for a while, and now I'm trying to get it working again.
As this used to work, what we have must be close, but there's some detail that isn't quite right.
When the build runs, it runs the unit tests and appears to generate coverage data, and the call to "sonar-scanner" sends the path to the lcov.info file. In the SonarQube project, it has a large number of "lines to cover", but with the same number of uncovered lines. I also note that it doesn't have a "Unit Tests" section in the overview.
In the build output, I see quite a few lines like this:
DEBUG: 'src/api/Api.spec.tsx' indexed as test with language 'ts'
But as noted above, the SonarQube project doesn't appear to think there are any unit tests.
As part of the build script, at the end of the tests run, I ran "ls -lt coverage" to see what was generated, and it showed this:
total 6264
-rw-r--r-- 1 81050 20059 1229978 Jan 4 19:12 clover.xml
-rw-r--r-- 1 81050 20059 720443 Jan 4 19:12 lcov.info
drwxr-xr-x 6 81050 20059 4096 Jan 4 19:12 lcov-report
-rw-r--r-- 1 81050 20059 4455341 Jan 4 19:12 coverage-final.json
I see references in this file to "Api.tsx" (and many others), but I don't see a reference to "Api.spec.tsx", but I have no idea whether I should expect any.
I've looked at the jest configuration in "package.json", but I don't see any obvious problems.
What else can I show here that might provide a clue?
Update:
Here is the resulting sonar-scanner command line, with some elisions:
sonar-scanner -Dsonar.typescript.node=/opt/app/bin/node -Dsonar.nodejs.executable=/opt/app/bin/node -Dsonar.host.url=http://... -Dsonar.login=... -Dsonar.password= -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info -Dsonar.typescript.lcov.reportPaths=coverage/lcov.info -Dsonar.branch.name= -Dsonar.language=js -Dsonar.projectKey=... -Dsonar.projectName=... '-Dsonar.exclusions=**/*.scss.d.ts, **/*.scss, **/*Props.ts, **/*State.ts, **/*index.ts' '-Dsonar.coverage.exclusions=**/*.spec.tsx, **/*.spec.ts, **/*.scss.d.ts, **/*.css.d.ts, **/*.scss' -Dsonar.projectVersion=1.0.0 '-Dsonar.sources=src/components/,src/api/,src/models/mappers/, src/utils/' '-Dsonar.lang.patterns.js=*/.ts,*/.tsx' -Dsonar.js.file.suffixes=.ts,.tsx -Dsonar.sourceEncoding=UTF-8 -Dsonar.tests=src '-Dsonar.test.inclusions=**/*.spec.tsx' -Dsonar.typescript.tslintconfigpath=tslint.json -Dsonar.log.level=DEBUG -Dsonar.verbose=true '-Dsonar.exec.maxBuffer=1024 * 1024'
I'd forgotten I'd asked this question. I had to go back to the code and history to see if I could remember what I did to fix it. I assume it would be what I discovered here:
https://community.sonarsource.com/t/sensor-sonarts-coverage-fails-to-match-path-with-symbolic-link/14601
In short, if file paths in the generated files include symbolic link entries, there was a bug in SonarTS that made it fail to follow symbolic links. What I did to fix this particular problem was examine my generated files to understand the pattern of what symbolic links were being utilized, and I wrote a script to post-process the lcov.info and test-report.xml file to replace paths to symbolic links with the absolute path to the non-symlinked file.

Section heading recognition

I am running Sphinx 1.8.2 under Eclipse Photon in Windows 10 using Python3.7.2. I am having problems getting Sphinx to accept my section heading structure.Consider the following textual source:
***********************
Development Environment
***********************
Computer Support
================
The following tools are used to support the computer environment.
Assessment and Deployment
-------------------------
This is a collection of tools supplied by Microsoft which support unattended installation of Windows.
SIM
^^^
Used to create an unattended.xml file that supplies the answers to questions posed during Windows during install.
HP Support Assistant
--------------------
Personal
========
LibreOffice
-----------
Adobe Creative Cloud - Photography Plan
---------------------------------------
Development Support
===================
Java
-----
Eclipse
-------
Pydev
^^^^^
Regex
"""""
Requests
""""""""
Sphinx
""""""
Sphinx ReadThe Docs Theme
"""""""""""""""""""""""""
Liclipse Text Editor
^^^^^^^^^^^^^^^^^^^^
Notepad++
This generates the following errors:
Running Sphinx v1.8.2
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [] 0 added, 1 changed, 0 removed
reading sources... [100%] DevEnvironment
D:\Shared\WiseOldbird\Projects\Platform IndependentApplicationController\docs\source\DevEnvironment.rst:11: WARNING: Unexpected section title.
Assessment and Deployment
-------------------------
looking for now-outdated files... none found
pickling environment... D:\Shared\WiseOldbird\Projects\Platform IndependentApplicationController\docs\source\DevEnvironment.rst:16: WARNING: Unexpected section title.
SIM
^^^
D:\Shared\WiseOldbird\Projects\Platform IndependentApplicationController\docs\source\DevEnvironment.rst:21: WARNING: Unexpected section title.
HP Support Assistant
--------------------
D:\Shared\WiseOldbird\Projects\Platform IndependentApplicationController\docs\source\DevEnvironment.rst:24: WARNING: Unexpected section title.
Personal
========
D:\Shared\WiseOldbird\Projects\Platform IndependentApplicationController\docs\source\DevEnvironment.rst:27: WARNING: Unexpected section title.
LibreOffice
-----------
D:\Shared\WiseOldbird\Projects\Platform IndependentApplicationController\docs\source\DevEnvironment.rst:30: WARNING: Unexpected section title.
Adobe Creative Cloud - Photography Plan
---------------------------------------
done
checking consistency... done
preparing documents... done
writing output... [ 50%] DevEnvironment
writing output... [100%] index
generating indices... genindex
writing additional pages... search
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 6 warnings.
The HTML pages are in build.
and it renders as HTML in Google Chrome as follows
What do I need to do to get Sphinx to accept my heading structure?
Don't indent the lines. This should work.
***********************
Development Environment
***********************
Computer Support
================
The following tools are used to support the computer environment.
Assessment and Deployment
-------------------------
This is a collection of tools supplied by Microsoft which support unattended installation of Windows.
SIM
^^^
Used to create an unattended.xml file that supplies the answers to questions posed during Windows during install.
HP Support Assistant
--------------------
Personal
========
LibreOffice
-----------
Adobe Creative Cloud - Photography Plan
---------------------------------------
Development Support
===================
Java
-----
Eclipse
-------
Pydev
^^^^^
Regex
"""""
Requests
""""""""
Sphinx
""""""
Sphinx ReadThe Docs Theme
"""""""""""""""""""""""""
Liclipse Text Editor
^^^^^^^^^^^^^^^^^^^^
Notepad++

Gentoo No rule to make target 'olddefconfig'

I have been following this guide from the gentto wiki to install Gentoo. I have hit a bit of a roadblock though which looks reasonably simple but I am having trouble figuring it out.
On this page: https://wiki.gentoo.org/wiki/Sakaki%27s_EFI_Install_Guide/Configuring_Secure_Boot#test_secure_boot
In the Testing Secure Boot with a Signed Kernel section whilst executing the buildkernel command I get the following error:
* Updating old config using make olddefconfig
make: *** No rule to make target 'olddefconfig'. Stop.
* buildkernel: Error: Caught signal - exiting
I don't seem to have an olddefconfig at all and even if I did have one I am not entirely sure what rule should be added to the make file.
I have read the man page for the buildkernel command and gone over this description here but sadly I have still not managed to fix the issue.
Does anyone know how to rectify this error?
So I now have an answer for this. It sometimes happens when the kernel sources have been updated to a new version, but the symbolic link /usr/src/linux hasn't been updated to
match. Gentoo leaves a partially populated kernel source tree in
/usr/src/linux--genoo even when an old kernel source version is
unmerged, and if the symbolic link /usr/src/linux still points to this.
if you run:
eselect kernel list
and it produces something like:
Available kernel symlink targets:
[1] linux-4.14.63-gentoo-r1
and
ls -l /usr/src/
produces something along the lines of:
total 8
lrwxrwxrwx 1 root root 20 Aug 18 00:33 linux -> linux-4.14.61-gentoo
drwxr-xr-x 23 root root 4096 Aug 18 02:38 linux-4.14.61-gentoo
drwxr-xr-x 25 root root 4096 Aug 18 02:33 linux-4.14.63-gentoo-r1
Running the following command will update the symbolic link and let you get on with things.
eselect kernel set 1
I emailed the author of the guide to get this information so credit goes to her. I am leaving this here in case anyone else runs into this problem in future.

Rmarkdown knit error: Fault/access violation in generated code

I've got a particular bug in my environment such that I cannot consistently knit Rmarkdown files to HTML, Word documents, or PDFs. The ability to knit varies across by file type.
HTML - Sometimes it knits
Word document - Sometimes it knits
PDF - Never knits. Always throws the same error
The error is:
Segmentation fault/access violation in generated code
Error: pandoc document conversion failed with error 1
Up until a week ago, I was able to knit to all three file types in the same environment so this is a relatively recent bug. The high-level specs of my environment are:
OS: Windows 10
R: 3.4.3
RStudio: 1.1.419
knitr: 1.19
rmarkdown: 1.8
pandoc: 1.19.2.1
MiKTeX : 2.9
As an example of the inconsistency in the ability to knit, I crated a new .Rmd file in RStudio which creates the familiar standard template of summary(cars) and plot(pressure) etc. I didn't change anything about it. I was able to knit it successfully to HTML once, Word .docx once, and then I tried to knit to PDF and got the error above. I then went back and attempted to knit to both HTML and Word and received the error even though nothing changed from the original knit. This is just an example of the type of behavior. Different documents behave differently.
To troubleshoot, I've reinstalled R and RStudio (I believe pandoc comes up with the RStudio install so I've effectively reinstalled pandoc too). The reinstallation did not help. I've tried clearing the Knitr Cache. That didn't work either. I've browsed SO and the internet and found a few similar errors related to the Glasgow-Haskell compiler, but I have no idea what that is and if it's the source of the issue.
Here is an example of the .Rmd file that throws the error:
---
title: "Untitled"
author: "Vypa"
date: "February 8, 2018"
output:
html_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
summary(cars)
```
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
And here is the full console error:
Segmentation fault/access violation in generated code
Error: pandoc document conversion failed with error 1
In addition: Warning message:
running command '"C:/Users/Vypa/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS tst.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output tst.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Users\Vypa\Documents\R\R-3.4.3\library\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable "theme:bootstrap" --include-in-header "C:\Users\Vypa\AppData\Local\Temp\RtmpI9Gxsx\rmarkdown-str5db029544a23.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"' had status 1
Execution halted
Any help or thoughts would be appreciated.
Encountered the same problem after a recent install of R & RStudio on Win10. Pandoc problem showed up on edit and knitr of previously err free .rmd file.
Resolved after installing latest preview ver of RStudio at
https://www.rstudio.com/products/rstudio/download/preview/
Updating pandoc fixed this for me.
https://pandoc.org/installing.html
Thanks #EuGENE. Adding here as an answer for clarity.

Resources