Skip to content

Commit

Permalink
[TASK] Move code-snippet creation to new tool (#277)
Browse files Browse the repository at this point in the history
Co-authored-by: lina.wolf <lwolf@w-commerce.de>
  • Loading branch information
linawolf and linawolf committed Jun 23, 2022
1 parent 5426fd2 commit e1daabb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
@@ -1,6 +1,8 @@
.. Automatic screenshot: Remove this line if you want to manually change this file
.. Generated by https://github.com/linawolf/t3docs_restructured_api_tools
.. Extracted from typo3conf/ext/examples/Configuration/TSconfig/Page/Mod/csvExport.tsconfig
.. code-block:: typoscript
:caption: EXT:examples/Configuration/TSconfig/Page/Mod/csvExport.tsconfig
mod.web_list {
csvDelimiter = ;
Expand Down
@@ -1,6 +1,8 @@
.. Automatic screenshot: Remove this line if you want to manually change this file
.. Generated by https://github.com/linawolf/t3docs_restructured_api_tools
.. Extracted from typo3conf/ext/examples/Configuration/TSconfig/Page/Mod/noExportRecordsLinks.tsconfig
.. code-block:: typoscript
:caption: EXT:examples/Configuration/TSconfig/Page/Mod/noExportRecordsLinks.tsconfig
mod.web_list {
noExportRecordsLinks = 1
Expand Down
20 changes: 20 additions & 0 deletions Documentation/CodeSnippets/codesnippets.php
@@ -0,0 +1,20 @@
<?php
// https=>//github.com/TYPO3-Documentation/t3docs-codesnippets
// ddev exec vendor/bin/typo3 restructured_api_tools:php_domain public/fileadmin/TYPO3CMS-Reference-TSconfig/Documentation/CodeSnippets/

return [
[
'action' => 'createCodeSnippet',
'sourceFile' => 'typo3conf/ext/examples/Configuration/TSconfig/Page/Mod/csvExport.tsconfig',
'targetFileName' => 'PageTSconfig/Mod/CsvExport.rst.txt',
'caption' => 'EXT:examples/Configuration/TSconfig/Page/Mod/csvExport.tsconfig',
'language' => 'typoscript',
],
[
'action' => 'createCodeSnippet',
'sourceFile' => 'typo3conf/ext/examples/Configuration/TSconfig/Page/Mod/noExportRecordsLinks.tsconfig',
'targetFileName' => 'PageTSconfig/Mod/noExportRecordsLinks.rst.txt',
'caption' => 'EXT:examples/Configuration/TSconfig/Page/Mod/noExportRecordsLinks.tsconfig',
'language' => 'typoscript',
]
];
13 changes: 3 additions & 10 deletions Documentation/screenshots.json
Expand Up @@ -5,9 +5,7 @@
"_default": [
{"action": "resizeWindow", "width": 1024,"height": 768},
{"action": "setScreenshotsImagePath","path": "Images/AutomaticScreenshots"},
{"action": "setScreenshotsRstPath","path": "Images/AutomaticScreenshots"},
{"action": "setCodeSnippetsSourcePath","path": "typo3conf/ext/styleguide"},
{"action": "setCodeSnippetsTargetPath", "path": "CodeSnippets"}
{"action": "setScreenshotsRstPath","path": "Images/AutomaticScreenshots"}
],
"fields": [
{"include": "_default"},
Expand Down Expand Up @@ -40,9 +38,7 @@
"_default": [
{"action": "resizeWindow", "width": 1024,"height": 768},
{"action": "setScreenshotsImagePath","path": "Images/AutomaticScreenshots"},
{"action": "setScreenshotsRstPath","path": "Images/AutomaticScreenshots"},
{"action": "setCodeSnippetsSourcePath","path": "typo3conf/ext/examples"},
{"action": "setCodeSnippetsTargetPath", "path": "CodeSnippets"}
{"action": "setScreenshotsRstPath","path": "Images/AutomaticScreenshots"}
],
"fileListExport": [
{"include": "_default"},
Expand Down Expand Up @@ -74,10 +70,7 @@
"captionText": "The list module without export buttons after activating the single-table mode"
},
{"action": "switchToMainFrame"},
{"action": "click", "link": "button.t3js-topbar-button-modulemenu"},
{"action": "setCodeSnippetsTargetPath", "path": "CodeSnippets/PageTSconfig/Mod"},
{"action": "createCodeSnippet", "sourceFile": "Configuration/TSconfig/Page/Mod/csvExport.tsconfig", "targetFileName": "CsvExport", "language": "typoscript"},
{"action": "createCodeSnippet", "sourceFile": "Configuration/TSconfig/Page/Mod/noExportRecordsLinks.tsconfig", "targetFileName": "noExportRecordsLinks", "language": "typoscript"}
{"action": "click", "link": "button.t3js-topbar-button-modulemenu"}
]
}
}
Expand Down

0 comments on commit e1daabb

Please sign in to comment.