Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Refactor PHP #131

Closed
daveredfern opened this issue Nov 7, 2016 · 7 comments
Closed

Refactor PHP #131

daveredfern opened this issue Nov 7, 2016 · 7 comments

Comments

@daveredfern
Copy link
Member

The PHP is becoming more and more of a mess. We need to bring it under control.

@daveredfern
Copy link
Member Author

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.

@daveredfern
Copy link
Member Author

daveredfern commented Nov 7, 2016

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:

image

So...

Title comes from folder name.
Docs comes from docs.md
Then each pattern is from each file.

@daveredfern
Copy link
Member Author

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

@daveredfern
Copy link
Member Author

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

@daveredfern
Copy link
Member Author

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.

@gazjoy
Copy link
Collaborator

gazjoy commented Nov 24, 2016

Also getLink needs to be added in: #42

@Triickii Triickii mentioned this issue Mar 3, 2017
@gazjoy
Copy link
Collaborator

gazjoy commented Mar 3, 2017

@daveredfern checkout the section-readme branch. @Triickii has done us a solid. Have a play/test and we can get this merged asap.

gazjoy pushed a commit that referenced this issue Mar 7, 2017
@gazjoy gazjoy mentioned this issue Mar 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants