Author Support 2,069 members · 4,370 stories
Comments ( 8 )
  • Viewing 1 - 50 of 8

If you are like me, sometimes BBCode is just not the way you like to write things. Maybe you use MS Word, or something else, but it gets to be a pain needing to go back through and add BBCode tags everywhere so it is formatted right. So I have a solution!

I have created a custom writer for Pandoc that converts files into FimFiction compatible BBCode. If you don't know what Pandoc is, it is a document converter that can take files in several formats (Markdown, HTML, Docx, a bunch more) and convert them into even more formats, including (now) FimFiction BBCode.

To use it, you need Pandoc (which you can find HERE). Pandoc is a fair sized program with a lot of options, which you can read about on its website there. Pandoc is a command-line program, so you have to be able to run things from a command prompt. Unfortunately, there aren't a lot of useful GUI programs for Pandoc you can use to convert files from a window or file manager.

Once you have Pandoc, go and get my custom writer HERE. In that zipfile is the script itself (fimfic.lua) and a README that explains how to use the script and how to customize a few options. You can also find the README online at the main page for the script, HERE.

Anyone comfortable with the command line, please try out the script, and see how well it converts files to BBCode. I'll be watching this thread to answer questions about it, and try to fix any issues that might come up.

Thanks

Nice! This is a great idea. I've written my fics in .RTF files using Open Office with all the tacky-looking bbcode tags thus far, so I'm used to the hassle, but, if the converter is ever made compatible with .DOC files, I'll start to save my fics in that format and try it out. I don't know what challenges there might be for dealing with .DOC files across multiple editor programs and platforms, but that would greatly improve usability for those of us without MS Word.

Edit:
On second thought... maybe I could just convert to DOCX from RTF using Pandoc, and then convert to Fimfic BBcode. Could Pandoc do that?

Bronymaster
Group Admin

3826844

On an unprofessional note, I don't know how many people are going to be comfortable using the command line here. While I have seen a surprising number of power-users and programmers/sysadmins/dba's/etc. throughout fimfiction (odd, but perhaps not as odd as other statistics...), I don't think the vast majority are comfortable using the command line. Some may not even know what it is.

Or maybe I'm vastly underestimating the computer knowledge of the average author on Fimfiction.

Of course, I'm also under the impression that most authors use Google Documents, which Fimfiction already has a built-in function for extracting and converting, assuming the document is open.

3827477 Pandoc cannot read RTF, unfortunately. :fluttershbad: However, recent versions of OpenOffice (or, at least, LibreOffice) can save as DOCX directly, or you can save as HTML, which Pandoc can also read. Oh, and bear in mind, if Pandoc can read it, it can write straight to BBCode. There would be no need to convert to another format in between.


3827607 Yeah, I considered that. I was hoping there was a GUI wrapper for Pandoc that would allow the use of custom writers, but I couldn't find anything. An online converter would be cool, too, but way outside my abilities at the moment.

3828465 It appears Open Office requires a plugin to save DOCX files on Windows, but HTML certainly works. :pinkiehappy:

Bronymaster
Group Admin

3828465

I'd be interested in writing a front-end for it myself, but I'm not very experienced with Pandoc, and have my own projects in place at the current time...

It's very tempting, though. At least starting with .docx as a base, it doesn't seem like it would be that hard to make your own converter and then slap a very simple front-end on it that consists of the bare minimum window that might as well be a dialogue, and using the system's file dialogue itself. And as far as I'm aware, .docx is simply a zip file, and the actual text is contained in an xml file called document.xml. Assuming you could strip away the XML...

See what you've done? Now I'm probably going to have to go write this thing, just to keep myself happy. :rainbowlaugh:

An online converter would be cool, I agree. I'd build it, but my domain isn't web programming. Mostly just a desktop developer here.

Still, interesting stuff you got there. I didn't understand much of the code myself, being unfamiliar with Lua.

Have a fantastic day! :twilightsmile:

3828957 Yeah, I know what you mean. Pandoc itself is written in Haskell, and I can't make heads or tails of it. Haskell is weird. The Lua script I wrote only defines what BBCode output should look like, all the rest of the conversion is done by Pandoc.

The creator of Pandoc has an online "try it now" widget on his web page. I'm wondering how hard it would be to adapt it to allow uploading files and using custom writers. Even then, though, I don't have any web space, and anything that would allow using a program like that is probably out of my meager budget at the moment. Le sigh.

I know I am a little bit late to the discussion, but there is a plugin for Sublime that allows you to use it as a HUD for Pandoc: https://packagecontrol.io/packages/Pandoc
I don't know if you can use it to add extra command line switches out of the box, but it shouldn't be hard to do.

  • Viewing 1 - 50 of 8