docs: fix the custom templates path, and fill in what was missing - #21
Merged
Conversation
The documented path was wrong: storage/templates/pdf/ does not exist. Templates are found under storage/app/templates/pdf/, in both 2.x and 3.x, so anyone following this page literally created files that were never picked up. Also adds what the page left out and people have to discover by reading source: the variables a template is rendered with, the ?preview parameter for iterating on one as HTML, the font partial and why to keep it, and -- the sharpest edge -- that partials/table.blade.php is written once per type and then shared by every custom template of that type, so editing it changes them all. The .png is described as what it is: without one the tile renders blank rather than falling back to anything. Drops the version note, whose link pointed at the 2.0.0 tag while claiming v2.1.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The path was wrong
storage/templates/pdf/does not exist. Templates are found understorage/app/templates/pdf/— registered inAppServiceProvideras thepdf_templatesview namespace and as the disk root inconfig/filesystems.php.This is wrong for both 2.x and 3.x (
InvoiceShelf-2registers the identical path), which is why it goes onmasterrather than waiting for the v3 docs branch. Anyone following the page literally created files that were never picked up, with no error to explain why.What else was missing
Things you currently have to read the source to find out:
$invoice/$estimate,$customFields, the three addresses,$notes,$logo,$taxes.?previewon the PDF URL renders the template as HTML in the browser. It is by far the fastest way to iterate on one, and was undocumented.partials/table.blade.phpis written once per type and then included by every custom template of that type, so editing it changes them all. That is very much not what a file living under your template's directory looks like it does.Smaller fixes
.pngis described as what it actually is: without one the tile renders blank, rather than falling back to anything.2.0.0tag while claiming v2.1.0.