Update phar file with latest build

* Update `ouput` to be a folder instead of a filename
This commit is contained in:
Craig Davis 2014-01-12 13:42:25 -07:00
parent a5c13d0c43
commit d225525927
10 changed files with 725 additions and 31 deletions

6
.gitignore vendored
View File

@ -1,7 +1,7 @@
vendor
resume/_*.md
output/*.html
output/*.pdf
examples/resume/_*.md
examples/output/*.html
examples/output/*.pdf
.tmp_pdf_source.html
# OSX files

BIN
bin/md2resume Executable file

Binary file not shown.

691
examples/sample.html Normal file
View File

@ -0,0 +1,691 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Craig Davis | Senior PHP Developer, UX Director</title>
<style type="text/css">
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
display: block;
}
audio,
canvas,
video {
display: inline-block;
*display: inline;
*zoom: 1;
}
audio:not([controls]) {
display: none;
}
[hidden] {
display: none;
}
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
html,
button,
input,
select,
textarea {
font-family: sans-serif;
}
body {
margin: 0;
}
a:focus {
outline: thin dotted;
}
a:hover,
a:active {
outline: 0;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
h2 {
font-size: 1.5em;
margin: 0.83em 0;
}
h3 {
font-size: 1.17em;
margin: 1em 0;
}
h4 {
font-size: 1em;
margin: 1.33em 0;
}
h5 {
font-size: 0.83em;
margin: 1.67em 0;
}
h6 {
font-size: 0.75em;
margin: 2.33em 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
blockquote {
margin: 1em 40px;
}
dfn {
font-style: italic;
}
mark {
background: #ff0;
color: #000;
}
p,
pre {
margin: 1em 0;
}
pre,
code,
kbd,
samp {
font-family: monospace, serif;
_font-family: 'courier new', monospace;
font-size: 1em;
}
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
q {
quotes: none;
}
q:before,
q:after {
content: '';
content: none;
}
small {
font-size: 75%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
dl,
menu,
ol,
ul {
margin: 1em 0;
}
dd {
margin: 0 0 0 40px;
}
menu,
ol,
ul {
padding: 0 0 0 40px;
}
nav ul,
nav ol {
list-style: none;
list-style-image: none;
}
img {
border: 0;
-ms-interpolation-mode: bicubic;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 0;
}
form {
margin: 0;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
white-space: normal;
*margin-left: -7px;
}
button,
input,
select,
textarea {
font-size: 100%;
margin: 0;
vertical-align: baseline;
*vertical-align: middle;
}
button,
input {
line-height: normal;
}
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
cursor: pointer;
-webkit-appearance: button;
*overflow: visible;
}
button[disabled],
input[disabled] {
cursor: default;
}
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
padding: 0;
*height: 13px;
*width: 13px;
}
input[type="search"] {
-webkit-appearance: textfield;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
vertical-align: top;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
body.pdf {
color: black;
}
body.pdf a {
text-decoration: none;
color: black;
}
body.pdf .container {
width: 1000px;
margin: 0 auto;
padding: 0;
background: none;
border: none;
border-width: 8px 0 2px 0;
text-align: left;
}
body.pdf .resume {
position: relative;
padding: 40px 80px;
}
body.pdf a[href$='.pdf'] {
display: none;
}
body.pdf h1 {
letter-spacing: 0;
margin-top: 0;
font-size: 48px;
text-transform: uppercase;
font-weight: normal;
}
body.pdf h2 {
letter-spacing: 0;
text-transform: uppercase;
font-style: italic;
font-weight: normal;
}
body.pdf h3 {
float: left;
width: 16%;
font-style: normal;
}
body.pdf h3+p {
float: left;
width: 84%;
}
body.pdf blockquote {
top: 40px;
right: 50px;
position: absolute;
}
body.pdf ul li {
width: 28%;
float: left;
}
body.pdf ul dl {
margin: 0;
padding: 0.3em 0 0;
}
body.pdf ul dl dt {
font-size: 122%;
font-weight: normal;
margin: 0 0 .75em;
}
body.pdf ul dl dd {
padding: 0 4em 0 0;
}
body.pdf ol {
float: left;
width: 84%;
margin: .7em 0 0;
}
body.pdf ol li {
width: 33%;
margin: 0;
}
body.pdf ol li:nth-child(3n) {
width: 34%;
}
body.pdf ol li:nth-child(1),
body.pdf ol li:nth-child(2),
body.pdf ol li:nth-child(3) {
border-top: none;
}
body.pdf dl {
margin: .7em 0 0;
page-break-inside: avoid !important;
display: block;
width: 84%;
float: left;
}
body.pdf dl strong {
float: right;
margin-top: -2em;
}
body.pdf dl em {
font-size: 130%;
font-style: normal;
}
.clearfix {
zoom: 1;
}
.clearfix:after {
display: block;
visibility: hidden;
height: 0;
clear: both;
content: ".";
}
body {
font-family: 'Hoefler Text', Times New Roman, Times, serif;
color: #444;
}
h1,
h2,
h3,
h4,
ul dl dt {
font-family: Futura, "Century Gothic", AppleGothic, sans-serif;
}
.container {
margin: 0 auto;
padding: 0;
background: whiteSmoke;
border: solid #666;
border-width: 8px 0 2px 0;
text-align: left;
}
.resume {
position: relative;
padding: 10px 20px;
}
a {
color: #990003;
}
a[href$='.pdf'] {
display: inline-block;
background: #666;
color: white;
padding: 6px 12px;
margin-bottom: 6px;
text-decoration: none;
}
blockquote {
margin: 0;
padding: 0;
line-height: 1.4em;
}
hr {
display: block;
position: relative;
padding: 0;
margin: 18px auto;
width: 100%;
clear: both;
border: none;
border-top: 1px solid #CCC;
font-size: 1px;
line-height: 0;
overflow: visible;
page-break-after: avoid;
}
h1 {
margin: 0;
padding: 0;
font-size: 36px;
letter-spacing: -1px;
font-weight: normal;
}
h2 {
margin: 0;
padding: 0;
font-size: 18px;
font-style: italic;
letter-spacing: -1px;
font-weight: normal;
}
h3 {
margin: 0;
padding: 0 0 .5em;
font-size: 150%;
font-style: italic;
font-weight: normal;
}
h3+p {
margin: .6em 0 16px;
padding: 0;
display: block;
font-size: 104%;
line-height: 24px;
}
ul {
margin: 0;
padding: 0;
list-style: none;
}
ul li {
margin: 0;
padding: 0;
}
ul dl {
margin: .3em 0 0;
padding: 0;
width: 100%;
}
ul dl dt {
font-size: 100%;
}
ul dl dd {
margin: 0 0 1em;
padding: 0 2em 0 0;
font-size: .8em;
line-height: 1.5em;
}
ol {
margin: 0;
padding: 0 0 .75em;
width: 84%;
display: inline-block;
}
ol li {
margin: 0 0 0 1em;
padding: 0;
border-top: 1px solid #CCCCCC;
width: 100%;
float: left;
list-style: none;
line-height: 24px;
font-size: 14px;
}
ol li:nth-child(1) {
border-top: none;
}
dl {
display: inline-block;
width: 75%;
margin: 0;
padding: 0;
}
dl dt {
margin: 0;
padding: 0;
font-size: 140%;
}
dl dd {
margin: 0 0 1.5em;
padding: 0;
font-size: 80%;
line-height: 1.4em;
}
dl strong {
display: block;
}
dl em {
display: block;
font-size: 110%;
margin: .15em 0 .5em;
font-style: bold;
}
#footer {
display: none;
}
#footer + p {
width: 100%;
font-size: 11px;
text-align: center;
}
@media screen and (min-width: 37.5em) {
body {
padding: 2em 0;
}
blockquote {
top: 10px;
right: 50px;
position: absolute;
}
h1 {
margin-top: .5em;
}
ol {
margin: 0 0 0 1em;
}
ol li {
width: 50%;
margin: 0;
}
ol li:nth-child(1),
ol li:nth-child(2) {
border-top: none;
}
}
@media screen and (min-width: 57em) {
.container {
width: 912px;
}
.resume {
position: relative;
padding: 40px 50px;
}
blockquote {
top: 40px;
right: 50px;
position: absolute;
}
h1 {
margin-top: 0;
font-size: 48px;
text-transform: uppercase;
letter-spacing: 3px;
font-weight: normal;
}
h2 {
text-transform: uppercase;
font-style: italic;
letter-spacing: 2px;
font-weight: normal;
}
h3 {
float: left;
width: 16%;
}
h3+p {
float: left;
width: 84%;
}
ul li {
width: 28%;
float: left;
}
ul dl dt {
font-size: 122%;
font-weight: normal;
margin-bottom: .75em;
}
ul dl dd {
padding: 0 4em 0 0;
}
ol {
float: left;
width: 84%;
margin: .6em 0 0;
}
ol li {
width: 33%;
margin: 0;
}
ol li:nth-child(3n) {
width: 34%;
}
ol li:nth-child(1),
ol li:nth-child(2),
ol li:nth-child(3) {
border-top: none;
}
dl {
margin: .5em 0 0;
}
dl strong {
float: right;
margin-top: -2em;
}
dl em {
font-size: 130%;
font-style: normal;
}
}
</style>
</head>
<body class="">
<div class="container">
<div class="resume">
<h1>Craig Davis</h1>
<h2>Senior PHP Developer, UX Director</h2>
<blockquote>
<p><a href="resume.pdf">Download PDF</a><br />
<a href="craig@there4development.com">craig@there4development.com</a><br />
(999) 888-7777</p>
</blockquote>
<hr />
<h3 id="profile">Profile</h3>
<p>Progressively evolve cross-platform ideas before impactful infomediaries. Energistically visualize tactical initiatives before cross-media catalysts for change.</p>
<hr />
<h3 id="skills">Skills</h3>
<ul>
<li><dl>
<dt>Web Design</dt>
<dd>Assertively exploit wireless initiatives rather than synergistic core competencies.</dd>
</dl></li>
<li><dl>
<dt>Interface Design</dt>
<dd>Credibly streamline mission-critical value with multifunctional functionalities.</dd>
</dl></li>
<li><dl>
<dt>Project Direction</dt>
<dd>Proven ability to lead and manage a wide variety of design and development projects in team and independent situations.</dd>
</dl></li>
</ul>
<hr />
<h3 id="technical">Technical</h3>
<ol>
<li>XHTML</li>
<li>CSS</li>
<li>Javascript</li>
<li>Jquery</li>
<li>PHP</li>
<li>CVS / Subversion</li>
<li>OS X</li>
<li>Windows XP/Vista</li>
<li>Linux</li>
</ol>
<hr />
<h3 id="experience">Experience</h3>
<dl>
<dt>Initrode Conglomerated</dt>
<dd><em>Principal and Creative Lead</em>
<strong>2004-2005</strong>
Intrinsicly transform flexible manufactured products without excellent intellectual capital. Energistically evisculate orthogonal architectures through covalent action items. Assertively incentivize sticky platforms without synergistic materials.</dd>
<dt>Gizmonic Institute Company (GIM)</dt>
<dd><em>Lead Web Designer</em>
<strong>2001-2004</strong>
Globally re-engineer cross-media schemas through viral methods of empowerment. Proactively grow long-term high-impact human capital and highly efficient innovation. Intrinsicly iterate excellent e-tailers with timely e-markets.</dd>
</dl>
<hr />
<h3 id="footer">Footer</h3>
<p>Craig Davis &#8212; <a href="craig@there4development.com">craig@there4development.com</a> &#8212; (999) 888-7777</p>
<hr />
</div>
</div>
</body>
</html>

View File

@ -59,9 +59,9 @@ function run_phar()
echo " * Construction phar and moving to ./bin/md2resume\n";
$command =
'rm -f ./bin/md2resume && rm -f ./bin/md2resume.phar &&'
. 'php -dphar.readonly=0 build/empir make ./bin/md2resume.phar working.php . --exclude="'
. 'php -dphar.readonly=0 build/empir make ./bin/md2resume.phar md2resume_dev.php . --exclude="'
. '*.git/*|*.gitignore|*test*|*Tests*|*.md|*/doc/*|*.lock|*token.txt|pakefile'
. '|.*|build/*|*.markdown|*.phar|*LICENSE|*AUTHORS|*CHANGELOG|*.dist|*.tpl'
. '|.*|build/*|*.markdown|*.phar|*LICENSE|*AUTHORS|*CHANGELOG|*.dist|*.tpl|.travis.yml'
. '" && chmod a+x ./bin/md2resume.phar'
. ' && mv ./bin/md2resume.phar ./bin/md2resume';
passthru($command);
@ -70,14 +70,14 @@ function run_phar()
function run_sniff()
{
echo " * Checking files for PSR2\n";
passthru("phpcs -p --standard=PSR2 ./src/ ./resume.php");
passthru("phpcs -p --standard=PSR2 ./src/ ./md2resume_dev.php");
}
function run_fixer()
{
echo "\n * Running php-cs-fixer\n";
passthru(
"php-cs-fixer fix ./bin/resume2.php"
"php-cs-fixer fix ./md2resume_dev.php"
. " && php-cs-fixer fix ./src/Resume/Cli/"
. " && php-cs-fixer fix ./src/Resume/Command/"
);
@ -87,7 +87,7 @@ function run_readme()
{
echo " * Updating README documentation\n";
$readme = file("README.md");
$help = explode("\n", shell_exec("php ./resume2.php list --no-interaction"));
$help = explode("\n", shell_exec("php ./md2resume_dev.php list --no-interaction"));
$helpStart = $helpEnd = 0;
foreach ($readme as $lineNumber => $line) {

View File

@ -1,7 +1,6 @@
<?php
namespace Resume\Cli;
class Converter
{

View File

@ -5,7 +5,6 @@ use Symfony\Component\Console\Application;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\ConsoleOutput;
use Resume\Cli;

View File

@ -7,7 +7,6 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Assetic\Asset\AssetCollection;
use Assetic\Asset\FileAsset;
use Assetic\Asset\GlobAsset;
use Assetic\Filter;
use Michelf\MarkdownExtra;
@ -29,7 +28,7 @@ class HtmlCommand extends Command
->addArgument(
'destination',
InputArgument::REQUIRED,
'Output html document'
'Output destination folder'
)
->addOption(
'template',
@ -48,26 +47,28 @@ class HtmlCommand extends Command
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->app = $this->getApplication();
$source = $input->getArgument('source');
$destination = $input->getArgument('destination');
$template = $input->getOption('template');
$refresh = $input->getOption('refresh');
$this->app = $this->getApplication();
$source = $input->getArgument('source');
$destination = trim($input->getArgument('destination'), DIRECTORY_SEPARATOR);
$template = $input->getOption('template');
$refresh = $input->getOption('refresh');
$destFilename = join(DIRECTORY_SEPARATOR, array($destination, pathinfo($source, PATHINFO_FILENAME) . '.html'));
$rendered = $this->generateHtml($source, $template, $refesh);
file_put_contents($destination, $rendered);
$rendered = $this->generateHtml($source, $template, $refresh);
file_put_contents($destFilename, $rendered);
$output->writeln(
sprintf(
"Wrote resume to: <info>%s</info>",
$destination
$destFilename
),
$this->app->outputFormat
);
return true;
}
protected function generateHtml($source, $template, $refresh) {
protected function generateHtml($source, $template, $refresh)
{
// Check that the source file is sane
if (!file_exists($source)) {
$output->writeln(
@ -77,6 +78,7 @@ class HtmlCommand extends Command
),
$this->app->outputFormat
);
return false;
}
@ -98,6 +100,7 @@ class HtmlCommand extends Command
),
$this->app->outputFormat
);
return false;
}

View File

@ -23,7 +23,7 @@ class PdfCommand extends HtmlCommand
->addArgument(
'destination',
InputArgument::REQUIRED,
'Output pdf document'
'Output destination folder'
)
->addOption(
'template',
@ -35,11 +35,12 @@ class PdfCommand extends HtmlCommand
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->app = $this->getApplication();
$source = $input->getArgument('source');
$destination = $input->getArgument('destination');
$template = $input->getOption('template');
$pdfSource = join(DIRECTORY_SEPARATOR, array(dirname($destination), '.tmp_pdf_source.html'));
$this->app = $this->getApplication();
$source = $input->getArgument('source');
$destination = trim($input->getArgument('destination'), DIRECTORY_SEPARATOR);
$template = $input->getOption('template');
$pdfSource = join(DIRECTORY_SEPARATOR, array($destination, '.tmp_pdf_source.html'));
$destFilename = join(DIRECTORY_SEPARATOR, array($destination, pathinfo($source, PATHINFO_FILENAME) . '.pdf'));
// Make sure we've got out converter available
exec('wkhtmltopdf -V', $results, $returnVal);
@ -54,6 +55,7 @@ class PdfCommand extends HtmlCommand
),
$this->app->outputFormat
);
return false;
}
@ -68,7 +70,7 @@ class PdfCommand extends HtmlCommand
file_put_contents($pdfSource, $rendered);
// Process the document with wkhtmltopdf
exec('wkhtmltopdf ' . $pdfSource .' ' . $destination);
exec('wkhtmltopdf ' . $pdfSource .' ' . $destFilename);
// Unlink the temporary file
unlink($pdfSource);

View File

@ -18,7 +18,7 @@ class TemplatesCommand extends Command
{
$this->app = $this->getApplication();
$tplData = array('templates' => array());
foreach(glob($this->app->templatePath . '/*', GLOB_ONLYDIR) as $dir) {
foreach (glob($this->app->templatePath . '/*', GLOB_ONLYDIR) as $dir) {
$tplData['templates'][] = (object) array(
'name' => basename($dir),
'description' => file_exists($dir . '/description.txt')

View File

@ -1 +1 @@
2.0.0-wip
v2.0.0-wip