BFRPG SRD

Creating game materials? Monsters, spells, classes, adventures? This is the place!
User avatar
asacolips
Posts: 127
Joined: Fri May 02, 2014 4:48 pm
Location: Arkansas, United States

Re: BFRPG SRD

Post by asacolips »

Dustinian wrote:I am up for that. Let me know what I can do to help and/or facilitate. I'm not familiar with Wordpress. Would you like the HTML converted to... BBCode? :) Truly, I'm not familiar with Wordpress at all.
In hindsight, I don't think there's a lot of benefit to using WordPress for this, as that would only make it easier to update the specific issues in the content. And it would add PHP/mySQL database overhead that we don't need. Keeping it in .html files is probably the best route, but we would need to separate them into several individual files, I think. If we were to use a CMS and templating, a lightweight flat file CMS like http://picocms.org/ might work well.
Dustinian wrote:Thanks. I'm an ex-technical writer. I'm good at single-sourcing and document structure, but I'm terrible (or, at best, generic at true "design"). So the best thing an art director can do for me would be a good stylesheet so that I can stay focused on my document structure, trusting that "look and feel" are taking care of themselves. That would delight me.
That works for me.
Dustinian wrote:I'm less married to that idea (pure focus on the script) than I was when I posted that.
I still think it's a valid point though. When I made my first attempt at an SRD, I probably spent a full two period just trying to clean up the content, and it was never completely cleaned up. Breaking it down into scripts like this is a much more forward looking option in the long run.
Dustinian wrote:
asacolips wrote:I can put together a really nice stylesheet that's responsive for mobile devices and includes a fixed navigation system, so that the user doesn't have to scroll back to the top.
That would be awesome.
I've actually started work on both parts of this and there is a mobile/tablet theme in place. For whatever reason I can't get work out why it's not working on actual mobile devices yet, but you can resize your browser window to get an idea of where I'm going with it.

[edit] I've got the mobile and tablet bugs worked out now. I hadn't updated my .html file to include the script files, which prevents the tables from breaking out of the content area. That bug has been resolved, so this is now usable on a mobile or tablet device. Performance is a bit dicey though, like we were expecting.
Dustinian wrote:No, the links are relative. Did you look at the document's source, or hover over the hyperlinks? If you hover over, yeah, they look like absolute links. But they're not. I'm a better tech writer than that. ;)
I goofed. I saved the files locally so that I could work on it until we figure out a better solution, and didn't think about how saving the HTML files would make those links non-relative.
Dustinian wrote:I had been arriving that that conclusion myself. That's why I'm less married to the script notion than before. My new notion is to break up the document into a bunch of PHP files, and then "include" them into different templates.
Like I said up top, the script idea is good and it's only the single .html file that's less than ideal. It should be pretty trivial to do some file working where we can define a generic html portion (maybe the head and footer sections) and then break everything else into chunks. We could then make separate files starting with the generic portion and then copying in the chapter chunks.
Dustinian wrote:Right now the CSS is embedded in the document. If you could make your changes on the embedded stylesheet and then attach to a subsequent post, that would be ideal. I could then extract your CSS into a separate .CSS file later, one that would work with the PHP break-down I'm thinking of...
I'm working on the stylesheet as a separate CSS file now, and I'm toying with a little bit of jQuery/javascript as well (particularly for making the tables usable on mobile screens). If you want to reference those files in your html file, the URLs are below. Once everything is done, we can copy them over to you and then make them relative instead of static and pointing to my server.

Stylesheet: http://bfrpg.llsrd.org/style.css
jQuery 1.11.1: http://bfrpg.llsrd.org/jquery.min.js
Naver: http://bfrpg.llsrd.org/jquery.fs.naver.min.js
Scripts File: http://bfrpg.llsrd.org/script.js
Dustinian wrote:That's awesome. I should be able to add part/chapter wrappers. Do you prefer divs or these newfangled "article" HTML5 things? Either way, let me know and I can spend some time tonight working on editing the script.

For now, yard work calls. Thank you, asacolips, for the excellent reply and thoughts.

