Closed daveredfern closed 7 years ago
New folder structure:
data
inc -> framework
pattern
src
Inc becomes framework and encompasses everything that is chopchop code. The idea to make it easily upgradable.
Inside framework break down the files into more digestible nuggets.
Each pattern to exist as a folder with a base.php pattern. If a doc.md exists we want to pull that in. So an example:
pattern-name
pattern-name/1-base.php
pattern-name/2-variation.php
pattern-name/docs.md
It would be displayed something similar to this:
So...
Title comes from folder name. Docs comes from docs.md Then each pattern is from each file.
Inside a pattern we want the following options (although an easy way to add them would be amazing).
Code: true / false (true by default)
This toggles whether the view code link is visible/
Class: .classname
Functions that work inside each pattern:
printPattern('name-of-pattern', $data);
getPattern('name-of-pattern', $data);
getData('file-name', 'section', num);
PrintData('file-name', 'section', num);
getSvg('location-name');
printSvg('location-name');
getUrl('location'); // gets base url
A config file in the root called config.php would be good. Here we can change the folder order and structure. This currently lives in an array at the bottom of functions.php.
Also getLink needs to be added in: #42
@daveredfern checkout the section-readme branch. @Triickii has done us a solid. Have a play/test and we can get this merged asap.
The PHP is becoming more and more of a mess. We need to bring it under control.