Przeglądaj źródła

[documentation] fix configuration and fix formatting

Thomas Rabaix 11 lat temu
rodzic
commit
be81021e76

+ 2 - 3
.travis.yml

@@ -15,10 +15,9 @@ env:
 before_script:
   - composer require symfony/symfony:${SYMFONY_VERSION} --no-update
   - composer install --dev --prefer-source
-  - sudo pip install Sphinx
-  - sudo pip install git+https://github.com/fabpot/sphinx-php.git
+  - sudo pip install -r Resources/doc/requirements.txt
 
-script: phpunit && cd Resources/doc && make html
+script: phpunit && cd Resources/doc && sphinx-build -W -b html -d _build/doctrees . _build/html
 
 notifications:
     webhooks: http://sonata-project.org/bundles/admin/master/travis

+ 1 - 0
Resources/doc/_static/.gitkeep

@@ -0,0 +1 @@
+gitkeep

+ 3 - 2
Resources/doc/conf.py

@@ -88,10 +88,11 @@ pygments_style = 'sphinx'
 
 
 # -- Options for HTML output ---------------------------------------------------
+import sphinx_rtd_theme
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-html_theme = 'default'
+html_theme = 'sphinx_rtd_theme'
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
@@ -99,7 +100,7 @@ html_theme = 'default'
 #html_theme_options = {}
 
 # Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
+html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
 
 # The name for this set of Sphinx documents.  If None, it defaults to
 # "<project> v<release> documentation".

+ 3 - 2
Resources/doc/reference/advanced.rst

@@ -55,7 +55,7 @@ You have 2 ways of defining the dependencies inside ``services.xml``:
         acme.project.admin.project:
             class: Acme\ProjectBundle\Admin\ProjectAdmin
             tags:
-                - name: sonata.admin 
+                - name: sonata.admin
                   manager_type: orm
                   group: "Project"
                   label: "Project"
@@ -106,7 +106,7 @@ You have 2 ways of defining the dependencies inside ``services.xml``:
                 - ~
             calls:
                 - [ setLabelTranslatorStrategy, [ @sonata.admin.label.strategy.native ]]
-                - [ setRouteBuilder, [ @sonata.admin.route.path_info ]]        
+                - [ setRouteBuilder, [ @sonata.admin.route.path_info ]]
 
 If you want to modify the service that is going to be injected, add the following code to your
 application's config file:
@@ -172,6 +172,7 @@ To create your own RouteBuilder create the PHP class and register it as a servic
 .. configuration-block::
 
     .. code-block:: yaml
+
         parameters:
             acme.admin.entity_route_builder.class: Acme\AdminBundle\Route\EntityRouterBuilder
 

+ 97 - 97
Resources/doc/reference/configuration.rst

@@ -24,107 +24,107 @@ Full Configuration Options
 
     .. code-block:: yaml
 
-    # Default configuration for "SonataAdminBundle"
-    sonata_admin:
-        security:
-            handler:              sonata.admin.security.handler.noop
-            information:
+        # Default configuration for "SonataAdminBundle"
+        sonata_admin:
+            security:
+                handler:              sonata.admin.security.handler.noop
+                information:
 
-                # Prototype
-                id:                   []
-            admin_permissions:
-
-                # Defaults:
-                - CREATE
-                - LIST
-                - DELETE
-                - UNDELETE
-                - EXPORT
-                - OPERATOR
-                - MASTER
-            object_permissions:
-
-                # Defaults:
-                - VIEW
-                - EDIT
-                - DELETE
-                - UNDELETE
-                - OPERATOR
-                - MASTER
-                - OWNER
-            acl_user_manager:     ~         # Name of the user manager service used to retrieve ACL users
-        title:                Sonata Admin
-        title_logo:           bundles/sonataadmin/logo_title.png
-        options:
-            html5_validate:       true      # use html5 validation
-            confirm_exit:         true      # enabled confirmation when quitting with unsaved changes
-            use_select2:          true      # enable select2
-            pager_links:          ~         # pager max links to display
-        dashboard:
-            groups:
+                    # Prototype
+                    id:                   []
+                admin_permissions:
+
+                    # Defaults:
+                    - CREATE
+                    - LIST
+                    - DELETE
+                    - UNDELETE
+                    - EXPORT
+                    - OPERATOR
+                    - MASTER
+                object_permissions:
+
+                    # Defaults:
+                    - VIEW
+                    - EDIT
+                    - DELETE
+                    - UNDELETE
+                    - OPERATOR
+                    - MASTER
+                    - OWNER
+                acl_user_manager:     ~         # Name of the user manager service used to retrieve ACL users
+            title:                Sonata Admin
+            title_logo:           bundles/sonataadmin/logo_title.png
+            options:
+                html5_validate:       true      # use html5 validation
+                confirm_exit:         true      # enabled confirmation when quitting with unsaved changes
+                use_select2:          true      # enable select2
+                pager_links:          ~         # pager max links to display
+            dashboard:
+                groups:
+
+                    # Prototype
+                    id:
+                        label:                ~
+                        label_catalogue:      ~
+                        items:                []
+                        item_adds:            []
+                        roles:                []
+                blocks:
+                    type:                 ~
+                    settings:
+
+                        # Prototype
+                        id:                   []
+                    position:             right
+            admin_services:
 
                 # Prototype
                 id:
+                    model_manager:        ~
+                    form_contractor:      ~
+                    show_builder:         ~
+                    list_builder:         ~
+                    datagrid_builder:     ~
+                    translator:           ~
+                    configuration_pool:   ~
+                    router:               ~
+                    validator:            ~
+                    security_handler:     ~
                     label:                ~
-                    label_catalogue:      ~
-                    items:                []
-                    item_adds:            []
-                    roles:                []
-            blocks:
-                type:                 ~
-                settings:
+            templates:
+                user_block:           SonataAdminBundle:Core:user_block.html.twig
+                layout:               SonataAdminBundle::standard_layout.html.twig
+                ajax:                 SonataAdminBundle::ajax_layout.html.twig
+                dashboard:            SonataAdminBundle:Core:dashboard.html.twig
+                search:               SonataAdminBundle:Core:search.html.twig
+                list:                 SonataAdminBundle:CRUD:list.html.twig
+                show:                 SonataAdminBundle:CRUD:show.html.twig
+                edit:                 SonataAdminBundle:CRUD:edit.html.twig
+                preview:              SonataAdminBundle:CRUD:preview.html.twig
+                history:              SonataAdminBundle:CRUD:history.html.twig
+                acl:                  SonataAdminBundle:CRUD:acl.html.twig
+                history_revision_timestamp:  SonataAdminBundle:CRUD:history_revision_timestamp.html.twig
+                action:               SonataAdminBundle:CRUD:action.html.twig
+                select:               SonataAdminBundle:CRUD:list__select.html.twig
+                list_block:           SonataAdminBundle:Block:block_admin_list.html.twig
+                search_result_block:  SonataAdminBundle:Block:block_search_result.html.twig
+                short_object_description:  SonataAdminBundle:Helper:short-object-description.html.twig
+                delete:               SonataAdminBundle:CRUD:delete.html.twig
+                batch:                SonataAdminBundle:CRUD:list__batch.html.twig
+                batch_confirmation:   SonataAdminBundle:CRUD:batch_confirmation.html.twig
+                inner_list_row:       SonataAdminBundle:CRUD:list_inner_row.html.twig
+                base_list_field:      SonataAdminBundle:CRUD:base_list_field.html.twig
+                pager_links:          SonataAdminBundle:Pager:links.html.twig
+                pager_results:        SonataAdminBundle:Pager:results.html.twig
+            extensions:
 
-                    # Prototype
-                    id:                   []
-                position:             right
-        admin_services:
-
-            # Prototype
-            id:
-                model_manager:        ~
-                form_contractor:      ~
-                show_builder:         ~
-                list_builder:         ~
-                datagrid_builder:     ~
-                translator:           ~
-                configuration_pool:   ~
-                router:               ~
-                validator:            ~
-                security_handler:     ~
-                label:                ~
-        templates:
-            user_block:           SonataAdminBundle:Core:user_block.html.twig
-            layout:               SonataAdminBundle::standard_layout.html.twig
-            ajax:                 SonataAdminBundle::ajax_layout.html.twig
-            dashboard:            SonataAdminBundle:Core:dashboard.html.twig
-            search:               SonataAdminBundle:Core:search.html.twig
-            list:                 SonataAdminBundle:CRUD:list.html.twig
-            show:                 SonataAdminBundle:CRUD:show.html.twig
-            edit:                 SonataAdminBundle:CRUD:edit.html.twig
-            preview:              SonataAdminBundle:CRUD:preview.html.twig
-            history:              SonataAdminBundle:CRUD:history.html.twig
-            acl:                  SonataAdminBundle:CRUD:acl.html.twig
-            history_revision_timestamp:  SonataAdminBundle:CRUD:history_revision_timestamp.html.twig
-            action:               SonataAdminBundle:CRUD:action.html.twig
-            select:               SonataAdminBundle:CRUD:list__select.html.twig
-            list_block:           SonataAdminBundle:Block:block_admin_list.html.twig
-            search_result_block:  SonataAdminBundle:Block:block_search_result.html.twig
-            short_object_description:  SonataAdminBundle:Helper:short-object-description.html.twig
-            delete:               SonataAdminBundle:CRUD:delete.html.twig
-            batch:                SonataAdminBundle:CRUD:list__batch.html.twig
-            batch_confirmation:   SonataAdminBundle:CRUD:batch_confirmation.html.twig
-            inner_list_row:       SonataAdminBundle:CRUD:list_inner_row.html.twig
-            base_list_field:      SonataAdminBundle:CRUD:base_list_field.html.twig
-            pager_links:          SonataAdminBundle:Pager:links.html.twig
-            pager_results:        SonataAdminBundle:Pager:results.html.twig
-        extensions:
-
-            # Prototype
-            id:
-                admins:               []
-                excludes:             []
-                implements:           []
-                extends:              []
-                instanceof:           []
-        persist_filters:      false     # set to true to persist filter settings per admin module in the user's session
+                # Prototype
+                id:
+                    admins:               []
+                    excludes:             []
+                    implements:           []
+                    extends:              []
+                    instanceof:           []
+            persist_filters:      false     # set to true to persist filter settings per admin module in the user's session
 

+ 3 - 0
Resources/doc/requirements.txt

@@ -0,0 +1,3 @@
+Sphinx
+git+https://github.com/fabpot/sphinx-php.git
+sphinx_rtd_theme