.

 

Scripts

An overview of all the scripts in the system

ftrain_vars.xsl
This is the variables file; it's loaded into nearly every script and includes all directory references and file names, as well as some utility functions.

ftrain_links.xsl
This pulls in a flat XML links file (i.e. links arranged one record at a time) and creates 3 views of the links:

  1. By category, which it does by consulting a hierarchically structured XML file with each category name listed (this is called link_categories.xml in the main XML directory, and I edit it by hand) and turning every category into a section; it then figures out which links have categories that aren't in the categories XML file and lists those categories in the top-level of the hierarchical view. You can see an example of the output of this view at All the Links.
  2. Chronologically, which it does by doing a sort on all the links and organizing them by day. The example of this view is at [#links_in_chron_order_all_nice_like].
  3. In a table for the left navbar. This is similar to the chronological view, but it oscillates the table color and only picks the last 15 links or so for the left nav bar, so that everything looks swell (see left). It spits out an include file, recent_links.xml, which is then included whenever a regular file is created.

ftrain_map.xsl
This is a very simple script that makes a “map” of the entire Ftrain structure - i.e. it grabs every <section> tag and the title, desc, and key data. It's much faster to work with this map than with the actual document.

ftrain_map2.xsl
Now we use the map we created and create a new map - this one is flat and lists all the sections in the order they appear in the document with a position number and a random number associated with them. This allows us to associate a random number with each section when we process it, which in turn allows us to choose to include certain parts of other XML files randomly. It's not proper randomness, really, but it'll do until math:random is widely implemented in XSLT processors.

ftrain_paths.xsl
This doesn't really do much for the time being; it's mostly here as a placeholder for some functionality I'd like to offer in the future.

ftrain_toc.xsl
This generates several XML files which are later included in the main XML document - this is a little tricky if you're new to XML, but basically what I do is use system entities, which refer to outside files, to include the output of XSLT transformations against the main Ftrain document in the document itself. This run creates a Reverse Chronological Order TOC, a Forward Chronological Order TOC, a (Not really) RDF (needs an update), and a "Last 10" view.

ftrain_calendar_func.xsl
Utility functions for the two calendar scripts below; I got the code somewhere on the Web, but I can't find it now. It was on a mailing list, so I'll pretend it's more-or-less GNUish.

ftrain_calendar.xsl
Generates an XML file which is included in the master XML file to become the ite_calendar.

ftrain_calendar_nav.xsl
Generates an XML file which is included with every output page to become the small calendar to your left.

ftrain_main.xsl
The main processor. Now that we've put together all our maps and views, we go back to the map and with every section in the map, we run the processor again and it creates individual HTML pages, one per section, turning the files we created into new pages or including them in every page as nav elements.

cal3.xml
This contains the month listing for the calendar.

ftrain_images.xsl
Eventually, I'd like a thumbnail directory of all the links of Ftrain; this is a first draft and will grow in time. It's currently not run when I build the site.

ftrain_data.xsl
A placeholder script.

build
A shell script that calls everything; pretty straightforward to anyone who has dealt with unix, and fairly straightforward in general.

mirror
Mirrors the /xml and /art directories and then runs the build script on a remote machine.

util_flog.cgi
A perl CGI script that makes organizing sites into hierarchies practically fun! As I browse through the Infobahn, when I see a site I like, I click on a button on my browser - a bookmarklet - that calls the following code:

Open a new window with this link and edit the bookmarklet (replacing CGI info) if you want to use the Flog! script.

That code puts the title and the name of the link into the right fields; I fill in a category and a descriptions and submit. This then writes to a file in my xml/ directory called flog.xml, and that's what's turned into the links via the XSLT scripts described above.


[Top]

Ftrain.com

PEEK

Ftrain.com is the website of Paul Ford and his pseudonyms. It is showing its age. I'm rewriting the code but it's taking some time.

FACEBOOK

There is a Facebook group.

TWITTER

You will regret following me on Twitter here.

EMAIL

Enter your email address:

A TinyLetter Email Newsletter

About the author: I've been running this website from 1997. For a living I write stories and essays, program computers, edit things, and help people launch online publications. (LinkedIn). I wrote a novel. I was an editor at Harper's Magazine for five years; then I was a Contributing Editor; now I am a free agent. I was also on NPR's All Things Considered for a while. I still write for The Morning News, and some other places.

If you have any questions for me, I am very accessible by email. You can email me at ford@ftrain.com and ask me things and I will try to answer. Especially if you want to clarify something or write something critical. I am glad to clarify things so that you can disagree more effectively.

POKE


Syndicate: RSS1.0, RSS2.0
Links: RSS1.0, RSS2.0

Contact

© 1974-2011 Paul Ford

Recent

Recent Offsite Work: Code and Prose. As a hobby I write. (January 14)

Rotary Dial. (August 21)

10 Timeframes. (June 20)

Facebook and Instagram: When Your Favorite App Sells Out. (April 10)

Why I Am Leaving the People of the Red Valley. (April 7)

Welcome to the Company. (September 21)

“Facebook and the Epiphanator: An End to Endings?”. Forgot to tell you about this. (July 20)

“The Age of Mechanical Reproduction”. An essay for TheMorningNews.org. (July 11)

Woods+. People call me a lot and say: What is this new thing? You're a nerd. Explain it immediately. (July 10)

Reading Tonight. Reading! (May 25)

Recorded Entertainment #2, by Paul Ford. (May 18)

Recorded Entertainment #1, by Paul Ford. (May 17)

Nanolaw with Daughter. Why privacy mattered. (May 16)

0h30m w/Photoshop, by Paul Ford. It's immediately clear to me now that I'm writing again that I need to come up with some new forms in order to have fun here—so that I can get a rhythm and know what I'm doing. One thing that works for me are time limits; pencils up, pencils down. So: Fridays, write for 30 minutes; edit for 20 minutes max; and go whip up some images if necessary, like the big crappy hand below that's all meaningful and evocative because it's retro and zoomed-in. Post it, and leave it alone. Can I do that every Friday? Yes! Will I? Maybe! But I crave that simple continuity. For today, for absolutely no reason other than that it came unbidden into my brain, the subject will be Photoshop. (Do we have a process? We have a process. It is 11:39 and...) (May 13)

That Shaggy Feeling. Soon, orphans. (May 12)

Antilunchism, by Paul Ford. Snack trams. (May 11)

Tickler File Forever, by Paul Ford. I'll have no one to blame but future me. (May 10)

Time's Inverted Index, by Paul Ford. (1) When robots write history we can get in trouble with our past selves. (2) Search-generated, "false" chrestomathies and the historical fallacy. (May 9)

Bantha Tracks. (May 5)

The Moral Superiority of the Streetcar. (1) Long-form journalism fixes everything. (2) The moral superiority of the streetcar. (3) I like big bus and I cannot lie. (May 4)

More...
Tables of Contents