The Writers' Group 9,260 members · 56,001 stories
Comments ( 124 )
  • Viewing 1 - 50 of 124
TigeR #1 · Feb 2nd, 2017 · · 1 ·

I've written a little userscript tool that might be helpful to all writers using Google Docs: A usable Google Docs Importer. The days of copy-pasting links is over!

I've recently dabbled with writing again, and took a look at the Google Docs importer. It totally ruined my formatting, and I thought it was probably easier to just copy-paste the text as-is. Since this is an ugly solution, I've decided to write a tool that does the importing for me, and maybe help other writers with it as well - hence this post.

What it does:
This userscript totally cuts out the standard Google Docs importer. Instead, a nice Google document picker window is shown with the documents in your Drive. You just click on your chapter document and open it. Additionally, my importer tries to respect the formatting of the Google document as best as possible. What works? Paragraphs, centering paragraphs, bold, italic, underline, strikethrough, text size and color, horizontal lines and even links and images. I couldn't find a way till now for YouTube videos, quotes, spoilers and smileys, though.

Requirements:
Since this is a userscript, it requires the addon Tampermonkey or a similar userscript addon to run. It should run on both Firefox and Chrome, though, maybe more browsers with addon support.
You also have to be logged in to Google so you can browse your Drive (obviously).

Disclaimers:
This software is pretty much in beta state. There are probably some bugs inside, you have been warned.
Also, since accessing Google Drive requires access to sensitive information, I've had to register an app key with Google. This means I'm able to view how many times the Importer is used, but NOT what it is used on. This tool does not give me access to your documents.
Or, if you are a bit technically inclined, you can exchange the app key for your own, since this userscript is open source!

Known Bugs:
For a list of known bugs, visit GitHub issues.

Download and Installation:
Krickis has written this awesome guide on how to install and use this script, please visit his blog on how to use the Better Document Importer!

The download can be found on GitHub (preferred) and OpenUserJS.
The source code is at GitHub.

(If Knighty reads this: firstly, hello! and secondly, feel free to use any of this for an official implementation!)

Holy crap. If this works as well as you're saying, you might have something here that can get baked into the site itself.

Hm. I can see the usefulness, but not for the way I have to work multi-chapter stories. If I keep all my chapters in separate documents, I can't edit 'down' them, or make changes (oops, I misspelled Fred's name as Ferd everywhere) or make them all logically consistent, so I have one large document with "Begin Chapter 1" "End Chapter 1, Begin Chapter 2" tags through it. To move a chapter (like 9) into Fimfiction, I:
Control-F 'Chapter 9' (click) (next) Shift-Click Control-C and paste into Fimfiction.

If there were a macro that said "Highlight everything between but not including "Search String" and copy into the Windows clipboard" that would be great for me.

5775064 I had something like this in mind for a future version. It should be perfectly doable to detect headings in the document and put a question up which chapter should be used (or even all at once). I wanted to get it properly working first, though :twilightsmile:

5775013
:rainbowderp:

I have been complaining about the Fimfiction gdocs importer for as long as I've been writing horse words. Thank you, sir, for putting this together.

5775013 yeah, I can't help but question why it adds:

[/ center][/ b][/ i][ i][ b][ center] minus the spaces, throughout the literal entirety of the import. It makes it ten times harder to find the actual formatting and even sometimes interferes with it. Usually, I just write the story, add the format when done, and the post into the FimFic bit. Which, sadly enough, has better suggestions the Drive does.

Um... Am I the only person who just types BB code formatting into the raw text of the doc then Ctrl+C Ctrl+V's the text from Gdocs into the text editor here? >.>

5775064

Yeah, I have the same problem, especially as I rarely work from beginning to end, but bounce around all over the story as I'm writing.

It would be nice if there was an importer feature that could interpret GDoc page breaks as chapter breaks, and insert them accordingly. That way all I'd have to do is go back and edit chapter titles.

5775209
I've been doing the same thing for a little bit now. I used to use the import, but after a few messups with formatting, I started to type the code into it.

5775209 That is exactly how I do it. Also, if you choose to type in all the BBC into the doc instead of using the formatting options in the doc, when you import with the normal importer, it all comes out fine.

