thefox/tumblr-parser

A Tumblr Theme parser in PHP.

Installs: 4

Dependents: 0

Stars: 5

Watchers: 2

Forks: 1

Language: PHP

v0.4.4 2015-02-18 23:23 UTC

README

A Tumblr Theme parser in PHP.

Tired of getting sick of Tumblr's online HTML editor for custom themes? With Tumblr Parser you can edit a theme in your favourite HTML editor and render the output in your browser on your own/local server. So you can create themes for Tumblr without editing the HTML in Tumblr's online HTML editor.

Installation

The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to composer.json:

composer.phar require "thefox/tumblr-parser=~0.1"

Get started

To get started first look into the example.php in the example directory. There are several ways to use this tool. You can generate a whole weblog or just a single post. You can do this in your browser or in background in your shell.

Example files

  • example.php: In this basic example the template is loaded from a file. Also the settings are loaded from a .yml file. To load the template and the settings from files is optional. You also can do it with a string or in case of the settings with an array().
  • example.settings.yml: Optional. Used by example.php but not necessary to use Tumblr Parser.
  • example.tpl.html: Optional. Used by example.php but not necessary to use Tumblr Parser.
  • example.gen.php: Optional. Just a generator for settings in .yml format. You don't need this script to use Tumblr Parser.

Tumblr Custom Theme Implementation

Basic Variables [incomplete]

  • {Title}
  • {Description}
  • {CustomCSS}
  • {block:PermalinkPage}
  • {block:IndexPage}
  • {block:PostTitle}, {PostTitle}

Navigation [incomplete]

  • {block:Pagination}
  • {block:PreviousPage}
  • {block:NextPage}
  • {PreviousPage}
  • {NextPage}
  • {CurrentPage}
  • {TotalPages}
  • {block:AskEnabled}
  • {AskLabel}
  • {block:HasPages}
  • {block:Pages}
  • {URL}
  • {Label}

Posts [incomplete]

  • {block:Posts}
  • {block:Text}
  • {block:Link}
  • {block:Photo}
  • {block:Photoset}
  • {Permalink}
  • {PostID}

Text Posts [complete]

Photo Posts [incomplete]

  • {PhotoAlt}
  • {block:Caption}
  • {Caption}
  • {block:LinkURL}
  • {LinkURL}
  • {LinkOpenTag}
  • {LinkCloseTag}
  • {PhotoURL-500}

Photoset Posts [incomplete]

  • {block:Caption}
  • {Caption}
  • {block:Photos}

Quote Posts [complete]

Link Posts [incomplete]

  • {URL}
  • {Name}
  • {Target}
  • {block:Description}
  • {Description}

Chat Posts [complete]

Answer Posts [incomplete]

  • {Question}
  • {Answer}
  • {Asker}

Dates [incomplete]

  • {block:Date}
  • {DayOfMonth}
  • {DayOfMonthWithZero}
  • {DayOfWeek}
  • {ShortDayOfWeek}
  • {DayOfWeekNumber}
  • {DayOfMonthSuffix}
  • {DayOfYear}
  • {WeekOfYear}
  • {Month}
  • {ShortMonth}
  • {MonthNumber}
  • {MonthNumberWithZero}
  • {Year}
  • {ShortYear}
  • {AmPm}
  • {CapitalAmPm}
  • {12Hour}
  • {24Hour}
  • {12HourWithZero}
  • {24HourWithZero}
  • {Minutes}
  • {Seconds}
  • {Timestamp}

Notes [incomplete]

  • {block:PostNotes}
  • {PostNotes}
  • {NoteCount}
  • {NoteCountWithLabel}

Tags [incomplete]

  • {block:HasTags}
  • {block:Tags}
  • {Tag}
  • {TagURL}

Like and Reblog buttons [incomplete]

  • {LikeButton}
  • {NoteCount}

Theme Options [incomplete]

  • Enabling Booleans [complete]
  • Enabling Custom Text [complete]

Contribute

You're welcome to contribute to this project. Fork this project at https://github.com/TheFox/tumblr-parser. You should read GitHub's How to Fork a Repo.

Links

License

Copyright (C) 2014 Christian Mayer http://fox21.at

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.