Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a read the docs #1907

Merged
merged 1 commit into from
Nov 5, 2022
Merged

Add a read the docs #1907

merged 1 commit into from
Nov 5, 2022

Conversation

jahav
Copy link
Member

@jahav jahav commented Nov 3, 2022

A testing PR to add a read-the-docs to the repo.

  • ClosedXML needs a better documentation,
  • ever PR should include docs about feature/changes => need docs in the repo .
  • Github markdown is very limited
  • Github wiki doesn't do versioning by release

@jahav jahav force-pushed the readthedocs-squash branch 2 times, most recently from 37af3bc to 0dd1ca1 Compare November 4, 2022 22:51
…m wiki. Use Doxygen to generate an API reference as a part of the documentation. Enables:

* build on each PR - a  PR will now include documentation changes, not an extra step
* documentation can be versioned
* markdown on github is severly limited
@jahav
Copy link
Member Author

jahav commented Nov 5, 2022

For future reference

  • Sphix is a RST/MkDoc to other formats generator (in our case RST to HTML)
  • Breathe-doc is a generator that takes XML from Doxygen and converts it to csharp documentation. Breathe is in a "minimal active work" mode (source)
  • sphinx_csharp is a domain extension for Breathe-doc to generate csharp elements (classes, methods, structs), e.g. parses method signature and outputs nodes to write to RST.
  • The Doxygen generation must be done through Python subprocess.call in conf.py, otherwise ClosedXML would need to store XML files in repo (not acceptable). See Running on Read the Docs - Generating Doxygen XML Files
  • Breathe-doc added support for C# in this PR C# Support breathe-doc/breathe#550
  • Breathe-doc uses an extensions to generate the markup from Doxygen XML. Extension must be registered in the Sphinx.
  • There are several extensions, a dead one (has a obsolete package on PyPI that throws errors), maintained fork that doesn't have a package on PyPI, a not-so-pretty one where I don't know how well it is integrated to Breathe.
  • Breathe ::member:: option shows even public methods from non-public methods. That kind of make sense, why should non-public class have public methods, but not something we want to show. EXTRACT_PRIVATE in Doxygen should have stopped it, but doesn't... not really a problem.

conf.py

# Need to have breathe to generate xml to rst and sphinx_csharp (note the underscore) 
# to generate pretty Doxygen documentation
extensions = ['sphinx_csharp','breathe']

import subprocess, os

read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'

if read_the_docs_build:
     subprocess.call('doxygen', shell=True)
     subprocess.call('pip install git+https://github.com/rogerbarton/sphinx-csharp.git', shell=True)    

@jahav jahav merged commit 35a2fca into develop Nov 5, 2022
@jahav jahav deleted the readthedocs-squash branch November 5, 2022 02:50
@jahav jahav added this to the v0.97.1 milestone Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant