From 4de6a2af0f7ef926f7c7eed5a10a90500d3749d7 Mon Sep 17 00:00:00 2001 From: Sonata CI Date: Wed, 11 Aug 2021 14:18:32 +0100 Subject: [PATCH] DevKit updates (#627) --- .gitattributes | 1 + .readthedocs.yaml | 10 +++ Makefile | 2 +- README.md | 15 +++-- docs/Makefile | 153 ------------------------------------------ docs/conf.py | 10 ++- docs/requirements.txt | 7 +- 7 files changed, 33 insertions(+), 165 deletions(-) create mode 100644 .readthedocs.yaml delete mode 100644 docs/Makefile diff --git a/.gitattributes b/.gitattributes index 1160f47b..cab888c0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,6 +6,7 @@ *.md export-ignore tests export-ignore docs export-ignore +.readthedocs.yaml export-ignore Makefile export-ignore phpunit.xml.dist export-ignore phpstan.neon.dist export-ignore diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..176d9591 --- /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 0e31bd8d..48e23024 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ 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 phpstan: diff --git a/README.md b/README.md index 8a7d50db..dd4ffb7c 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,14 @@ Symfony Sonata / Integrate Doctrine MongoDB ODM into the SonataAdminBundle [![Monthly Downloads](https://poser.pugx.org/sonata-project/doctrine-mongodb-admin-bundle/d/monthly)](https://packagist.org/packages/sonata-project/doctrine-mongodb-admin-bundle) [![Daily Downloads](https://poser.pugx.org/sonata-project/doctrine-mongodb-admin-bundle/d/daily)](https://packagist.org/packages/sonata-project/doctrine-mongodb-admin-bundle) -Branch | Github Actions | Code Coverage | ------- | -------------- | ------------- | -3.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 | +------ | -------------- | ------------- | ------------- | +3.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/doctrine-mongodb-admin). +Check out the documentation on the [official website](https://docs.sonata-project.org/projects/SonataDoctrineMongoDBAdminBundle). ## Support @@ -48,3 +48,8 @@ This package is available under the [MIT license](LICENSE). [coverage_unstable_link]: https://codecov.io/gh/sonata-project/SonataDoctrineMongoDBAdminBundle/branch/master [shepherd_stable_badge]: https://shepherd.dev/github/sonata-project/SonataDoctrineMongoDBAdminBundle/coverage.svg [shepherd_stable_link]: https://shepherd.dev/github/sonata-project/SonataDoctrineMongoDBAdminBundle + +[documentation_stable_badge]: https://readthedocs.org/projects/sonatadoctrinemongodbadminbundle/badge/?version=3.x +[documentation_stable_link]: https://docs.sonata-project.org/projects/SonataDoctrineMongoDBAdminBundle/en/3.x/?badge=3.x +[documentation_unstable_badge]: https://readthedocs.org/projects/sonatadoctrinemongodbadminbundle/badge/?version=master +[documentation_unstable_link]: https://docs.readthedocs.org/projects/SonataDoctrineMongoDBAdminBundle/en/master/?badge=master diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index fafb435f..00000000 --- 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 93a3e38f..fcd7a92d 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'SonataDoctrineMongodbAdminBundle' -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 ee596d3c..c8bce592 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