Talk:Fanfic
From Betamountain.org
Adding Fanfic
Try this (We'll use "Starfarers Journey" as a title)
Starting A Page
- Be logged into the wiki
- Search for Starfarers Journey via the search bar
- You should get a result that the page does not exist and a link to create one. Click that
- New page appears: Creating Starfarers Journey
- Near the top you should see Select Boilerplate and Character BP in the box, drop that down and select Fanfic BP, then load
Boilerplate (Part 1)
If the fanfic does not exist anywhere online currently, delete the first line.
If it does exist:
- Change NAME to the author (case sensitive + consistency is good)
- If it exists on Archive of Our Own, replace Ao3# OR DELETE with the number of the Ao3 article (found in the Ao3 URL)
- If it doesn't exist there, remove OR DELETE Archive of Our Own/Ao3# OR DELETE entirely
- If it exists elsewhere, use the available slots (three) to put in the URL. If you don't use all of the spots, delete the wording for the spot.
Example: {{FanFicExists|Somebody|{{AOOO|Ao3# OR DELETE}}|SPOT2|SPOT3}} Ann's story The Glitch exists on Ao3 and her website, so I used two slots: {{FanFicExists|AKK|{{AOOO|13232220}}|https://annkniggendorf.de/page134.html|}}
Boilerplate (Part 2)
Edit the next part in place as follows
{{HideTitle}} <center> <h1>{{PAGENAME}}</h1> <h2>Rabbi Bob</h2> <h3>Leave blank unless there's more to put. You can play with the size and arrangement as needed </h3></center><br> '''Summary:'''
Main Body
Paste the main text here. Wiki will take some level of formatting but isn't overly friendly. I do this usually:
- Get the text in html
- Copy the html to the clipboard
- Go to https://htmltidy.net/">https://htmltidy.net/ and paste the clipboard on the left side
- Click Tidy (upper right)
- Grab the code from the right
- Paste into wiki
8 times out of 10 that helps get me where I need to be.
Bottom of the page
At the bottom I put all the categories in and for Fanfic, that's driven from the spreadsheets.
If possible, Email me about the fanfic and include any characters (split them up by series characters and author original characters). The same with any prominent locations and vehicles. I'm not looking for BETA Mountain cafeteria, locker room, etc, but if the story goes to BETA Mountain, that one mention is fine. From that, I update the spreadsheet and then transfer the category info to the page.
How This Page Works
Due to the large number of elements on the Fanfic page, the page is built on information from this Google spreadsheet. Content adds\edits\etc are made to the spreadsheet and then downloaded as a CSV. The CSV is pulled through a Perl script and formatted for the page information, then posted.
There should be no direct edits to the page itself, only exports from the Perl output.

Known Issues
Unicode\Encoding issues cause Raumjäger to become Raumjäger on export and at the current time, my Perl-Fu isn't what it was.
- For my reading later: https://perlgeek.de/en/article/encodings-and-unicode
Perl Example
Example code
#!/usr/bin/perl use strict; use warnings; no warnings 'uninitialized'; use Data::Dumper; use Text::CSV; use feature 'unicode_strings'; use utf8; use open ':encoding(utf8)'; binmode(STDOUT, ":utf8"); use open IN => ":encoding(utf8)", OUT => ":utf8"; my $filename='temp.txt'; my $NAME_CHECK=""; my $COUNTER=0; my $INPUT_FILE = $ARGV[0] or die "Need to get CSV file on the command line\n"; my $CSV = Text::CSV->new ({ binary => 1, auto_diag => 1, sep_char => ',' # not really needed as this is the default } ); open(my $DATA_IN, '<:encoding(utf8)', $INPUT_FILE) or die "Could not open '$INPUT_FILE' $!\n"; open(my $DATA_OUT, '>:encoding(utf8)', "output.txt") or die "Could not open: $!\n"; SETUP (); #create page setup while (my $fields = $CSV->getline( $DATA_IN )) { ##1 #2 Title Author PERM Done? BM FF AO3 . Other1 . RATING LANGUAGE STYLE Chapter # Length Published Updated Description my $skip_1; my $SORT; my $TITLE; my $TITLE_FILE; my $AUTHOR; my $PERMISSION; my $DONE; my $BM; my $FANFIC; my $AO3; my $OTHER; my $RATING; my $TIMELINE; my $AUTHOR_ORDER; my $SERIES; my $SERIES_ORDER; my $MASTER_ORDER; my $LANGUAGE; my $STYLE; my $CHAPTERS; my $LENGTH; my $PUBLISHED; my $UPDATED; my $DESC; my $NOTES; my $SHADE; #### $skip_1 = $fields->[0]; $SORT = $fields->[1]; $TITLE = $fields->[2]; # if($TITLE=~m/(Raumj).*/){$TITLE="Raumjager"} $TITLE_FILE=$TITLE; $AUTHOR = $fields->[3]; $PERMISSION = $fields->[4]; $DONE = $fields->[5]; $BM = $fields->[6]; $FANFIC = $fields->[7]; $AO3 = $fields->[9]; $OTHER = $fields->[11]; $RATING = $fields->[13]; $TIMELINE = $fields->[14]; $AUTHOR_ORDER = $fields->[15]; $SERIES = $fields->[16]; $SERIES_ORDER = $fields->[17]; $MASTER_ORDER = $fields->[18]; $LANGUAGE = $fields->[19]; $STYLE = $fields->[20]; $CHAPTERS = $fields->[21]; $LENGTH = $fields->[22]; $PUBLISHED = $fields->[23]; $UPDATED = $fields->[24]; $DESC = $fields->[25]; $NOTES = $fields->[26]; ####################################### ############# $TITLE_FILE =~ s/\?|\'| |\:|\!//g; open(my $TITLE_OUT, '>:encoding(utf8)', "fanfic/$TITLE_FILE.txt") or die "Could not open $TITLE_FILE: $!\n"; ############# if ($skip_1=~ "X") { #IGNORE ANYTHING WITH AN X IN THE FIRST COLUMN } else { $COUNTER++; if (0 == $COUNTER % 2) { $SHADE="style=\"background:#D3D3D3\""; } else { $SHADE=""; } #print $DATA_OUT "| $SORT\n"; #print $DATA_OUT "| {{#ifexist: $TITLE | [[$TITLE]] | $TITLE }} \n"; #Too intensive for Mediawiki print $DATA_OUT "|$SHADE|$SORT\n"; # N - not done # O - offsite only, but categorized # Y - done if ($DONE =~ "N") { print $DATA_OUT "|$SHADE|<i>$TITLE</i>\n"; } elsif ($DONE =~ "P") { print $DATA_OUT "|$SHADE|$TITLE\n"; } else { print $DATA_OUT "|$SHADE|[[$TITLE]]\n"; #print $DATA_OUT "|\n"; } print $DATA_OUT "|$SHADE|$AUTHOR\n"; print $TITLE_OUT "[[Category:Fanfic-$AUTHOR]]\n"; #print "PERMISSION: $PERMISSION\n"; #print "DONE: $DONE\n"; #print $DATA_OUT "|[[$TITLE]]\n"; if ($FANFIC=~ "^http(.*)") { print $DATA_OUT "|$SHADE|[[File:Logo FanFiction.jpg|25px|link=$FANFIC]]\n"; #print $DATA_OUT "|$SHADE|[$FANFIC FF]\n"; #Logo FanFiction.jpg } else { print $DATA_OUT "|$SHADE|\n"; } if ($AO3=~ "^http(.*)") { #[[Image:Wiki.png|50px|link=MediaWiki]] #print $DATA_OUT "|$SHADE|[$AO3 Ao3 ]\n"; print $DATA_OUT "|$SHADE|[[File:Logo Ao3.jpg|25px|link=$AO3]]\n"; } else { print $DATA_OUT "|$SHADE|\n"; } if ($OTHER=~ "^http(.*)") { #Logo Site.jpg print $DATA_OUT "|$SHADE|[[File:Logo Site.jpg|25px|link=$OTHER]]\n"; #print $DATA_OUT "|$SHADE|[$OTHER Site]\n"; } else { print $DATA_OUT "|$SHADE|\n"; } print $DATA_OUT "|$SHADE|$RATING\n"; print $TITLE_OUT "[[Category:Fanfic]]\n"; print $TITLE_OUT "[[Category:Fanfic-$RATING]]\n"; print $TITLE_OUT "$BM"; #print $DATA_OUT "| $LANGUAGE\n"; #print $DATA_OUT "| $STYLE\n"; #print $DATA_OUT "| $CHAPTERS\n"; print $DATA_OUT "|$SHADE|$LENGTH\n"; print $DATA_OUT "|$SHADE|$PUBLISHED\n"; print $DATA_OUT "|$SHADE|$DONE\n"; #print "UPDATED: $UPDATED\n"; #print "DESC: $DESC\n"; #print "NOTES: $NOTES\n"; print $DATA_OUT "|-\n"; print "$COUNTER - $TITLE-\n"; } ######## $skip_1=""; $SORT=""; $TITLE=""; $TITLE_FILE=""; $AUTHOR=""; $PERMISSION=""; $DONE=""; $BM=""; $FANFIC=""; $AO3=""; $OTHER=""; $RATING=""; $LANGUAGE=""; $STYLE=""; $CHAPTERS=""; $LENGTH=""; $PUBLISHED=""; $UPDATED=""; $DESC=""; $NOTES=""; #### } if (not $CSV->eof) { $CSV->error_diag(); } close $DATA_IN; print $DATA_OUT "|}\n"; FINISHED (); close $DATA_OUT; sub CATEGORY { my $in=shift; if (defined $in && length $in > 0) { #print $fh "[[Category:$in]]\n"; } } sub BOX_OUTPUT { my ($type, $val) = @_; if (defined $val && length $val > 0) { print "$type: $val\n"; } } sub SETUP { print $DATA_OUT "See Also [[:Category:Fanfic]]\n\n"; print $DATA_OUT "'''''Note:''' This page is under construction and there are parts missing from the list.''<br>\n"; print $DATA_OUT "'''''Note:''' Titles in italics have not been cataloged and the stories are offsite''\n"; print $DATA_OUT "'''''Note:''' Titles without links have been cataloged and the stories are offsite''\n\n"; print $DATA_OUT "{| class=\"wikitable sortable\" style=\"margin: 1ex auto 1ex auto\"\n"; print $DATA_OUT "! Sort\n"; print $DATA_OUT "! Title\n"; print $DATA_OUT "! Author\n"; #print $DATA_OUT "! BM\n"; print $DATA_OUT "! FF\n"; print $DATA_OUT "! AO3\n"; print $DATA_OUT "! Site\n"; print $DATA_OUT "! Rating\n"; #print $DATA_OUT "! Language\n"; #print $DATA_OUT "! Style\n"; #print $DATA_OUT "! Chapters\n"; print $DATA_OUT "! Length\n"; print $DATA_OUT "! Published\n"; print $DATA_OUT "! Status\n"; print $DATA_OUT "|-\n"; } sub FINISHED { print $DATA_OUT "\n\n\n"; print $DATA_OUT "[[Category:Spreadsheet]]\n"; print $DATA_OUT "[[Category:Perl]]\n"; }