I haven't played with the tool mentioned in the OP, but I wanted to mention that there's a direct Google Docs Addon available. The only bad part I've noticed is that it doesn't handle images at all and it doesn't do indents. You'll definitely want to double check stuff (but you should do that anyway :raritywink:)

Sounds like the OP does far more though. (I'll be checking that for the next chapter of Bards)

Google Docs BBCode Export Addon

5775013 TigeR, TigeR, coding right...

This sounds pretty amazing honestly. I've been trying to figure out how to work around this myself and lo and behold someone came up with an awesome idea! Since I don't know how to install stuff like this, not to mention paranoid, I'll probably have the link kept as a favorite for now since I don't need to upload things probably for the next few days.

Thanks again for the solution! :moustache:

-Zeke

This is nice for those that wish to still be able to use importing.

For me though, copy/paste is just annoying.

By the by, this is the second time that this particular issue has cropped up. Is this something on Google's side, or is it on fimfiction's side?

5775209

When I saw that it was adding those ridiculous extra tags and messing up the formatting again, I went back to copy/paste.

So no, you're not alone in that.

Hope they fix it though; having to copy/paste is really annoying.

HapHazred
Group Admin

5775013 I'm going to sticky this for a bit, at least, since it looks super helpful.

Cheerio, mate.

5775335 I've actually been doing that since I first used the import feature a year ago and it decided "Meh, these randomly selected paragraphs are not important." Honestly, I have no idea why its even there >> Copy paste exists and you have to copy paste the doc's URL anyways. It's not like you get to choose the doc you want with a GUI. It's an unnessicary feature.

Man, it's scary that I am possibly the only one who writes draft on both the Notes from my iPad and Notepad on my computer.

5775397 I had written my first story doing exactly that , but GDocs allows for much better collaboration opportunities in my opinion, and it's a word processor, so it's a lot better than notes in most aspects.

5775013
Christ on a stick! I am soooo happy to see something like this... sad thing I've gone from using the import recently to just writing in the coding :raritydespair: but if this import business gets fixed or I somehow manage to use this, then hours of reformatting be over!
Because holy shit I am sick of the messed up import system.

For Chrome users (for when it says Chrome can't use this userscript): BBCode Export Add-On for Google Docs

I've been using it for my own stories recently. There are some downsides, such as it not being able to export the code for any centered or reversed paragraphs you may have. You would still have to do it manually here on Fimfiction, but it does the job quite nicely. It's a simple copy and paste thing.

If anyone's wondering how to use it:

1. Download and Install
2. Go to GDocs (Obviously)
3. Go to the Add-Ons tab in GDocs
4. Hover the pointer or click "BBCode Export"
5. There's two options: Convert the whole document, or Convert selected text.

I'm sure you can figure it out from there. Cheers!

5775209 Nope, I've been doing it for ages. Problems only arise if I forget to add a / in the end coding and the whole thing comes up in italics or whatever the code was afterward, but it's an easy fix. I'll honestly probably stick to that since I'm used to writing with the code now, but this new importing method sounds like it could be amazingly helpful.

5775482 You'd think so, but it's super glitchy. I've had it ad random blank lines, drop paragraphs... Tiz not a good methods.

Not something I would have a use for, but I can see the convenience for some folks. Neat idea :twilightsmile:

Will this be a problem for those of us that have to write on tablets or phones?

:pinkiegasp:
A stickied thread? A banner on the top of FiMFiction? Wow, thanks all, this is a wonderful birthday present for me :pinkiehappy:! I didn't think it would be this big when I woke up this morning.

I want to add, if you have issues, something is not working et cetera, could you please make a ticket on GitHub? This makes it easier for me to track everything.

5775208 Achievement GET :rainbowdetermined2:

5775506 Have you reloaded the page after logging in, did it work then? If not it did, this is a known bug. Sadly, the Google documentation on authentication is a bit all over the place.

5775466 Do you know more about why Chrome might reject userscripts? I didn't encounter anything like that. Feel free to make a ticket about that on GitHub, as well.

how does this work again?

5775013
As mentioned, there is a BBCode exporter plugin for GDocs... though I guess yours will have support for indented / spaced out paragraphs?

(though fimfic itself seems to have a bug that causes two open lines between paragraphs to appear identical to one open line. You need three to see a difference :facehoof:)

5775863 Honestly, I'm not an ultimate tech spot like some other people, so I don't know why.

All I do know is, upon downloading the file, it gave me a status bar that said Chrome can't use or install files like this userscript. Your guess is as good as mine.

5775863
First off, happy birthday :yay: Here it's your birthday, and yet you've given all of us a present :rainbowkiss: Hope it's been a good one for you.

Secondly (and I do hope you wait until after your birthday to worry about this), I'm having the same problem as Jowijo. I create a chapter, hit the import Gdoc button, then log into Google. It pops back up with the same login screen, and I reload the page as per the instructions. Wait for the page to fully load, hit the import Gdoc button, and it just goes back to the login. Repeated the login/refresh thing a few times for good measure.

I dunno what kind of information is relevant to you, so I'll just try to cover anything I can think of that might help you understand why this problem is popping up on my end. I'm using Google Chrome, with nothing special about my browser (I'm good enough with computers to follow directions without needing them dumbed down, but this is the first time I've ever used anything to modify the default internet experience). I'm automatically signed into Google on my computer, so I was signed in when I first attempted to use your script. I'm using Tampermonkey, as per your suggestion. I'll gladly try any fixes on my end if you can think of anything that might help.

As a final note, I'm wondering if it would be possible to make this work with published stories as well? I recently re-edited an already published story, and was going to just import over the existing chapters, but the script only works for new chapters. I understand why it doesn't, since the script applies to URLs with fimfiction.net/chapter in the name, whereas published chapters use the fimfiction.net/story URL. I thought about playing around with the code to see if I could figure out how to get it to apply to both URLs, but A) I know nothing about user scripts and exceedingly little about coding, and B) I dunno if that would mess with other things on pages with a fimfiction.net/story URL (certainly not something I want to mess up due to my ignorance).

