diff --git a/.gitattributes b/.gitattributes index feaef8927..015d0c9bb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,5 +6,6 @@ *.md export-ignore tests export-ignore docs export-ignore +.readthedocs.yaml export-ignore Makefile export-ignore phpunit.xml.dist export-ignore diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..176d95912 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,10 @@ +version: 2 + +sphinx: + builder: dirhtml + configuration: docs/conf.py + +python: + version: '3.7' + install: + - requirements: docs/requirements.txt diff --git a/Makefile b/Makefile index 227a8c149..e3703f291 100644 --- a/Makefile +++ b/Makefile @@ -85,5 +85,5 @@ endif .PHONY: test docs: - cd docs && sphinx-build -W -b html -d _build/doctrees . _build/html + cd docs && sphinx-build -W -b dirhtml -d _build/doctrees . _build/html .PHONY: docs diff --git a/README.md b/README.md index 03283f270..a5a5824fe 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,14 @@ Symfony SonataUserBundle [![Monthly Downloads](https://poser.pugx.org/sonata-project/user-bundle/d/monthly)](https://packagist.org/packages/sonata-project/user-bundle) [![Daily Downloads](https://poser.pugx.org/sonata-project/user-bundle/d/daily)](https://packagist.org/packages/sonata-project/user-bundle) -Branch | Github Actions | Code Coverage | ------- | -------------- | ------------- | -4.x | [![Test][test_stable_badge]][test_stable_link] | [![Coverage Status][coverage_stable_badge]][coverage_stable_link] | -master | [![Test][test_unstable_badge]][test_unstable_link] | [![Coverage Status][coverage_unstable_badge]][coverage_unstable_link] | +Branch | Github Actions | Code Coverage | Documentation | +------ | -------------- | ------------- | ------------- | +4.x | [![Test][test_stable_badge]][test_stable_link] | [![Coverage Status][coverage_stable_badge]][coverage_stable_link] | [![Documentation Status][documentation_stable_badge]][documentation_stable_link] | +master | [![Test][test_unstable_badge]][test_unstable_link] | [![Coverage Status][coverage_unstable_badge]][coverage_unstable_link] | [![Documentation Status][documentation_unstable_badge]][documentation_unstable_link] | ## Documentation -Check out the documentation on the [official website](https://sonata-project.org/bundles/user). +Check out the documentation on the [official website](https://docs.sonata-project.org/projects/SonataUserBundle). ## Support @@ -45,3 +45,8 @@ This package is available under the [MIT license](LICENSE). [coverage_stable_link]: https://codecov.io/gh/sonata-project/SonataUserBundle/branch/4.x [coverage_unstable_badge]: https://codecov.io/gh/sonata-project/SonataUserBundle/branch/master/graph/badge.svg [coverage_unstable_link]: https://codecov.io/gh/sonata-project/SonataUserBundle/branch/master + +[documentation_stable_badge]: https://readthedocs.org/projects/sonatauserbundle/badge/?version=4.x +[documentation_stable_link]: https://docs.sonata-project.org/projects/SonataUserBundle/en/4.x/?badge=4.x +[documentation_unstable_badge]: https://readthedocs.org/projects/sonatauserbundle/badge/?version=master +[documentation_unstable_link]: https://docs.readthedocs.org/projects/SonataUserBundle/en/master/?badge=master diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index fafb435fe..000000000 --- a/docs/Makefile +++ /dev/null @@ -1,153 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/IoC.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/IoC.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/IoC" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/IoC" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/docs/conf.py b/docs/conf.py index 10aaec461..e2199b722 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,11 +29,13 @@ # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +needs_sphinx = '1.8.5' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode'] +extensions = [ + 'sensio.sphinx.codeblock', 'sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode' +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -49,7 +51,7 @@ # General information about the project. project = u'SonataUserBundle' -copyright = u'2010-2020, Thomas Rabaix' +copyright = u'2010-2021, Thomas Rabaix' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -102,7 +104,9 @@ # enable highlighting for PHP code not between ```` by default lexers['php'] = PhpLexer(startinline=True) lexers['php-annotations'] = PhpLexer(startinline=True) +lexers['php-attributes'] = PhpLexer(startinline=True) lexers['php-standalone'] = PhpLexer(startinline=True) +lexers['php-symfony'] = PhpLexer(startinline=True) # -- Options for HTML output --------------------------------------------------- import sphinx_rtd_theme diff --git a/docs/requirements.txt b/docs/requirements.txt index ee596d3c4..c8bce5927 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,6 +2,7 @@ # # It's auto-generated by sonata-project/dev-kit package. -Sphinx==1.8.5 -git+https://github.com/fabpot/sphinx-php.git -sphinx_rtd_theme +Pygments==2.2.0 +sphinx==1.8.5 +git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php +sphinx_rtd_theme==0.5.2