Update: Holy crap, that is super awesome. I hadn't actually tried the TOC when I posted the above. Your TOC is AWESOME. Please let me know how I can continue to facilitate your excellent work.
Eh, I could go either way on that. I've used divs more times than I can count, but I've worked with articles and some of the new HTML5 markup quite a bit as well. I'm not too worried about it, as long as we can get some classes on them, like <div class="chapter" id="part_1_introduction"> or the same thing, but as an article.

Also, thanks for the compliments on the TOC. What I'm trying to do is create three separate versions of the TOC, a sidebar dropdown menu on desktop, a 3-column layout on tablet, and a single column full width layout on mobile. Eventually, I'll include a menu button via javascript to show/hide the menu.
User avatar
Dustinian
Posts: 134
Joined: Tue Oct 29, 2013 7:40 pm
Location: Mooresville, NC
Contact:

Re: BFRPG SRD

Post by Dustinian »

asacolips wrote:Keeping it in .html files is probably the best route, but we would need to separate them into several individual files, I think.
Agree. I have an idea to break them up into different files as part of the script. I'll work on this later.
asacolips wrote:If we were to use a CMS and templating, a lightweight flat file CMS like http://picocms.org/ might work well.
The only CMS I've ever used extensively is RoboHelp (the precursor to "Flare" by MadCap Software. What I'm trying to say is, I'll need you to steer the script output into whatever direction enables the CMS of your choice.
asacolips wrote:I still think it's a valid point though. When I made my first attempt at an SRD, I probably spent a full two period just trying to clean up the content, and it was never completely cleaned up. Breaking it down into scripts like this is a much more forward looking option in the long run.
Agree. We'll stick to it for now. If it becomes too much of a burden... There are some components that I cleaned up manually (Title Page, TOC), and the script just leaves behind a PHP "include" to include those pre-built manual components. That approach might be a healthy mix.
asacolips wrote:I've got the mobile and tablet bugs worked out now.
I can't wait to use this in a game.
asacolips wrote:Performance is a bit dicey though, like we were expecting.
I'm fully aboard with the different files idea. I'm going to start with 1 file per "Part" (rather than going all the way down to "Chapter" right away. But if the approach works, I'll take it down to the "Chapter" level.
asacolips wrote:I'm working on the stylesheet as a separate CSS file now, and I'm toying with a little bit of jQuery/javascript as well (particularly for making the tables usable on mobile screens). If you want to reference those files in your html file, the URLs are below. Once everything is done, we can copy them over to you and then make them relative instead of static and pointing to my server.

Stylesheet: http://bfrpg.llsrd.org/style.css
jQuery 1.11.1: http://bfrpg.llsrd.org/jquery.min.js
Naver: http://bfrpg.llsrd.org/jquery.fs.naver.min.js
Scripts File: http://bfrpg.llsrd.org/script.js
I will certainly reference the style sheet with the next release. You'll have to school me on referencing the jQuery, Naver, and Scripts file. Or I could send you the raw output of the script and you could host...
asacolips wrote:I've used divs more times than I can count, but I've worked with articles and some of the new HTML5 markup quite a bit as well. I'm not too worried about it, as long as we can get some classes on them, like <div class="chapter" id="part_1_introduction"> or the same thing, but as an article.
Divs it is. I read The Truth About HTML5 last year, and that book turned me off of Articles and Asides and the like (for now).

Here's my progress:
Modified the script to
  • "Div" out the "parts"
  • Separate "duration," "range," and "class" components of spells into different classes of p
  • Add some whitespace to the HTML so it's a little easier to read
The script takes like 2.5 hours to run (just started it a few minutes ago). And I may need to correct errors, etc. So I'll post updated HTML some time tonight.
Dustinian
User avatar
asacolips
Posts: 127
Joined: Fri May 02, 2014 4:48 pm
Location: Arkansas, United States

Re: BFRPG SRD

Post by asacolips »

Good points.

When I had mentioned separating chapters, I meant the Part headings. That's probably a granular enough division.

As far as the jQuery and Javascript files go, all you'll need to do is reference them just before the closing body tag. If you use your browser to view source on my copy of the site, you'll see where I've included them just before the body closes. You should be able to copy/paste that into your site. jQuery and naver are more or less just includes and don't do anything by themselves. The script.js file is where my javascript code is, and it uses jQuery to make the tables more usable on small screens (by making them scrollable if they're too wide) and it uses naver to collapse the TOC into a button when the page is first opened on mobile. With that said, I'm probably going to remove naver, as it's less useful on this site than it normally is.

Related to that, I've added a 'Back to Top' link at the bottom of the HTML before the closing body tag, and it just goes to the TOC. On mobile, it's shown with a fixed position in the bottom right of the screen, making the TOC more accessible.

I'll keep an eye out for the updated output in a few hours. I don't really have any plans to host, and hopefully we could eventually get Chris to setup a subdomain like http://srd.basicfantasy.org/ for the final version. As far as hosting during development, I think it's fine for you to continue. My versions are really just copies so that I can toy around with the CSS and JS. The only changes I've made to the html was to include additional files. Here are those changes:

for the <head>:

Code: Select all

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="http://bfrpg.llsrd.org/style.css">
just before the closing </body> tag:

Code: Select all

<a href="#table_of_contents" rel="nofollow" class="back-to-top">Back to Top</a>
<script src="http://bfrpg.llsrd.org/jquery.min.js"></script>
<script src="http://bfrpg.llsrd.org/jquery.fs.naver.min.js"></script>
<script src="http://bfrpg.llsrd.org/script.js"></script>
User avatar
Dustinian
Posts: 134
Joined: Tue Oct 29, 2013 7:40 pm
Location: Mooresville, NC
Contact:

Re: BFRPG SRD

Post by Dustinian »

A quick status update: The updates to the macro seem to have gone well. I'm attaching the output, just as a demonstration of progress. I'm going to hit the hay. I'm hoping I can finish up a few things tomorrow evening after work.
Attachments
bfrpg_output.zip
Raw script output.
(203.63 KiB) Downloaded 457 times
Dustinian
User avatar
asacolips
Posts: 127
Joined: Fri May 02, 2014 4:48 pm
Location: Arkansas, United States

Re: BFRPG SRD

Post by asacolips »

The updates look good, and will definitely be useful. I noticed one bug in the code due to my syntax highlighter though. The class="class" in the spell section (for whether the spells belong to magic-users or clerics) seems to be having issues with closing quotes. Some of them are missing the closing quote, while others have multiple closing quotes.

Also, I just realized this but we could probably link the spell names in the spell list to their descriptions, similar to what you've done with the Table of Contents. The spell descriptions all start out with h5 elements, so that should be pretty easy to target.
User avatar
Dustinian
Posts: 134
Joined: Tue Oct 29, 2013 7:40 pm
Location: Mooresville, NC
Contact:

Re: BFRPG SRD

Post by Dustinian »

asacolips wrote:I noticed one bug in the code due to my syntax highlighter though. The class="class" in the spell section (for whether the spells belong to magic-users or clerics) seems to be having issues with closing quotes.
Found it. There was a problem with the statement that looked for the "<p>Magic-User" pattern in the spell section. Fixed!
asacolips wrote:Some of them are missing the closing quote, while others have multiple closing quotes.
Didn't see the multiple closing quotes... Did you mean a missing </p> after some of the <p class="class">? I saw that bug, and fixed that as well.
asacolips wrote:Also, I just realized this but we could probably link the spell names in the spell list to their descriptions, similar to what you've done with the Table of Contents. The spell descriptions all start out with h5 elements, so that should be pretty easy to target.
Agree... but that's something I'll tackle tomorrow. I know, I know, always tomorrow. Alas, work a toddler mean I can only spend a few minutes on this per night.

Here are the changes this go-round, along with some I made but forgot to mention last time:
  • Fixed missing " in <p class="class">.
  • Fixed missing </p> after <p class="class">.
  • Replaced <b>...</b> with <strong>...</strong> (that's for you, chiisu81...).
  • Replaced <i>...</i> with either <p class="readaloud"> (where the entire paragraph was italicized) or <em>...</em>.
  • Added header/footer code by asacolips.
The updates are available:
  • Attached a .ZIP file with seperate PHP components.
  • At the same SRD link as on the first post.
Next steps:
  • Create anchors/names for all spells.
  • Break the parts up into multiple pages.
  • Find and fix a rogue <em> tag...
Attachments
bfrpg_srd.zip
Raw output and supporting (manually-formatted) .PHP files...
(209.13 KiB) Downloaded 465 times
Last edited by Dustinian on Fri Nov 21, 2014 9:20 pm, edited 1 time in total.
Dustinian
User avatar
asacolips
Posts: 127
Joined: Fri May 02, 2014 4:48 pm
Location: Arkansas, United States

Re: BFRPG SRD

Post by asacolips »

Good deal. No biggie on the progress rate, this is already pretty exceptionally usable. I've run this on about every device I can get my hands on at work, and it runs well on iPhones and even the first generation iPad. The only reason I was able to make pretty quick progress was because it's usually pretty easy to make a nice, functional theme when you've got solid HTML to work with.

One suggestion I've got for us to add to the list is to wrap all of the spells with divs, similar to what we did with the parts of the book. I was hoping that I could just use CSS3 columns instead of having to do that, but after trying that out on the new version it made the layout much more confusing than helpful. We'll probably need to use actual wrapper divs and just float them. That can probably be last on the list, as again it's already very usable.

Also, nice job with the updated scripts!
User avatar
Dustinian
Posts: 134
Joined: Tue Oct 29, 2013 7:40 pm
Location: Mooresville, NC
Contact:

Re: BFRPG SRD

Post by Dustinian »

Many updates complete and available:
  • At the Same URL
  • Attached to this post (raw output with visible PHP and PHP files included).
Completed updates:
  • Div'd out the spells
  • Anchored the spells
  • Div'd out the monsters
  • Got rid of the rogue <em> tag by removing the "readaloud" <p> class. I'd like to bring back the "readaloud" class in a future update. But for now it's something that's too fiddly to automate.
Needed updates:
  • I still haven't broken this out into multiple pages, that's next.
  • Even though I anchored the spells, I haven't taken the time to link the spell lists to the spells. Coming soon.
  • I created a monster TOC (you can look at it in the attached .ZIP file), but i'm not sure where to "include" it. Thoughts?
Another note:
  • I went ahead and included a ZIP file with the scripts as well. I'm using Text Transformation Language (TTL) (that I built some time ago), but I'm not delighted with the scripts. They're quite document-specific. But I'm keeping a list of features I need to add to TTL to support more "generic" commands in the future. We'll see if I have time for that...
It's been 3 days, so I wanted to show progress. But there's more to do!
Attachments
bfrpg_script.zip
TTL script, copy of ttl.exe, and the batch file I use to run it... it takes a long time to run (hours).
(353.46 KiB) Downloaded 454 times
bfrpg_srd.zip
Raw output and PHP files.
(213.91 KiB) Downloaded 470 times
Last edited by Dustinian on Fri Nov 21, 2014 9:21 pm, edited 1 time in total.
Dustinian
User avatar
Blazeguard
Posts: 1287
Joined: Mon Jun 20, 2011 10:48 pm
Location: Saskatoon, SK, Canada

Re: BFRPG SRD

Post by Blazeguard »

You guys are awesome!!

One thing I noticed. Is there any way to make the menu widths dynamic? I have a big wide-screen monitor but the menus are still narrow and the titles are broken up into several lines.
I can take a screenshot if you're not sure what I mean.
The problem with doing something really stupid to impress people is that they may just be impressed by how stupid you really are.
User avatar
Hywaywolf
Posts: 5271
Joined: Fri Mar 13, 2009 11:30 pm
Location: Wilmington, NC

Re: BFRPG SRD

Post by Hywaywolf »

This is pretty cool. Once its done its location should be posted in the Roll20 forums. I am finding that there are people using BFRPG there who never come to these forums.

Also, I don't want to add to your workload, especially since I can't do this, but Roll20 now has the ability to use character sheet templates. Games like BFRPG probably won't have sheets prepared by the Roll20 team, but user built templates will be available to other player and DMs.
Locked

Who is online

Users browsing this forum: Google [Bot], TrickyNikki and 67 guests