8000 GitHub - zachwe/datapress
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

zachwe/datapress

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Datapress

Datapress provides rich, interactive data visualization and sharing capabilities for Wordpress blogs.

Running

To run Datapress:

  • Visit our page on the Wordpress Plugin site
  • Download the most recent version
  • Unzip the file into your Wordpress plugin directory ($WP_ROOT/wp-content/plugins)

To compile Datapress manually:

  • Clone this repository
  • Run python package.py --blast --o $WP_ROOT/wp-content/plugins/datapress from the packager directory

... but please note that the Github version of Datapress does not yet contain all the features of the original version

Notes for Developers

Building the Plugin

Datapress has a package script that takes the code in this repository and assembles the plugin. 63BF The reason for this is that, for testing reasons, it is easier to develop some portions of the plugin as stand-alone web pages, and then to have the important pieces (called snippits) of these pages ripped out and injected into the plugin code. This also helps us enforce a nice client/server separation of components.

The packager script will help you develop while testing against a live WordPress installation. To do so, create the directory $WP_ROOT/wp-content/plugins/datapress. Then, any time you want to deploy the latest version of your code to that directory, run:

python package.py --blast --outputdir $WP_ROOT/wp-content/plugins/datapress

The script will remove the existing directory (the --blast option), copy in the plugin directory, and then inject any snippits these files reference. This snippit injection step is simple string substitution. The script will iterate over all .php files in the output directory and search for the pattern ##INCLUDE:{file}:{snippit}. It will then look for the file file, relative to the project root, and search within it for the specfied snippit.

Snippits are defined within HTML comment tags.

<!-- begin-snippit:{REGION NAME} -->
<!-- end-snippit:{REGION NAME} -->

Snippit Example

Let's say we have the following files:

viz-editor/editor.html

<html>
  <body>
    <!-- begin-snippit:hello -->
    <p>Hi</p>
    <!-- end-snippit:hello -->
  </body>
</html>

plugin/viz-editor.php

$editorHtml = <<<HTML
##INCLUDE:viz-editor/editor.html:hello
HTML;

The packager script would rewrite viz-editor.php so that it contains the following code:

$editorHtml = <<<HTML
<!-- begin-snippit:hello -->
<p>Hi</p>
<!-- end-snippit:hello -->
HTML;

Original Codebase

The github-hosted code here is a rewrite of the original original Datapress plugin, hosted on Google Code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 80.1%
  • Python 12.0%
  • PHP 7.9%
0