Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [workflow_dispatch, push, pull_request]

jobs:
run:
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@main
uses: flarum/framework/.github/workflows/REUSABLE_backend.yml@2.x
with:
enable_backend_testing: false
enable_phpstan: true
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/frontend.yml

This file was deleted.

16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

A [Flarum](http://flarum.org) extension. Details BBCode for Flarum. Original by @sijad.

![screenshot](https://i.imgur.com/mmtCS3M.png)

### Installation

Use [Bazaar](https://discuss.flarum.org/d/5151-flagrow-bazaar-the-extension-marketplace) or install manually with composer:
Expand All @@ -20,6 +18,20 @@ composer require fof/bbcode-details
composer update fof/bbcode-details
```

### Usage

Use the following BBCode in your posts:

```
[details="Summary text here"]Hidden content here[/details]
[details title="Summary text here"]Hidden content here[/details]
[details]Hidden content with no summary[/details]
```

You may optionally also provide the `open=` attribute to mark as open by default. The `name=` attribute may be used to provide a unique identifier for the details block (which can be used to only open one details block at a time in a group).

<img src="https://i.imgur.com/mmtCS3M.png" width="300" loading="lazy" alt="screenshot" />

### Links

- [Packagist](https://packagist.org/packages/fof/bbcode-details)
Expand Down
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.2.0"
"flarum/core": "^2.0.0"
},
"authors": [
{
Expand All @@ -28,7 +28,7 @@
},
{
"name": "David Sevilla Martín",
"email": "david.s@redevs.org",
"email": "me+fof@dsevilla.dev",
"role": "Developer"
},
{
Expand All @@ -55,23 +55,22 @@
"color": "#fff"
}
},
"flagrow": {
"discuss": "https://discuss.flarum.org/d/18796"
},
"flarum-cli": {
"modules": {
"githubActions": true
}
}
},
"require-dev": {
"flarum/phpstan": "*"
"flarum/phpstan": "^2.0.0"
},
"scripts": {
"analyse:phpstan": "phpstan analyse",
"clear-cache:phpstan": "phpstan clear-result-cache"
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"
}
},
"minimum-stability": "beta",
"prefer-stable": true
}
23 changes: 19 additions & 4 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,29 @@

return [
(new Extend\Frontend('forum'))
->css(__DIR__.'/less/forum.less')
->js(__DIR__.'/js/dist/forum.js'),
->css(__DIR__.'/less/forum.less'),

(new Extend\Formatter())
->configure(function (Configurator $configurator) {
$configurator->BBCodes->addCustom(
'[DETAILS title={TEXT1;optional}]{TEXT2}[/DETAILS]',
'<details><summary>{TEXT1}</summary><div>{TEXT2}</div></details>'
'[DETAILS title={TEXT1;optional} open={ANYTHING?} name={SIMPLETEXT?}]{TEXT2}[/DETAILS]',
<<<'XML'
<details class="bbcode-details">
<xsl:copy-of select="@name"/>

<xsl:if test="@open">
<xsl:attribute name="open">open</xsl:attribute>
</xsl:if>

<xsl:if test="string-length(normalize-space(@title)) &gt; 0">
<summary>{@title}</summary>
</xsl:if>

<div>
<xsl:apply-templates/>
</div>
</details>
XML
);
}),
];
2 changes: 0 additions & 2 deletions js/dist/forum.js

This file was deleted.

1 change: 0 additions & 1 deletion js/dist/forum.js.map

This file was deleted.

1 change: 0 additions & 1 deletion js/forum.js

This file was deleted.

Loading