diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a8659d..072f7ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: - name: Set up TeXLive uses: teatimeguest/setup-texlive-action@v2 with: - packages: scheme-basic latexmk listings + packages: scheme-basic latexmk listings float - name: Install run: | diff --git a/composer.json b/composer.json index be50812..92a2aa8 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "league/flysystem": "^1.0", "myclabs/php-enum": "^1.5", "samwilson/commonmark-latex": "^0.3", - "samwilson/commonmark-shortcodes": "^0.2", + "samwilson/commonmark-shortcodes": "^0.3", "samwilson/phpflickr": "^4.13", "symfony/console": "^5.0", "symfony/filesystem": "^5.4", diff --git a/composer.lock b/composer.lock index 0a5fc00..5a016fb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a1c1e42067f772941152875a605ac1bb", + "content-hash": "b75cbb989890df981c864de564acba08", "packages": [ { "name": "addwiki/mediawiki-api-base", @@ -1860,16 +1860,16 @@ }, { "name": "samwilson/commonmark-shortcodes", - "version": "0.2.1", + "version": "0.3.0", "source": { "type": "git", "url": "https://github.com/samwilson/commonmark-shortcodes.git", - "reference": "96a1b9d60eb635fe84ee36c1d2c405b2838c2480" + "reference": "78d3247ccf20d326fcefea9a682df28fb539bdc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/samwilson/commonmark-shortcodes/zipball/96a1b9d60eb635fe84ee36c1d2c405b2838c2480", - "reference": "96a1b9d60eb635fe84ee36c1d2c405b2838c2480", + "url": "https://api.github.com/repos/samwilson/commonmark-shortcodes/zipball/78d3247ccf20d326fcefea9a682df28fb539bdc5", + "reference": "78d3247ccf20d326fcefea9a682df28fb539bdc5", "shasum": "" }, "require": { @@ -1899,9 +1899,9 @@ "description": "Adds shortcodes to Markdown, for the CommonMark package.", "support": { "issues": "https://github.com/samwilson/commonmark-shortcodes/issues", - "source": "https://github.com/samwilson/commonmark-shortcodes/tree/0.2.1" + "source": "https://github.com/samwilson/commonmark-shortcodes/tree/0.3.0" }, - "time": "2023-04-17T05:44:56+00:00" + "time": "2023-06-26T01:25:17+00:00" }, { "name": "samwilson/phpflickr", @@ -1952,16 +1952,16 @@ }, { "name": "symfony/console", - "version": "v5.4.23", + "version": "v5.4.24", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c" + "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/90f21e27d0d88ce38720556dd164d4a1e4c3934c", - "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c", + "url": "https://api.github.com/repos/symfony/console/zipball/560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", + "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", "shasum": "" }, "require": { @@ -2031,7 +2031,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.23" + "source": "https://github.com/symfony/console/tree/v5.4.24" }, "funding": [ { @@ -2047,7 +2047,7 @@ "type": "tidelift" } ], - "time": "2023-04-24T18:47:29+00:00" + "time": "2023-05-26T05:13:16+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2118,16 +2118,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.23", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5" + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", "shasum": "" }, "require": { @@ -2162,7 +2162,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.23" + "source": "https://github.com/symfony/filesystem/tree/v5.4.25" }, "funding": [ { @@ -2178,7 +2178,7 @@ "type": "tidelift" } ], - "time": "2023-03-02T11:38:35+00:00" + "time": "2023-05-31T13:04:02+00:00" }, { "name": "symfony/finder", @@ -2245,16 +2245,16 @@ }, { "name": "symfony/intl", - "version": "v5.4.23", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "962789bbc76c82c266623321ffc24416f574b636" + "reference": "4c4cbf57c9623b55e7d19479488bd93fee68450a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/962789bbc76c82c266623321ffc24416f574b636", - "reference": "962789bbc76c82c266623321ffc24416f574b636", + "url": "https://api.github.com/repos/symfony/intl/zipball/4c4cbf57c9623b55e7d19479488bd93fee68450a", + "reference": "4c4cbf57c9623b55e7d19479488bd93fee68450a", "shasum": "" }, "require": { @@ -2313,7 +2313,7 @@ "localization" ], "support": { - "source": "https://github.com/symfony/intl/tree/v5.4.23" + "source": "https://github.com/symfony/intl/tree/v5.4.25" }, "funding": [ { @@ -2329,7 +2329,7 @@ "type": "tidelift" } ], - "time": "2023-04-13T10:36:25+00:00" + "time": "2023-06-19T09:28:43+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2825,16 +2825,16 @@ }, { "name": "symfony/process", - "version": "v5.4.23", + "version": "v5.4.24", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4b842fc4b61609e0a155a114082bd94e31e98287" + "reference": "e3c46cc5689c8782944274bb30702106ecbe3b64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4b842fc4b61609e0a155a114082bd94e31e98287", - "reference": "4b842fc4b61609e0a155a114082bd94e31e98287", + "url": "https://api.github.com/repos/symfony/process/zipball/e3c46cc5689c8782944274bb30702106ecbe3b64", + "reference": "e3c46cc5689c8782944274bb30702106ecbe3b64", "shasum": "" }, "require": { @@ -2867,7 +2867,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.23" + "source": "https://github.com/symfony/process/tree/v5.4.24" }, "funding": [ { @@ -2883,7 +2883,7 @@ "type": "tidelift" } ], - "time": "2023-04-18T13:50:24+00:00" + "time": "2023-05-17T11:26:05+00:00" }, { "name": "symfony/service-contracts", @@ -3265,16 +3265,16 @@ }, { "name": "twig/twig", - "version": "v3.6.0", + "version": "v3.6.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "106c170d08e8415d78be2d16c3d057d0d108262b" + "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/106c170d08e8415d78be2d16c3d057d0d108262b", - "reference": "106c170d08e8415d78be2d16c3d057d0d108262b", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", + "reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd", "shasum": "" }, "require": { @@ -3320,7 +3320,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.6.0" + "source": "https://github.com/twigphp/Twig/tree/v3.6.1" }, "funding": [ { @@ -3332,7 +3332,7 @@ "type": "tidelift" } ], - "time": "2023-05-03T19:06:57+00:00" + "time": "2023-06-08T12:52:13+00:00" } ], "packages-dev": [ @@ -3634,25 +3634,29 @@ }, { "name": "doctrine/deprecations", - "version": "v1.0.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -3671,9 +3675,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" }, - "time": "2022-05-02T15:47:09+00:00" + "time": "2023-06-03T09:27:29+00:00" }, { "name": "doctrine/instantiator", @@ -4345,16 +4349,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.5", + "version": "v4.16.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" + "reference": "19526a33fb561ef417e822e85f08a00db4059c17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", + "reference": "19526a33fb561ef417e822e85f08a00db4059c17", "shasum": "" }, "require": { @@ -4395,9 +4399,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" }, - "time": "2023-05-19T20:20:00+00:00" + "time": "2023-06-25T14:52:30+00:00" }, { "name": "phan/phan", @@ -4859,16 +4863,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.1", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "dfc078e8af9c99210337325ff5aa152872c98714" + "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dfc078e8af9c99210337325ff5aa152872c98714", - "reference": "dfc078e8af9c99210337325ff5aa152872c98714", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d", + "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d", "shasum": "" }, "require": { @@ -4911,28 +4915,30 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.2" }, - "time": "2023-03-27T19:02:04+00:00" + "time": "2023-05-30T18:13:47+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.20.4", + "version": "1.22.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd" + "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", - "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", + "reference": "ec58baf7b3c7f1c81b3b00617c953249fb8cf30c", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.5", @@ -4956,9 +4962,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.20.4" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.0" }, - "time": "2023-05-02T09:19:37+00:00" + "time": "2023-06-01T12:35:21+00:00" }, { "name": "phpunit/php-code-coverage", @@ -5280,16 +5286,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.8", + "version": "9.6.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e" + "reference": "a9aceaf20a682aeacf28d582654a1670d8826778" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/17d621b3aff84d0c8b62539e269e87d8d5baa76e", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a9aceaf20a682aeacf28d582654a1670d8826778", + "reference": "a9aceaf20a682aeacf28d582654a1670d8826778", "shasum": "" }, "require": { @@ -5363,7 +5369,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.8" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.9" }, "funding": [ { @@ -5379,7 +5385,7 @@ "type": "tidelift" } ], - "time": "2023-05-11T05:14:45+00:00" + "time": "2023-06-11T06:13:56+00:00" }, { "name": "roslov/psr12ext", @@ -6454,32 +6460,32 @@ }, { "name": "slevomat/coding-standard", - "version": "8.12.1", + "version": "8.13.1", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "f69e2524e8770efb9b3e5ac4a0ebc0d54eb446d7" + "reference": "a13c15e20f2d307a1ca8dec5313ec462a4466470" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/f69e2524e8770efb9b3e5ac4a0ebc0d54eb446d7", - "reference": "f69e2524e8770efb9b3e5ac4a0ebc0d54eb446d7", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/a13c15e20f2d307a1ca8dec5313ec462a4466470", + "reference": "a13c15e20f2d307a1ca8dec5313ec462a4466470", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": ">=1.20.0 <1.21.0", + "phpstan/phpdoc-parser": "^1.22.0", "squizlabs/php_codesniffer": "^3.7.1" }, "require-dev": { "phing/phing": "2.17.4", "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.15", + "phpstan/phpstan": "1.10.21", "phpstan/phpstan-deprecation-rules": "1.1.3", - "phpstan/phpstan-phpunit": "1.3.11", + "phpstan/phpstan-phpunit": "1.3.13", "phpstan/phpstan-strict-rules": "1.5.1", - "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.1.3" + "phpunit/phpunit": "7.5.20|8.5.21|9.6.8|10.2.2" }, "type": "phpcodesniffer-standard", "extra": { @@ -6503,7 +6509,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.12.1" + "source": "https://github.com/slevomat/coding-standard/tree/8.13.1" }, "funding": [ { @@ -6515,7 +6521,7 @@ "type": "tidelift" } ], - "time": "2023-05-15T21:42:25+00:00" + "time": "2023-06-25T12:52:34+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -6576,16 +6582,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.23", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "9a8a5b6d6508928174ded2109e29328a55342a42" + "reference": "82269f73c0f0f9859ab9b6900eebacbe54954ede" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9a8a5b6d6508928174ded2109e29328a55342a42", - "reference": "9a8a5b6d6508928174ded2109e29328a55342a42", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/82269f73c0f0f9859ab9b6900eebacbe54954ede", + "reference": "82269f73c0f0f9859ab9b6900eebacbe54954ede", "shasum": "" }, "require": { @@ -6594,7 +6600,6 @@ "symfony/polyfill-php80": "^1.16" }, "conflict": { - "phpunit/phpunit": "<5.4.3", "symfony/console": "<4.4" }, "require-dev": { @@ -6645,7 +6650,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.23" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.25" }, "funding": [ { @@ -6661,7 +6666,7 @@ "type": "tidelift" } ], - "time": "2023-04-18T09:26:27+00:00" + "time": "2023-06-20T20:56:26+00:00" }, { "name": "theseer/tokenizer", diff --git a/docs/content/content.md b/docs/content/content.md index 7940b39..7bab42b 100644 --- a/docs/content/content.md +++ b/docs/content/content.md @@ -45,17 +45,17 @@ see [the *Assets* section](index.html) of the documentation overview. ## Shortcodes This section documents 'shortcodes', which are what we call specific replacable parts in a Markdown document. -They are inline phrases or blocks of text such as `{foo}` or `{{{bar id=123}}}` which get replaced +They are inline phrases or blocks of text such as `{foo}` or `{{{bar|id=123}}}` which get replaced by the contents of templates such as `templates/shortcodes/foo.html.twig` or `templates/shortcodes/bar.tex.twig`. * Inline shortcodes are delimited by single braces and can contain any number of attributes, e.g.: * Lorem `{foo}` ipsum with no parameters. - * Lorem `{foo bar=baz bif="foo bar"}` ipsum with two parameters, the second of which contains a space. + * Lorem `{foo | bar=baz|bif="foo bar"}` ipsum with two parameters, the second of which contains a space. * Lorem `{foo bif}` ipsum with a parameter with no value. * Block shortcodes are delimited by triple braces at the beggining of lines, e.g.: * A block of one line, with one parameter: ``` - {{{quotation cite="Author name" + {{{quotation | cite="Author name" Lorem ipsum }}} ``` @@ -73,11 +73,11 @@ which has a [similar function](https://codex.wordpress.org/shortcode). Shortcodes are a simple way to include images, videos, and summaries of other web pages. For example, this is a photo from Wikimedia Commons: -{{{commons file=Co-Op,_Post_Office,_Courthouse.jpg }}} +{{{commons|Co-Op,_Post_Office,_Courthouse.jpg}}} It is added to the source Markdown with this: - {{{commons file=Co-Op,_Post_Office,_Courthouse.jpg }}} + {{{commons|Co-Op,_Post_Office,_Courthouse.jpg}}} All of the other information (image URL, caption, etc.) is retrieved from the Commons API when the Markdown is rendered. @@ -93,7 +93,8 @@ The file `templates/shortcodes/..twig` to contain the HT The following variables are available in shortcode templates: * `shortcode.name`: the name of the shortcode, which will always be the same as the template's name. -* `shortcode.attr('foo')`: fetches an attribute by name. +* `shortcode.attrs.foo`: fetches an attribute by name. +* `shortcode.attrs.1`: fetches an unnamed attribute by number (starting from 1). * `shortcode.body`: for block shortcodes, fetches the entire body text. ### Example: Wikimedia Commons @@ -122,11 +123,11 @@ Note that this is also using the `commons()` Twig function, which is [documented In any Markdown file: - {{{flickr id=123456}}} + {{{flickr|id=123456}}} In `templates/shortcodes/flickr.html.twig`: - {% set flickr = flickr(shortcode.attr('id')) %} + {% set flickr = flickr(shortcode.attrs.id) %}
An image from Flickr. @@ -145,4 +146,3 @@ In `templates/shortcodes/flickr.html.twig`:
- diff --git a/docs/templates/pdf.tex.twig b/docs/templates/pdf.tex.twig index fbd699c..919821d 100644 --- a/docs/templates/pdf.tex.twig +++ b/docs/templates/pdf.tex.twig @@ -1,7 +1,12 @@ {% autoescape 'tex' %} \documentclass[a4paper]{article} -\usepackage{graphicx, url, listings} +\usepackage{graphicx, url, listings, float} + +\lstset{ + basicstyle=\normalsize\fontencoding{T1}\ttfamily, + showstringspaces=true +} \title{Basildon} diff --git a/docs/templates/shortcodes/commons.html.twig b/docs/templates/shortcodes/commons.html.twig index 5d52a4a..a5c6dc6 100644 --- a/docs/templates/shortcodes/commons.html.twig +++ b/docs/templates/shortcodes/commons.html.twig @@ -1,4 +1,4 @@ -{% set commons = commons(shortcode.attr('file')) %} +{% set commons = commons(shortcode.attrs.1) %}
diff --git a/docs/templates/shortcodes/commons.tex.twig b/docs/templates/shortcodes/commons.tex.twig index 44f82ec..d42b4d8 100644 --- a/docs/templates/shortcodes/commons.tex.twig +++ b/docs/templates/shortcodes/commons.tex.twig @@ -1,6 +1,6 @@ {% autoescape 'tex' %} -{% set commons = commons( shortcode.attrs.file ) %} -\begin{figure} +{% set commons = commons( shortcode.attrs.1 ) %} +\begin{figure}[H] \begin{center} \includegraphics[width=\linewidth]{{ '{' }}{{ tex_url( commons.imageinfo.0.thumburl )|raw }}{{ '}' }} \caption{ {{ commons.labels.en.value }} } diff --git a/example/content/2020/0116_lorem.txt b/example/content/2020/0116_lorem.txt index bab7ab2..53eebc4 100644 --- a/example/content/2020/0116_lorem.txt +++ b/example/content/2020/0116_lorem.txt @@ -12,4 +12,4 @@ This is a second post in January. With a goat! -{{{commons file=RoveZiege_00037.jpg}}} +{{{commons|file=RoveZiege_00037.jpg}}} diff --git a/tests/test_site/content/shortcodes.txt b/tests/test_site/content/shortcodes.txt index 38c0066..907d72c 100644 --- a/tests/test_site/content/shortcodes.txt +++ b/tests/test_site/content/shortcodes.txt @@ -1,3 +1,3 @@ Test shortcodes. A file from Wikimedia Commons: -{{{commons file=Test.png}}} +{{{commons |file=Test.png }}} diff --git a/tests/test_site/templates/shortcodes/commons.html.twig b/tests/test_site/templates/shortcodes/commons.html.twig index a911b4e..55932be 100644 --- a/tests/test_site/templates/shortcodes/commons.html.twig +++ b/tests/test_site/templates/shortcodes/commons.html.twig @@ -1,3 +1,3 @@
-This is Commons file {{shortcode.attr('file')}} +This is Commons file {{shortcode.attrs.file}}