Above all, thank you again for making this. Even if I can't get it to work, it does seem to be a wonderful tool :twilightsmile:

5777475 Thanks for the detailed report! I'll look into it in a bit. Good catch with the already published chapters as well. If everything goes well, I hope to push a new version this evening.

I can't get this to work... Chrome won't install it, and it won't install offline either.

I found a BBCode plugin for Docs that's actually in the Chrome Web Store. There's only one of them. It isn't perfect but it will have to do.

5775506
5777475
I've published version 0.2 where I've rewritten the authentication code completely. Could you update the script and try if it works for you now?

5779357
Thank you for working on a fix so quickly :scootangel:

The script works now, bringing up the document picker properly. The first time I brought it up it asked for access to my Drive, something it hadn't done before (I'm guessing the problem was something to do with that; it never got access to Drive because it had never asked for it).

Did notice a few oddities with bringing over the doc, though. I use indentations on paragraphs (printed book style) in docs, which was removed during the import. This isn't a big deal since it's easy enough to just ctrl+a to highlight everything and use Fimfiction's indent text option. In place of the indented text, it added an extra line of space in between paragraphs (general online publication style). This is also not a big deal because I happen to do that manually when I bring chapters over to Fimfiction (yes, I know I'm highly odd). So this was on oddity, but honestly it works out to be more convenient for me :twilightsheepish:

The other oddity I noticed was that it added a [ a][ b] (sans spaces) at one random place. Made the majority of the chapter bold text, but it was very easy to find and remove (just ctrl+f searched for the [ character).

Aside from that, things seem to be working fine. Carried over the rest of the formatting very well (confirmed italics, bold, text size, centered text, and images all carry over). All in all a big improvement over the way the import feature had been working, so thank you once again :yay:

5775013
Whoa, thanks for the update! It actually works for me now! Also, I love you for converting paragraph lines on GDocs into actual spaces on FimFiction.

I have absolutely NO IDEA how this works. There is no tutorial and the one in the comments doesnt get me anywhere.
Could someone PLEASE tell me how I use this converter?

Okay, so I've tried to download this to post a chapter of something onto FIMfiction, but I've already hit a few problems. I'm not at all technically inclined, or at least not when it comes down to coding and userscripts, so when I saw this I thought it was a simple 'install into google docs' and that would be it. Here's where this part is throwing me off:

Since this is a userscript, it requires the addon Tampermonkey or something similar to run. It should run on both Firefox and Chrome, though.

Does this mean that if I have Firefox that I don't need an add-on like Tampermonkey, or does this mean that since I use Firefox that getting an add-on is all that I need to do for the script to start working?

This is a dumb question, I know, but I need to ask it regardless. Also, if anyone could put up a simple step process for those of us on Firefox, someone has already put up steps for Chrome, that would be great. Thank you,

-Zeke

5781058
5781876
This is the first time I've used anything like this myself, and I'm not at all familiar with the ins and outs of userscripts. That said, I'll do my best to help.

1. A userscript is not exactly a standalone program, so it requires an add on to your internet browser to run. That's what Tampermonkey is. Go to their website and select your internet browser, then download. On Chrome, the installation process was basically just clicking install and accepting the terms.

2. From there, you can follow the link to add this script. Copy-pasted here for convenience. Click install and it'll bring you to a page that displays the script's code. Click install again on this screen, and you're good to go.

3. On Fimfiction, go to an unpublished chapter. If you don't have one, make one (needs to be an unpublished chapter). Click the 'import Gdoc' button and it should pull up a window where you log in to Google if you aren't, or give the userscript access to Google Drive if you are. From there, just select the document you want to import.

Hope this is helpful :twilightsmile:

5782117 Thank you! I got it up and running now! I was wondering why nothing happened when I clicked install on the actual script page.

As for the actual script itself it spaces out each passage one extra time and it doesn't indent anything either, but those are just nitpicks that I can get over. Thanks for the help and thank you 5775013 for making the code to begin with!

-Zeke

5782117
Well thanks. It works now. But unforutnately, it still doesn't have the same format as all my other chapters already published on fimfiction. Now, it is pasting the formating in too close to the original, which would basically force me to adapt every single chapter of every single story i have thusfar published to this new format. That is even more work, sadly. So I guess I wont use it.

It was easy to set up (for someone with a very superficial understanding of user scripts) but the formatting is totally wrong for me (however, the nice window where I pick a document rather than insert a link is there, so I'm not just accidentally using the old one). Maybe it has something to do with using Opera instead of Chrome or Firefox...

Adding this to the bug list on GitHub, but posting it here as well for anyone checking this forum for the same problem.

I figured out what was going on with that issue I mentioned the other day with the random [ a][ b] tags appearing in my chapter upon import. They appear wherever there is an unresolved comment in the Gdoc. Interestingly, these go through the alphabet in sequence. So wherever the first comment is in the Gdoc will have the [ a][ b] appearing in the chapter text, while the second comment will have [c][d] tags and the third will have [e][f], so on and so forth.

This is all very easy to find with a ctrl+f search, especially knowing it's always two tags in alphabetical order, so it's really not a problem. Just do a ctrl+f search for [ a][ b] (without the spaces), then [c][d] and so on. If you don't use a lot of formatting in your docs, you could just search for the [ character and find all the tags at once (I prefer doing them individually, just so I don't have to go through seventy-two instances of the [ i] tag)

I.m getting a 429 error. I clicked install, it did something weird, didn't install it, now I keep getting a 429 error. Help.

Never mind, I was being dumb. Never used Tampermonkey until now.

Okay, I went to my chapter, wanted to import a gdoc and it gave me the old importer. What is happening?

5785749 That probably means that either Tampermonkey or the new Importer isn't running properly. Try and see if the instructions here can help you.
Specifically, check if you have the Tampermonkey icon in your browser bar; that if you click on the Tampermonkey icon and open the overview that there is an entry for the Better Document Importer; and that this entry is not deactivated. You also have to reload the chapter page after you activated everything. Hope this helps.

5786308 *Hugs* IT WORKS!!! :pinkiehappy:

The chapter has to be unpublished. That's what I was getting wrong.

5787151 Ah, yes, that is a known bug. I'm planning on a 0.3 release by sunday, where I fix a few bugs. With that version the importer should also work with already published chapters.

  • Viewing 1 - 50 of 124