-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
BBCode writer #11242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
BBCode writer #11242
Conversation
phpBB
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Some comments:
-
I would suggest just having one bbcode template. (They are all the same anyway.) See https://github.com/jgm/pandoc/blob/main/src/Text/Pandoc/Templates.hs#L117-L122 for how to handle this. Would also need to remove the lines for them from pandoc.cabal.
-
No need to update the README.md. This is done by an automatic script prior to the release. (See the first line of the file.)
-
It's a lot of test files. If there are just a few differences between the format variants, I'd prefer to have one writer.bbcode and tables.bbcode, and then maybe some command tests or Haskell tests in test/Tests/Writer/BBCode.hs that check the variant behavior on these differences.
|
Not ready for review, I addressed 1--3 only, newlines are still on the list. Would like to support xenforo before PR gets merged too. In the meantime I wanted to ask whether I need to put module description like this one: {- |
Module : Text.Pandoc.Writers.Org
Copyright : © 2010-2015 Puneeth Chaganti <[email protected]>
2010-2025 John MacFarlane <[email protected]>
2016-2025 Albert Krewinkel <[email protected]>
License : GNU GPL, version 2 or above
Maintainer : Albert Krewinkel <[email protected]>
Stability : alpha
Portability : portable
Conversion of 'Pandoc' documents to Emacs Org-Mode.
Org-Mode: <http://orgmode.org>
-}with my name/email in the beginning of the modules I create? I noticed they appear in most modules (at least |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more things I noticed.
Silly me missed the "auto-generated" part because I looked (`rg`) where was Vimdoc mentioned and added bbcode nearby
Should not change anything under normal circumstances, but helps when rendering BlockQuote inside [un]ordered list for FluxBB
Huzbilla doesn't mention [li] in the docs, it also supports different styles for ordered lists.
Add tests for BBCode flavors other than default && remove golden tests for flavors other than default
also grouped `bbcode*` in the test module
- render table captions for formats that do not support tables - eta reduce renderTableGeneric
|
Fixed missing newline issues, captions are now rendered too (even for omitted Added support for xenForo, refactored Rendered bbcodephpBBFluxBBSteamWriterTablesHubzillaWriterFootnotes got trimmed because screenshot length exceeded what firefox allowed and I was too lazy to stitch it together (there is nothing interesting down below) TablesxenForoI used demo to render these WriterThis time the problem was the opposite, xenForo didn’t allow post to exceed 10k characters, and TablesFootnotes
|











Hello,
The PR adds support for 5 BBCode flavors:
The flavor described at bbcode.org is not implemented in full anywhere, but it is what default writer (
bbcode) spits out, which I think is a reasonable collection of tags.The writer is extensible by users of Pandoc the library, because most forums using BBCode (except Steam’s, which doesn’t allow self-hosting) can be augmented with more tags. Since the Writer can be extended, there is a fair amount of haddock docs in place..
Golden files are not enough to see how BBCode looks like, so I attached HTML and images of rendered HTML on forums using respective flavors. The platforms are:
Although I started writing the PR after reading #7455, I forgot about xenforo, so not sure whether the issue can be closed.
Disclosure: I used Codex (the CLI AI assistant tool) to prototype implementation. Everything was reviewed by me and iterated upon manually.
FluxBB
rendered contents (image)
rendered contents (html)
Hubzilla
Writer
Formatting failed here, trying to fix it made prettier confused and it truncated most of the document, hence pasting without formatting.
rendered contents (image)
rendered contents (html)
Tables
rendered contents (image)
rendered contents (html)