tapestry-cloud / tapestry Goto Github PK
View Code? Open in Web Editor NEWPHP static site generator using the plates template system
Home Page: https://www.tapestry.cloud/
License: MIT License
PHP static site generator using the plates template system
Home Page: https://www.tapestry.cloud/
License: MIT License
The .phar
is using DIR rather than $include for the require path ensuring the entire thing is broken...
This is used by various legacy unit tests and was discovered during #5
Add in the missing unit tests
An issue raised in both #32 and #30 is that the ViewFile
class which is passed to the view within a collection which the view has asked for via use
frontmatter, contains helper methods that are not available within the context of $this
for each page.
For example a collection of blog posts passed to a category view will be an array of the ViewFile
class (either via use
or pagination it doesn't matter) and the ViewFile
class contains useful methods such as getDate('d-m-Y')
and getUrl()
.
It may be duplicating code having the same code in a plates extension as well as the ViewFile
class so possibly the use of a trait containing the shared methods could work best in this case?
This is marked up as both a bug and an enhancement, the bug is that ViewFile
helpers are not available within a view via $this
and the enhancement is adding that missed functionality.
In service providers replace calls to $this->getContainer
to $this->container
For use with anvil, I need the current state of the workspace as parsed by Tapestry, preferably in the form of json.
Using a Taxonomy archive page with the following frontmatter:
---
title: Category Archive
use:
- blog_categories
generator:
- TaxonomyArchiveGenerator
- PaginationGenerator
pagination:
provider: blog_categories
perPage: 3
---
You would expect to be able to see a list of taxonomy siblings passed through to the view being able to be displayed via $blog_categories
with the current pages items being displayed via $blog_categories_items
. This is a side effect of me attempting to keep the use
system simple.
A workable fix should be by adding a Taxonomy view helper class that gets attached the view containing all the taxonomy siblings and the items requested for the current page.
C:\Users\Simon.Dann>composer global require carbontwelve/tapestry
Changed current directory to C:/Users/Simon.Dann/AppData/Roaming/Composer
Using version ^1.0 for carbontwelve/tapestry
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install carbontwelve/tapestry 1.0.6
- Conclusion: don't install carbontwelve/tapestry 1.0.5
- Conclusion: don't install carbontwelve/tapestry 1.0.4
- Conclusion: don't install carbontwelve/tapestry 1.0.3
- Conclusion: remove symfony/filesystem v3.0.4
- Installation request for carbontwelve/tapestry ^1.0 -> satisfiable by carb
ontwelve/tapestry[1.0.0, 1.0.3, 1.0.4, 1.0.5, 1.0.6].
- Conclusion: don't install symfony/filesystem v3.0.4
- carbontwelve/tapestry 1.0.0 requires symfony/filesystem ^3.1 -> satisfiabl
e by symfony/filesystem[v3.1.0, v3.1.1, v3.1.10, v3.1.2, v3.1.3, v3.1.4, v3.1.5,
v3.1.6, v3.1.7, v3.1.8, v3.1.9, v3.2.0, v3.2.1, v3.2.2, v3.2.3, v3.2.4, v3.2.5,
v3.2.6].
- Can only install one of: symfony/filesystem[v3.1.0, v3.0.4].
- Can only install one of: symfony/filesystem[v3.1.1, v3.0.4].
- Can only install one of: symfony/filesystem[v3.1.10, v3.0.4].
- Can only install one of: symfony/filesystem[v3.1.2, v3.0.4].
- Can only install one of: symfony/filesystem[v3.1.3, v3.0.4].
- Can only install one of: symfony/filesystem[v3.1.4, v3.0.4].
- Can only install one of: symfony/filesystem[v3.1.5, v3.0.4].
- Can only install one of: symfony/filesystem[v3.1.6, v3.0.4].
- Can only install one of: symfony/filesystem[v3.1.7, v3.0.4].
- Can only install one of: symfony/filesystem[v3.1.8, v3.0.4].
- Can only install one of: symfony/filesystem[v3.1.9, v3.0.4].
- Can only install one of: symfony/filesystem[v3.2.0, v3.0.4].
- Can only install one of: symfony/filesystem[v3.2.1, v3.0.4].
- Can only install one of: symfony/filesystem[v3.2.2, v3.0.4].
- Can only install one of: symfony/filesystem[v3.2.3, v3.0.4].
- Can only install one of: symfony/filesystem[v3.2.4, v3.0.4].
- Can only install one of: symfony/filesystem[v3.2.5, v3.0.4].
- Can only install one of: symfony/filesystem[v3.2.6, v3.0.4].
- Installation request for symfony/filesystem (locked at v3.0.4) -> satisfia
ble by symfony/filesystem[v3.0.4].
Installation failed, reverting ./composer.json to its original content.
Documentation needs writing for the platform.
The Tapestry/Tapestry
class constructor should accept an instance of Symfony\Component\Console\Input\Input
rather than an array to remove the implicit usage of Symfony\Component\Console\Input\ArgvInput
within its constructor.
The CollectionItemGenerator
should pass to the view the current item
using a configurable container class. This way a user can define that they want the CollectionItemGenerator
to set item
equal to a defined class that gets $this->file
passed to it.
FileCopier, FileIgnored and FileWriter all have duplicate code, create a base class with the shared functionality to remove duplication.
ContentType
configuration can enable/disable a content type, however the property does not appear to be used in Tapestry
. It is however used by carbontwelve/tapestry-api and therefore a isDisabled
method is needed to provide access to the otherwise private property.
It would appear that the --clear
flag as defined within the BuildCommand is not used.
The following todo within the Clean Step points to it being unfinished/forgotten functionality that needs completing:
this should be refactored into two steps, clear and clean. Clean will remove the .tmp folder while clear will remove the destination folder if asked by --clear cli flag
When extending the Tapestry overloading of the Plates Engine from a site Kernel, that extension is not made available to the templates with Tapestry returning a function not found error.
The project specific extension to the plates ExtensionInterface
is executed, but doesn't appear to be carried over to rendering; write TTD and investigate why.
The ViewFile entity should have some helpers attached which aid in outputting a files taxonomy and date.
e.g.
// Current method
$item->getData('date')->format('F jS Y');
// Proposed date helper (with optional format argument)
$item->getDate('F jS Y');
Package phine/exception is abandoned, you should avoid using it. No replacement was suggested.
Package phine/path is abandoned, you should avoid using it. No replacement was suggested.
Package phine/observer is abandoned, you should avoid using it. No replacement was suggested.
Package phine/phar is abandoned, you should avoid using it. Use box-project/box2 instead.
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Mostly for use by tapestry-api but the destinationDirectory property of Project should be settable from the command line.
It looks as though something has changed with PHP Plates which has made the Tapestry extension of it broken.
Fatal error: Access level to Tapestry\Plates\Template::section() must be public (as in class League\Plates\Template\Template) in C:\Users\Simon\Documents\Projects\tapestry\src\Plates\Template.php on line 16
Call Stack:
0.0003 124736 1. {main}() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\phpunit:0
0.0047 408328 2. PHPUnit_TextUI_Command::main() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\phpunit:47
0.0047 408656 3. PHPUnit_TextUI_Command->run() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\src\TextUI\Command.php:106
0.1025 2061024 4. PHPUnit_TextUI_TestRunner->doRun() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\src\TextUI\Command.php:155
0.1488 2198744 5. PHPUnit_Framework_TestSuite->run() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:429
0.1720 2496912 6. PHPUnit_Framework_TestSuite->run() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\src\Framework\TestSuite.php:747
0.1787 2501496 7. PHPUnit_Framework_TestCase->run() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\src\Framework\TestSuite.php:747
0.1787 2501496 8. PHPUnit_Framework_TestResult->run() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\src\Framework\TestCase.php:726
0.1788 2502152 9. PHPUnit_Framework_TestCase->runBare() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\src\Framework\TestResult.php:685
0.1789 2518872 10. PHPUnit_Framework_TestCase->runTest() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\src\Framework\TestCase.php:770
0.1789 2519376 11. ReflectionMethod->invokeArgs() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\src\Framework\TestCase.php:910
0.1789 2519576 12. Tapestry\Tests\BuildCommandTest->testDefaultInit() C:\Users\Simon\Documents\Projects\tapestry\vendor\phpunit\phpunit\src\Framework\TestCase.php:910
0.2072 2520376 13. Tapestry\Tests\CommandTestBase->runCommand() C:\Users\Simon\Documents\Projects\tapestry\tests\BuildCommandTest.php:19
0.2282 3541048 14. Symfony\Component\Console\Tester\ApplicationTester->run() C:\Users\Simon\Documents\Projects\tapestry\tests\CommandTestBase.php:114
0.2310 3690416 15. Symfony\Component\Console\Application->run() C:\Users\Simon\Documents\Projects\tapestry\vendor\symfony\console\Tester\ApplicationTester.php:100
0.2756 3691640 16. Symfony\Component\Console\Application->doRun() C:\Users\Simon\Documents\Projects\tapestry\vendor\symfony\console\Application.php:122
0.2760 3692192 17. Symfony\Component\Console\Application->doRunCommand() C:\Users\Simon\Documents\Projects\tapestry\vendor\symfony\console\Application.php:191
0.2760 3692472 18. Symfony\Component\Console\Command\Command->run() C:\Users\Simon\Documents\Projects\tapestry\vendor\symfony\console\Application.php:830
0.2763 3694792 19. Tapestry\Console\Commands\Command->execute() C:\Users\Simon\Documents\Projects\tapestry\vendor\symfony\console\Command\Command.php:255
0.2763 3694960 20. Tapestry\Console\Commands\BuildCommand->fire() C:\Users\Simon\Documents\Projects\tapestry\src\Console\Commands\Command.php:26
0.2773 3727112 21. Tapestry\Generator->generate() C:\Users\Simon\Documents\Projects\tapestry\src\Console\Commands\BuildCommand.php:72
0.3050 4518248 22. Tapestry\Modules\Content\Compile->__invoke() C:\Users\Simon\Documents\Projects\tapestry\src\Generator.php:39
0.3053 4519032 23. Tapestry\Entities\Renderers\PlatesRenderer->render() C:\Users\Simon\Documents\Projects\tapestry\src\Modules\Content\Compile.php:142
0.3053 4519208 24. Tapestry\Plates\Engine->renderFile() C:\Users\Simon\Documents\Projects\tapestry\src\Entities\Renderers\PlatesRenderer.php:69
0.3053 4519272 25. Tapestry\Plates\Engine->make() C:\Users\Simon\Documents\Projects\tapestry\src\Plates\Engine.php:36
0.3053 4519440 26. spl_autoload_call() C:\Users\Simon\Documents\Projects\tapestry\src\Plates\Engine.php:19
0.3053 4519480 27. Composer\Autoload\ClassLoader->loadClass() C:\Users\Simon\Documents\Projects\tapestry\src\Plates\Engine.php:19
0.3054 4519592 28. Composer\Autoload\includeFile() C:\Users\Simon\Documents\Projects\tapestry\vendor\composer\ClassLoader.php:301
0.3056 4532824 29. include('C:\Users\Simon\Documents\Projects\tapestry\src\Plates\Template.php') C:\Users\Simon\Documents\Projects\tapestry\vendor\composer\ClassLoader.php:412
Within the Tapestry constructor environment
and currentWorkingDirectory
are set - are these used anywhere?
Currently only config.php
is loaded for the project regardless of environment. If available config-{env}.php
should be loaded as well.
$categories
and $tags
should always exist (as well as any other taxonomy set for a content type) even if it is not referenced by a file within its front matter.
If a content type has taxonomy and a file within that content types collection does not reference any taxonomy, then that file should have the specific variable set as an empty array for that taxonomy, or else a reasonable default which may be configured - e.g Misc like with Wordpress.
For the time being I have added the method taxonomyList to ViewFileTrait
as my views expected $category
to exist when it didn't because the blog post in question did not have any categories set.
ArrayContainer
RemoveDrafts
moduleParseFileTemplates
modulephpmd
and clean up all possible problemsAdd an isDraft() helper to the trait created for #37
Build out api documentation using http://www.apigen.org/
Steps to reproduce:
Create the file source\test.md
with the following content:
---
layout: page
title: "Test"
---
Test Content
Create the file source\_templates\page.phtml
with the following content:
<h1><?= (isset($title) ? $title : ''); ?></h1>
<div><?= $this->section('content') ?></div>
Expected outcome is that upon building you end up with the file test.html
with the following content:
<h1>Test</h1>
<div><p>Test Content</p></div>
What you actually get is <div><p>Test Content</p></div>
the markdown is rendered out to .html
and never gets passed through to a phtml
template, defined or otherwise.
To aid the TapestryAPI project each file that has been bucked into a ContentType should have the property contentType
set to the name of the content type the file has been bucketed into.
Running tapestry self-update --rollback
does not work because the code checking for the flag gets executed after the version check.
Currently $previous_next
when set is an instance of stdClass
, it should be set to an instance of Pagination
as it has identical functionality.
Currently posts marked as drafts are published. Configuration needs adding that enables/disabled their generation.
Because I tried to take the lazy option to start a project - I tried globally requiring tapestry, but then saw it's not on packagist yet... d'oh!
You should be able to create scaffolds for your content types, for example a blog scaffold would produce a new blog post file with the front matter filled from the users input.
This could be a basic configurable thing, or a base class that project maintainers extend to add their own scaffolds to.
e.g:
$:> tapestry make:blog
Please enter a title: My Blog Post
The file ['_blog/08-03-2017-my-blog-post.md'] was successfully created.
$:>
When a file has date set in its frontmatter e.g:
---
title: test
date: 11/09/2016
---
or
---
title: test
date: 1451606400
---
Then it's not converted to an instance of DateTime
which is what line 119 of ContentType is expecting. Expected behavior is that the date is always an instance of DateTime
with front matter input being injected.
In the future the frontmatter date property will be used for scheduling posts to become published at a certain time and so should accept either a date in the format DD/MM/YYYY or as a unix timestamp.
Currently there is nothing to stop the self-update tool from working if the user has installed via composer. Not that you can install via composer as per issue #11 unless you know how to force it.
TAPESTRY_START
is set upon bootstrapping, the app should listen for --stopwatch
and return how long execution took.
The arrayAccessByKey
method of the ContentTypeFactory
class has a bug where if $key
does not exist in the nameLookupTable
PHP will throw am Undefined offset error.
Third party tools such as Anvil should be able to easily configure Tapestry, this can be quite difficult when the configuration files are PHP arrays especially if you want them to remain human readable.
I propose allowing config files to be either a PHP array or a YAML file, with an exception thrown if both exist as the same time.
The init
command currently initiates a complex website project where it should just init the basics. The current project scaffold should have its own repository such as tapestry-example-site or some other such repo.
Tests that use the Symfony ApplicationTester
have to pass the input in the format of:
[
'command' => 'build',
0 => '--quiet',
'env' => 'development'
]
Which does not match the expected input of $_SERVER['argv']
when running on the actual command line:
[
0 => 'build',
1 => '--quiet',
2 => '--env=development'
]
Unit tests need refactoring so that the arguments passed to Tapestry are consistent with what it receives in the real world.
When updating a template within _templates folder, it doesn't invalidate the cache of the other templates that rely upon it.
michelf/php-markdown appears to be a more complete implementation of markdown over the currently used cebe/markdown package.
To reproduce create the file source\blog\index.phtml
with the below font matter:
---
layout: default
title: Blog Archive
use:
- blog
- blog_categories
generator:
- PaginationGenerator
pagination:
provider: blog
perPage: 3
---
Expected behaviour is that the files blog\index.html
, blog\1\index.html
, etc are generated. What actually happens is blog\index.html
gets generated as expected and then index\2.html
, index\3.html
and so on plus the urls that the pagination pages use are all incorrectly set to blog\index
.
next()
should be the newer link and previous()
should be the older link; they are currently the wrong way around.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.