Skip to content

Commit 01ef2cf

Browse files
jaapiolinawolfgarvinhickingsfroemkenjw
authored
[TASK] Add init command to setup documentation (#850)
First version of an init command that will setup the Documentation directory. This includes a very basic guides.xml. Therefor the user has to answer a number of questions that will fill in the defaults. --------- Co-authored-by: Lina Wolf <[email protected]> Co-authored-by: Garvin Hicking <[email protected]> Co-authored-by: lina.wolf <[email protected]> Co-authored-by: Stefan Frömken <[email protected]>
1 parent 9aa3bb1 commit 01ef2cf

File tree

19 files changed

+625
-20
lines changed

19 files changed

+625
-20
lines changed

Diff for: Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ WORKDIR /opt/guides
1212

1313
COPY --from=builder /opt/guides/vendor /opt/guides/vendor
1414
RUN echo "memory_limit=4G" >> /usr/local/etc/php/conf.d/typo3.ini
15+
RUN echo "error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT" >> /usr/local/etc/php/conf.d/typo3.ini
1516

1617
ARG TYPO3AZUREEDGEURIVERSION
1718
ENV TYPO3AZUREEDGEURIVERSION=$TYPO3AZUREEDGEURIVERSION

Diff for: entrypoint.sh

+3
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ ENTRYPOINT_SYMFONY_COMMANDS="/opt/guides/packages/typo3-guides-cli/bin/typo3-gui
6565
if [ "$1" = "migrate" ]; then
6666
ENTRYPOINT="${ENTRYPOINT_SYMFONY_COMMANDS} migrate"
6767
shift
68+
elif [ "$1" = "init" ]; then
69+
ENTRYPOINT="${ENTRYPOINT_SYMFONY_COMMANDS} init"
70+
shift
6871
elif [ "$1" = "lint-guides-xml" ]; then
6972
ENTRYPOINT="${ENTRYPOINT_SYMFONY_COMMANDS} lint-guides-xml"
7073
shift

Diff for: packages/typo3-docs-theme/resources/config/typo3-docs-theme.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use phpDocumentor\Guides\RestructuredText\Parser\Productions\DirectiveContentRule;
1818
use phpDocumentor\Guides\RestructuredText\Parser\Productions\DocumentRule;
1919
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
20+
use T3Docs\VersionHandling\Packagist\PackagistService;
2021
use T3Docs\Typo3DocsTheme\Api\Typo3ApiService;
2122
use T3Docs\Typo3DocsTheme\Compiler\NodeTransformers\CollectPrefixLinkTargetsTransformer;
2223
use T3Docs\Typo3DocsTheme\Compiler\NodeTransformers\ConfvalMenuNodeTransformer;
@@ -41,7 +42,6 @@
4142
use T3Docs\Typo3DocsTheme\EventListeners\OriginalFileNameSetter;
4243
use T3Docs\Typo3DocsTheme\EventListeners\TestingModeActivator;
4344
use T3Docs\Typo3DocsTheme\Inventory\Typo3InventoryRepository;
44-
use T3Docs\Typo3DocsTheme\Packagist\PackagistService;
4545
use T3Docs\Typo3DocsTheme\Inventory\Typo3VersionService;
4646
use T3Docs\Typo3DocsTheme\Parser\ExtendedInterlinkParser;
4747
use T3Docs\Typo3DocsTheme\Parser\Productions\FieldList\EditOnGitHubFieldListItemRule;

Diff for: packages/typo3-docs-theme/src/Nodes/Inline/ComposerInlineNode.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace T3Docs\Typo3DocsTheme\Nodes\Inline;
44

55
use phpDocumentor\Guides\Nodes\Inline\InlineNode;
6-
use T3Docs\Typo3DocsTheme\Packagist\ComposerPackage;
6+
use T3Docs\VersionHandling\Packagist\ComposerPackage;
77

88
final class ComposerInlineNode extends InlineNode
99
{

Diff for: packages/typo3-docs-theme/src/TextRoles/ComposerTextRole.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use phpDocumentor\Guides\RestructuredText\TextRoles\TextRole;
99
use Psr\Log\LoggerInterface;
1010
use T3Docs\Typo3DocsTheme\Nodes\Inline\ComposerInlineNode;
11-
use T3Docs\Typo3DocsTheme\Packagist\PackagistService;
11+
use T3Docs\VersionHandling\Packagist\PackagistService;
1212

1313
final class ComposerTextRole implements TextRole
1414
{

Diff for: packages/typo3-guides-cli/bin/typo3-guides

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ declare(strict_types=1);
55

66
namespace T3Docs\GuidesCli;
77

8+
use T3Docs\GuidesCli\Command\InitCommand;
89
use T3Docs\GuidesCli\Command\MigrateSettingsCommand;
910
use T3Docs\GuidesCli\Command\ConfigureCommand;
1011
use T3Docs\GuidesCli\Command\LintGuidesXmlCommand;
@@ -35,6 +36,7 @@ if (file_exists($autoloadDirectory)){
3536
$application = new Application('typo3-guides');
3637

3738
$application->add(new MigrateSettingsCommand());
39+
$application->add(new InitCommand());
3840
$application->add(new ConfigureCommand());
3941
$application->add(new LintGuidesXmlCommand());
4042

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# {{ projectName }}
2+
3+
{{ description | default('No description provided.') }}
4+
5+
## Installation
6+
7+
Install the extension via Composer:
8+
9+
```
10+
composer req {{ composerName }}
11+
```
12+
13+
{% if projectHomePage %}
14+
Or download the extension from {{ projectHomePage }} and install it in
15+
the Extension Manager.
16+
{% endif %}
17+
18+
See also [Installing extensions, TYPO3 Getting started](https://docs.typo3.org/permalink/t3start:installing-extensions)
19+
20+
## Configuration
21+
22+
23+
{% if siteSet %}
24+
25+
### Include the site set
26+
27+
This extension comes with a site set called `{{ siteSet }}`. To use it include
28+
this set in your site configuration via
29+
30+
```
31+
base: 'https://example.com/'
32+
rootPageId: 1
33+
dependencies:
34+
- {{ siteSet }}
35+
```
36+
37+
See also: `TYPO3 Explained, Using a site set as dependency in a site <https://docs.typo3.org/permalink/t3coreapi:site-sets-usage>`_.
38+
{% else %}
39+
Describe how to configure the extension.
40+
{% endif %}
41+
42+
## Report issues
43+
44+
{% if issuesUrl %}
45+
You can report issues at {{ issuesUrl }}.
46+
{% else %}
47+
Explain, how to report issues.
48+
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<guides
3+
xmlns="https://www.phpdoc.org/guides"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="https://www.phpdoc.org/guides vendor/phpdocumentor/guides-cli/resources/schema/guides.xsd"
6+
input-format="{{ format }}"
7+
{% if useMd -%}
8+
index-name="Index"
9+
automatic-menu="true"
10+
{% endif -%}
11+
>
12+
<project
13+
title="{{ projectName }}"
14+
copyright="The contributors"
15+
/>
16+
<extension
17+
class="\T3Docs\Typo3DocsTheme\DependencyInjection\Typo3DocsThemeExtension"
18+
{% if editOnGitHub -%}
19+
edit-on-github="{{ editOnGitHub }}"
20+
edit-on-github-branch="main"
21+
{% endif -%}
22+
interlink-shortcode="{{ composerName }}"
23+
{% if projectHomePage -%}
24+
project-home="{{ projectHomePage }}"
25+
{% endif -%}
26+
{% if issuesUrl -%}
27+
project-issues="{{ issuesUrl }}"
28+
{% endif -%}
29+
{% if repositoryUrl -%}
30+
project-repository="{{ repositoryUrl }}"
31+
{% endif -%}
32+
typo3-core-preferred="{{ typo3CoreVersion }}"
33+
/>
34+
</guides>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
:navigation-title: Configuration
2+
.. _configuration:
3+
4+
=============
5+
Configuration
6+
=============
7+
8+
{% if siteSet %}
9+
.. _site-set:
10+
11+
Include the site set
12+
====================
13+
14+
This extension comes with a site set called `{{ siteSet }}`. To use it include
15+
this set in your site configuration via
16+
17+
.. code-block:: diff
18+
:caption: config/sites/my-site/config.yaml (diff)
19+
20+
base: 'https://example.com/'
21+
rootPageId: 1
22+
+dependencies:
23+
+ - {{ siteSet }}
24+
25+
See also: `TYPO3 Explained, Using a site set as dependency in a site <https://docs.typo3.org/permalink/t3coreapi:site-sets-usage>`_.
26+
27+
{% if siteSetDefinition %}
28+
.. _site-set-settings:
29+
30+
Use the settings to configure the extension
31+
-------------------------------------------
32+
33+
.. typo3:site-set-settings:: PROJECT:/
34+
:name: main-set
35+
:type:
36+
:Label: max=30
37+
:default: max=10
38+
{% endif %}
39+
40+
{% else %}
41+
Describe how to configure the extension.
42+
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
:navigation-title: FAQ
2+
3+
.. _faq:
4+
5+
================================
6+
Frequently Asked Questions (FAQ)
7+
================================
8+
9+
.. accordion::
10+
:name: faq
11+
12+
.. accordion-item:: How can I install this extension?
13+
:name: installation
14+
:header-level: 2
15+
:show:
16+
17+
See chapter :ref:`installation`.
18+
19+
.. accordion-item:: How to can I include the TypoScript?
20+
:name: configuration
21+
:header-level: 2
22+
23+
See chapter :ref:`configuration`.
24+
25+
.. accordion-item:: Where to get help?
26+
:name: help
27+
:header-level: 2
28+
29+
See chapter :ref:`help`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
:navigation-title: Get Help
2+
3+
.. _help:
4+
5+
=================
6+
Where to get help
7+
=================
8+
9+
You can get help in the TYPO3 Slack https://typo3.org/community/meet/chat-slack,
10+
Ask a question in the official TYPO3 forum, https://talk.typo3.org/c/typo3-questions/19
11+
or contact the extension author.
12+
13+
.. _report-issues:
14+
15+
Report Issues
16+
=============
17+
18+
{% if issuesUrl %}
19+
You can report issues at `{{ issuesUrl }} <{{ issuesUrl }}>`_.
20+
{% else %}
21+
No issue tracker is currently available.
22+
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.. _start:
2+
3+
{{ '='|repeat(projectName|length) }}
4+
{{ projectName }}
5+
{{ '='|repeat(projectName|length) }}
6+
7+
{{ description | default('No description provided.') }}
8+
9+
.. toctree::
10+
:glob:
11+
:titlesonly:
12+
:hidden:
13+
14+
*/Index
15+
Installation
16+
Configuration
17+
GetHelp
18+
*
19+
20+
.. card-grid::
21+
:columns: 1
22+
:columns-md: 2
23+
:gap: 4
24+
:class: pb-4
25+
:card-height: 100
26+
27+
.. card:: :ref:`Installation <installation>`
28+
29+
Explains how to install this extension in Composer-based and Classic
30+
TYPO3 installations.
31+
32+
.. card:: :ref:`Configuration <configuration>`
33+
34+
{% if siteSet %}
35+
Learn how to include the site set `{{ siteSet }}` and how to use settings
36+
to configure this extension.
37+
{% else %}
38+
Learn how to configure this extension.
39+
{% endif %}
40+
41+
.. card:: :ref:`Frequently Asked Questions (FAQ) <faq>`
42+
43+
These questions have been frequently asked.
44+
45+
.. card:: :ref:`How to get help <help>`
46+
47+
Learn where to get help and how to report issues you found.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
:navigation-title: Installation
2+
3+
.. _installation:
4+
5+
============
6+
Installation
7+
============
8+
9+
.. _installation-composer:
10+
11+
Install {{ projectName }} with Composer
12+
=======================================
13+
14+
Install the extension via Composer:
15+
16+
.. code-block:: bash
17+
18+
composer req {{ composerName }}
19+
20+
See also `Installing extensions, TYPO3 Getting started <https://docs.typo3.org/permalink/t3start:installing-extensions>`_.
21+
22+
.. _installation-classic:
23+
24+
Install {{ projectName }} in Classic Mode
25+
=========================================
26+
27+
{% if projectHomePage %}
28+
Or download the extension from `{{ projectHomePage }} <{{ projectHomePage }}>`_ and install it in
29+
the Extension Manager.
30+
{% else %}
31+
Or download the extension from the `TER <https://extensions.typo3.org/>`_ and install it in
32+
the Extension Manager.
33+
{% endif %}

0 commit comments

Comments
 (0)